[DIPS] Add ability to check the state of the DIPS feature in Devtools

This CL adds a chrome devtools protocol implementation of a method to
check the state of a feature flag.

The method currently supports checking that the DIPS feature is enabled,
its `delete` param is set to true, and its `triggering_action` param is
not set to `none`. If used to check an unsupported feature's state, it
falls through to the content/ version of the method.

This CL also renames the `SystemInfoHandler` defined in
//chrome/browser/ui/webui/system_info_ui.cc to `SystemInfoUIHandler` to
avoid naming collisions.

Bug: 1432303
Change-Id: I0ba0614cfd88f13e33acfef31cef5c0d949c0abf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4514036
Reviewed-by: Andrey Kosyakov <[email protected]>
Reviewed-by: John Lee <[email protected]>
Commit-Queue: Joshua Hood <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1141831}
diff --git a/chrome/browser/devtools/protocol/system_info_handler.cc b/chrome/browser/devtools/protocol/system_info_handler.cc
new file mode 100644
index 0000000..8788073
--- /dev/null
+++ b/chrome/browser/devtools/protocol/system_info_handler.cc
@@ -0,0 +1,30 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/devtools/protocol/system_info_handler.h"
+
+#include "chrome/browser/dips/dips_features.h"
+#include "chrome/browser/dips/dips_utils.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/web_contents.h"
+
+SystemInfoHandler::SystemInfoHandler(protocol::UberDispatcher* dispatcher) {
+  protocol::SystemInfo::Dispatcher::wire(dispatcher, this);
+}
+
+SystemInfoHandler::~SystemInfoHandler() = default;
+
+protocol::Response SystemInfoHandler::GetFeatureState(
+    const std::string& in_featureState,
+    bool* featureEnabled) {
+  if (in_featureState == "DIPS") {
+    *featureEnabled =
+        base::FeatureList::IsEnabled(dips::kFeature) &&
+        dips::kDeletionEnabled.Get() &&
+        (dips::kTriggeringAction.Get() != DIPSTriggeringAction::kNone);
+    return protocol::Response::Success();
+  }
+
+  return protocol::Response::FallThrough();
+}