blob: f489a8b4ba6037277f5e799a9ee42eee1a1c18c6 [file] [log] [blame]
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flags.h"
#include <optional>
#include "base/command_line.h"
#include "base/metrics/field_trial_params.h"
#include "content/common/features.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
namespace content::webid {
bool IsMetricsEndpointEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmMetricsEndpoint);
}
bool IsDelegationEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmDelegation);
}
bool IsIdPRegistrationEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmIdPRegistration);
}
bool IsWithoutWellKnownEnforcementEnabled() {
return base::FeatureList::IsEnabled(
features::kFedCmWithoutWellKnownEnforcement);
}
bool IsDigitalCredentialsEnabled() {
return base::FeatureList::IsEnabled(features::kWebIdentityDigitalCredentials);
}
bool IsDigitalCredentialsCreationEnabled() {
return base::FeatureList::IsEnabled(
features::kWebIdentityDigitalCredentialsCreation);
}
bool IsSameSiteLaxEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmSameSiteLax);
}
bool IsLightweightModeEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmLightweightMode);
}
bool IsAlternativeIdentifiersEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmAlternativeIdentifiers);
}
bool IsUseOtherAccountAndLabelsNewSyntaxEnabled() {
return base::FeatureList::IsEnabled(
features::kFedCmUseOtherAccountAndLabelsNewSyntax);
}
bool IsAutofillEnabled() {
// FedCmAutofill is a new flag extracted from FedCmDelegation. To avoid
// breaking existing developer testing, we consider the new flag being enabled
// if the old one is enabled.
return base::FeatureList::IsEnabled(features::kFedCmAutofill) ||
IsDelegationEnabled();
}
bool IsIframeOriginEnabled() {
return base::FeatureList::IsEnabled(features::kFedCmIframeOrigin);
}
} // namespace content::webid