blob: 8788073972c3e6acccdb05f83983a23d6acca9f1 [file] [log] [blame]
Joshua Hoodf3192f02023-05-10 03:32:171// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/devtools/protocol/system_info_handler.h"
6
7#include "chrome/browser/dips/dips_features.h"
8#include "chrome/browser/dips/dips_utils.h"
9#include "content/public/browser/browser_thread.h"
10#include "content/public/browser/web_contents.h"
11
12SystemInfoHandler::SystemInfoHandler(protocol::UberDispatcher* dispatcher) {
13 protocol::SystemInfo::Dispatcher::wire(dispatcher, this);
14}
15
16SystemInfoHandler::~SystemInfoHandler() = default;
17
18protocol::Response SystemInfoHandler::GetFeatureState(
19 const std::string& in_featureState,
20 bool* featureEnabled) {
21 if (in_featureState == "DIPS") {
22 *featureEnabled =
23 base::FeatureList::IsEnabled(dips::kFeature) &&
24 dips::kDeletionEnabled.Get() &&
25 (dips::kTriggeringAction.Get() != DIPSTriggeringAction::kNone);
26 return protocol::Response::Success();
27 }
28
29 return protocol::Response::FallThrough();
30}