// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/device_signals/core/common/signals_features.h"

namespace enterprise_signals::features {

BASE_FEATURE(kAllowClientCertificateReportingForUsers,
             base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the addition of device signals fields to Profile-level Chrome
// Reports.
BASE_FEATURE(kProfileSignalsReportingEnabled, base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the collection of detected agent signals in Chrome report.
BASE_FEATURE(kDetectedAgentSignalCollectionEnabled,
             base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the addition of device signals fields to Browser-level Chrome
// Reports.
BASE_FEATURE(kBrowserSignalsReportingEnabled,
             base::FEATURE_DISABLED_BY_DEFAULT);

// Enables the collection of policies in a Chrome Profile signals report.
BASE_FEATURE(kPolicyDataCollectionEnabled, base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the collection of certificates in a Chrome Profile signals report.
BASE_FEATURE(kCertificateCollectionEnabled, base::FEATURE_DISABLED_BY_DEFAULT);

// Enables the versioned content bindings in signal reports.
BASE_FEATURE(kContentBindingVersioningEnabled,
             base::FEATURE_ENABLED_BY_DEFAULT);

// Controls whether a signals-only profile report will be triggered when a valid
// cookie change is observed.
constexpr base::FeatureParam<bool> kTriggerOnCookieChange{
    &kProfileSignalsReportingEnabled, "trigger_on_cookie_change", true};

// Controls the minimum interval that signals should be reported via profile
// reports.
// Example: "ProfileSignalsReportingEnabled:report_interval/3600" for 3600
// seconds.
constexpr base::FeatureParam<base::TimeDelta> kProfileSignalsReportingInterval{
    &kProfileSignalsReportingEnabled, "report_interval", base::Hours(4)};

bool IsProfileSignalsReportingEnabled() {
  return base::FeatureList::IsEnabled(kProfileSignalsReportingEnabled);
}

bool IsBrowserSignalsReportingEnabled() {
  return base::FeatureList::IsEnabled(kBrowserSignalsReportingEnabled);
}

bool IsDetectedAgentSignalCollectionEnabled() {
  return base::FeatureList::IsEnabled(kDetectedAgentSignalCollectionEnabled);
}

bool IsPolicyDataCollectionEnabled() {
  return base::FeatureList::IsEnabled(kPolicyDataCollectionEnabled);
}

bool IsCertificateCollectionEnabled() {
  return base::FeatureList::IsEnabled(kCertificateCollectionEnabled);
}

bool IsContentBindingVersioningEnabled() {
  return base::FeatureList::IsEnabled(kContentBindingVersioningEnabled);
}

BASE_FEATURE(kNewEvSignalsUnaffiliatedEnabled,
             base::FEATURE_DISABLED_BY_DEFAULT);

}  // namespace enterprise_signals::features
