blob: 90848b8d5464a885ef030953109b7bea31f9b267 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/chrome_features.h"
#include <vector>
#include "base/command_line.h"
#include "base/no_destructor.h"
#include "base/strings/string_split.h"
#include "build/build_config.h"
#include "chrome/common/chrome_switches.h"
#include "extensions/buildflags/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
namespace features {
// All features in alphabetical order.
#if defined(OS_ANDROID)
const base::Feature kAddToHomescreenMessaging{
"AddToHomescreenMessaging", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
// Controls whether web apps can be installed via APKs on Chrome OS.
const base::Feature kApkWebAppInstalls{"ApkWebAppInstalls",
#endif // defined(OS_CHROMEOS)
#if defined(OS_MACOSX)
// Enables the "this OS is obsolete" infobar on Mac 10.9.
// TODO(ellyjones): Remove this after the last 10.9 release.
const base::Feature kShow10_9ObsoleteInfobar{"Show109ObsoleteInfobar",
// Use the Toolkit-Views Task Manager window.
const base::Feature kViewsTaskManager{"ViewsTaskManager",
#endif // defined(OS_MACOSX)
#if defined(OS_ANDROID)
// Enables messaging in site permissions UI informing user when notifications
// are disabled for the entire app.
const base::Feature kAppNotificationStatusMessaging{
"AppNotificationStatusMessaging", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_ANDROID)
#if !defined(OS_ANDROID)
// App Service related flags. See chrome/services/app_service/
// The App Service, which is a Mojo service, has a server component and
// multiple client components. Enabling the server component feature flag
// (AppServiceServer) will also enable a default set of clients.
// Some work-in-progress clients have their own additional feature flag, such
// as AppServiceAsh. Enabling any one of those client-specific feature flags
// also implicitly enables AppServiceServer.
const base::Feature kAppServiceAsh{"AppServiceAsh",
const base::Feature kAppServiceServer{"AppServiceServer",
#endif // !defined(OS_ANDROID)
// Enables the built-in DNS resolver.
const base::Feature kAsyncDns {
#if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_ANDROID)
#if defined(OS_ANDROID)
const base::Feature kAutoFetchOnNetErrorPage{"AutoFetchOnNetErrorPage",
#endif // defined(OS_ANDROID)
#if defined(OS_WIN) || defined(OS_LINUX)
// Enables the Restart background mode optimization. When all Chrome UI is
// closed and it goes in the background, allows to restart the browser to
// discard memory.
const base::Feature kBackgroundModeAllowRestart{
"BackgroundModeAllowRestart", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // defined(OS_WIN) || defined(OS_LINUX)
// Enables or disables whether permission prompts are automatically blocked
// after the user has explicitly dismissed them too many times.
const base::Feature kBlockPromptsIfDismissedOften{
"BlockPromptsIfDismissedOften", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables whether permission prompts are automatically blocked
// after the user has ignored them too many times.
const base::Feature kBlockPromptsIfIgnoredOften{
"BlockPromptsIfIgnoredOften", base::FEATURE_DISABLED_BY_DEFAULT};
// Once the user declines a notification permission prompt in a WebContents,
// automatically dismiss subsequent prompts in the same WebContents, from any
// origin, until the next user-initiated navigation.
const base::Feature kBlockRepeatedNotificationPermissionPrompts{
// Fixes for browser hang bugs are deployed in a field trial in order to measure
// their impact. See
const base::Feature kBrowserHangFixesExperiment{
"BrowserHangFixesExperiment", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables redirecting users who get an interstitial when
// accessing to local
// connection help content.
const base::Feature kBundledConnectionHelpFeature{
"BundledConnectionHelp", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the UI to configure caption settings.
const base::Feature kCaptionSettings{"CaptionSettings",
#if !defined(OS_ANDROID)
// Enables logging UKMs for background tab activity by TabActivityWatcher.
const base::Feature kTabMetricsLogging{"TabMetricsLogging",
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// Enables the blocking of third-party modules. This feature requires Windows 8
// or higher because it depends on the ProcessExtensionPointDisablePolicy
// mitigation, which was not available on Windows 7.
// Note: Due to a limitation in the implementation of this feature, it is
// required to start the browser two times to fully enable or disable it.
const base::Feature kThirdPartyModulesBlocking{
"ThirdPartyModulesBlocking", base::FEATURE_DISABLED_BY_DEFAULT};
#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX)
// Enables the dual certificate verification trial feature.
const base::Feature kCertDualVerificationTrialFeature{
"CertDualVerificationTrial", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables change picture video mode.
const base::Feature kChangePictureVideoMode{"ChangePictureVideoMode",
#if defined(OS_CHROMEOS)
// Enables passing additional user authentication in requests to DMServer
// (policy fetch, status report upload).
const base::Feature kDMServerOAuthForChildUser{
"DMServerOAuthForChildUser", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
// Enables clearing of browsing data which is older than given time period.
const base::Feature kClearOldBrowsingData{"ClearOldBrowsingData",
const base::Feature kClickToOpenPDFPlaceholder{
"ClickToOpenPDFPlaceholder", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_MACOSX)
const base::Feature kImmersiveFullscreen{"ImmersiveFullscreen",
#if defined(OS_CHROMEOS)
// Enable project Crostini, Linux VMs on Chrome OS.
const base::Feature kCrostini{"Crostini", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable additional Crostini session status reporting for
// managed devices only, i.e. reports of installed apps and kernel version.
const base::Feature kCrostiniAdditionalEnterpriseReporting{
"CrostiniAdditionalEnterpriseReporting", base::FEATURE_ENABLED_BY_DEFAULT};
// Enable advanced access controls for Crostini-related features
// (e.g. restricting VM CLI tools access, restricting Crostini root access).
const base::Feature kCrostiniAdvancedAccessControls{
"CrostiniAdvancedAccessControls", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables infrastructure for applying Ansible playbook to default Crostini
// container.
const base::Feature kCrostiniAnsibleInfrastructure{
"CrostiniAnsibleInfrastructure", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables the UI overhaul for Cups Printers in settings page.
const base::Feature kCupsPrintersUiOverhaul{"CupsPrintersUiOverhaul",
// Enable support for "Plugin VMs" on Chrome OS.
const base::Feature kPluginVm{"PluginVm", base::FEATURE_DISABLED_BY_DEFAULT};
// Whether the UsageTimeLimit policy should be applied to the user.
const base::Feature kUsageTimeLimitPolicy{"UsageTimeLimitPolicy",
// Allow a Wilco DTC (diagnostics and telemetry controller) on Chrome OS.
// More info about the project may be found here:
const base::Feature kWilcoDtc{"WilcoDtc", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable uploading of a zip archive of system logs instead of individual files.
const base::Feature kUploadZippedSystemLogs{"UploadZippedSystemLogs",
// Enable chrome://terminal. Terminal System App will only run on
// OS_CHROMEOS, but this flag must be defined for all platforms since
// it is required for SystemWebApp tests.
const base::Feature kTerminalSystemApp{"TerminalSystemApp",
// Enable using tab sharing infobars for desktop capture.
const base::Feature kDesktopCaptureTabSharingInfobar{
"DesktopCaptureTabSharingInfobar", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables new Desktop PWAs implementation that does not use
// extensions.
const base::Feature kDesktopPWAsWithoutExtensions{
"DesktopPWAsWithoutExtensions", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables local PWA installs to update their app manifest data if the site
// changes its manifest.
const base::Feature kDesktopPWAsLocalUpdating{"DesktopPWAsLocalUpdating",
// Enables or disables use of new Desktop PWAs browser controller (that uses the
// universal web_app::AppRegistrar) by extensions-based bookmark apps. Note that
// the new Desktop PWAs implementation (not based on extensions) always uses the
// new browser controller.
const base::Feature kDesktopPWAsUnifiedUiController{
"DesktopPWAsUnifiedUiController", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables use of new Desktop PWAs launch manager by
// extensions-based bookmark apps. (Note that Bookmark apps not based
// on extensions unconditionally use the new launch manager.)
const base::Feature kDesktopPWAsUnifiedLaunch{
"DesktopPWAsUnifiedLaunch", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables new Desktop PWAs Unified Sync and Storage (USS)
// implementation that does not use extensions. Requires
// kDesktopPWAsWithoutExtensions to be enabled.
const base::Feature kDesktopPWAsUSS{"DesktopPWAsUSS",
// Enables or disables the ability to install PWAs from the omnibox.
const base::Feature kDesktopPWAsOmniboxInstall{
"DesktopPWAsOmniboxInstall", base::FEATURE_ENABLED_BY_DEFAULT};
// Disables downloads of unsafe file types over HTTP.
const base::Feature kDisallowUnsafeHttpDownloads{
"DisallowUnsafeHttpDownloads", base::FEATURE_DISABLED_BY_DEFAULT};
const char kDisallowUnsafeHttpDownloadsParamName[] = "MimeTypeList";
// Enable DNS over HTTPS (DoH).
const base::Feature kDnsOverHttps{"DnsOverHttps",
// Set whether fallback to insecure DNS is allowed by default. This setting may
// be overridden for individual transactions.
const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
"Fallback", true};
// Supply one or more space-separated DoH server URI templates to use when this
// feature is enabled. If no templates are specified, then a hardcoded mapping
// will be used to construct a list of DoH templates associated with the IP
// addresses of insecure resolvers in the discovered configuration.
const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
&kDnsOverHttps, "Templates", ""};
#if defined(OS_ANDROID)
// Enable changing default downloads storage location on Android.
const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
// If enabled, Drive will use FCM for its invalidations.
const base::Feature kDriveFcmInvalidations{"DriveFCMInvalidations",
// If enabled, policies will use FCM (Firebase Cloud Messaging) for its
// invalidations.
const base::Feature kPolicyFcmInvalidations{"PolicyFCMInvalidations",
// Enables ambient authentication in incognito mode.
// TODO( Change to disabled by default after proper
// notice to use the policy to activate when required, M79-M80.
const base::Feature kEnableAmbientAuthenticationInIncognito{
"EnableAmbientAuthenticationInIncognito", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables ambient authentication in guest sessions.
// TODO( Change to disabled by default after proper
// notice to use the policy to activate when required, M79-M80.
const base::Feature kEnableAmbientAuthenticationInGuestSession{
#if !defined(OS_ANDROID)
// Upload enterprise cloud reporting without the extension.
const base::Feature kEnterpriseReportingInBrowser{
"EnterpriseReportingInBrowser", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables event-based status reporting for child accounts in Chrome OS.
const base::Feature kEventBasedStatusReporting{
"EventBasedStatusReporting", base::FEATURE_ENABLED_BY_DEFAULT};
// If enabled, this feature's |kExternalInstallDefaultButtonKey| field trial
// parameter value controls which |ExternalInstallBubbleAlert| button is the
// default.
const base::Feature kExternalExtensionDefaultButtonControl{
"ExternalExtensionDefaultButtonControl", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables Focus Mode which brings up a PWA-like window look.
const base::Feature kFocusMode{"FocusMode", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls Oculus support.
const base::Feature kOculusVR{"OculusVR", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls OpenVR support.
const base::Feature kOpenVR{"OpenVR", base::FEATURE_DISABLED_BY_DEFAULT};
// Controls Windows Mixed Reality support.
const base::Feature kWindowsMixedReality{"WindowsMixedReality",
// Controls OpenXR support.
const base::Feature kOpenXR{"OpenXR", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_WIN)
// Enables using GDI to print text as simply text.
const base::Feature kGdiTextPrinting{"GdiTextPrinting",
// Controls whether the GeoLanguage system is enabled. GeoLanguage uses IP-based
// coarse geolocation to provide an estimate (for use by other Chrome features
// such as Translate) of the local/regional language(s) corresponding to the
// device's location. If this feature is disabled, the GeoLanguage provider is
// not initialized at startup, and clients calling it will receive an empty list
// of languages.
const base::Feature kGeoLanguage{"GeoLanguage",
#if !defined(OS_ANDROID) && defined(GOOGLE_CHROME_BUILD)
const base::Feature kGoogleBrandedContextMenu{
"GoogleBrandedContextMenu", base::FEATURE_DISABLED_BY_DEFAULT};
#endif // !defined(OS_ANDROID) && defined(GOOGLE_CHROME_BUILD)
#if defined(OS_CHROMEOS)
// Enables or disables the Happiness Tracking System for the device.
const base::Feature kHappinessTrackingSystem{"HappinessTrackingSystem",
#if !defined(OS_ANDROID)
// Enables or disables the Happiness Tracking System for Desktop Chrome.
const base::Feature kHappinessTrackingSurveysForDesktop{
"HappinessTrackingSurveysForDesktop", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables the Happiness Tracking System demo mode for Desktop
// Chrome.
const base::Feature kHappinessTrackingSurveysForDesktopDemo{
#endif // !defined(OS_ANDROID)
// Enables committed error pages instead of transient navigation entries for
// HTTP auth interstitial pages (i.e. HTTP auth prompts initiated cross-origin).
const base::Feature kHTTPAuthCommittedInterstitials{
"HTTPAuthCommittedInterstitials", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables navigation suggestions UI for lookalike URLs (e.g. internationalized
// domain names that are visually similar to popular domains or to domains with
// engagement score, such as googlé.com).
const base::Feature kLookalikeUrlNavigationSuggestionsUI{
"LookalikeUrlNavigationSuggestionsUI", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// A feature that controls whether Chrome warns about incompatible applications.
// This feature requires Windows 10 or higher to work because it depends on
// the "Apps & Features" system settings.
const base::Feature kIncompatibleApplicationsWarning{
"IncompatibleApplicationsWarning", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables scraping of password-expiry information during SAML login flow, which
// can lead to an in-session flow for changing SAML password if it has expired.
// This is safe to enable by default since it does not cause the password-expiry
// information to be stored, or any user-visible change - in order for anything
// to happen, the domain administrator has to intentionally send this extra
// info in the SAML response, and enable the InSessionPasswordChange policy.
// So, this feature is just for disabling the scraping code if it causes
// any unforeseen issues.
const base::Feature kInSessionPasswordChange{"InSessionPasswordChange",
#endif // defined(OS_CHROMEOS)
#if defined(OS_ANDROID)
// Enables or disables the installable ambient badge infobar.
const base::Feature kInstallableAmbientBadgeInfoBar{
"InstallableAmbientBadgeInfoBar", base::FEATURE_ENABLED_BY_DEFAULT};
#if !defined(OS_ANDROID)
// Enables or disables intent picker.
const base::Feature kIntentPicker{"IntentPicker",
#endif // !defined(OS_ANDROID)
#if defined(OS_CHROMEOS)
const base::Feature kKernelnextVMs{"KernelnextVMs",
// Uses KidsManagement UrlClassification instead of SafeSearch for supervised
// accounts.
const base::Feature kKidsManagementUrlClassification{
"KidsManagementUrlClassification", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_MACOSX)
// Uses NSFullSizeContentViewWindowMask where available instead of adding our
// own views to the window frame. This is a temporary kill switch, it can be
// removed once we feel okay about leaving it on.
const base::Feature kMacFullSizeContentView{"MacFullSizeContentView",
#if defined(OS_MACOSX)
// Enables the Material Design download shelf on Mac.
const base::Feature kMacMaterialDesignDownloadShelf{
"MacMDDownloadShelf", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_MACOSX)
// In case a website is trying to use the camera/microphone, but Chrome itself
// is blocked on the system level to access these, show an icon in the Omnibox,
// which, when clicked, displays a bubble with information on how to toggle
// Chrome's system-level media permissions.
const base::Feature kMacSystemMediaPermissionsInfoUi{
"MacSystemMediaPermissionsInfoUI", base::FEATURE_DISABLED_BY_DEFAULT};
// Sets whether dismissing the new-tab-page override bubble counts as
// acknowledgement.
const base::Feature kAcknowledgeNtpOverrideOnDeactivate{
"AcknowledgeNtpOverrideOnDeactivate", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables or disables notification which pop-ups after managed guest session
// autolaunch
// TODO(owner:raleksandrov): Remove this after successful launch.
const base::Feature kManagedGuestSessionNotification{
"ManagedGuestSessionNotification", base::FEATURE_ENABLED_BY_DEFAULT};
#if !defined(OS_ANDROID)
const base::Feature kOnConnectNative{"OnConnectNative",
// Enables or disables modal permission prompts.
// TODO( Remove this.
const base::Feature kModalPermissionPrompts{"ModalPermissionPrompts",
// Enables the use of native notification centers instead of using the Message
// Center for displaying the toasts. The feature is hardcoded to enabled for
// Chrome OS.
const base::Feature kNativeNotifications{"NativeNotifications",
#if defined(OS_ANDROID)
// Changes the net error page UI by adding suggested offline content
// on the dino page.
const base::Feature kNewNetErrorPageUI{"NewNetErrorPageUI",
#endif // OS_ANDROID
#if defined(OS_POSIX)
// Enables NTLMv2, which implicitly disables NTLMv1.
const base::Feature kNtlmV2Enabled{"NtlmV2Enabled",
#if defined(OS_ANDROID)
// Enables or disabled the OOM intervention.
const base::Feature kOomIntervention{"OomIntervention",
// Adds the base language code to the Language-Accept headers if at least one
// corresponding language+region code is present in the user preferences.
// For example: "en-US, fr-FR" --> "en-US, en, fr-FR, fr".
const base::Feature kUseNewAcceptLanguageHeader{
"UseNewAcceptLanguageHeader", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables usage of Parent Access Code to authorize certain actions on child
// user device.
const base::Feature kParentAccessCode{"ParentAccessCode",
const base::Feature kParentAccessCodeForTimeChange{
"ParentAccessCodeForTimeChange", base::FEATURE_ENABLED_BY_DEFAULT};
// Delegate permissions to cross-origin iframes when the feature has been
// allowed by feature policy.
const base::Feature kPermissionDelegation{"PermissionDelegation",
// Disables PostScript generation when printing to PostScript capable printers
// and instead sends Emf files.
#if defined(OS_WIN)
const base::Feature kDisablePostScriptPrinting{
"DisablePostScriptPrinting", base::FEATURE_DISABLED_BY_DEFAULT};
// Allows prediction operations (e.g., prefetching) on all connection types.
const base::Feature kPredictivePrefetchingAllowedOnAllConnectionTypes{
// Allows Chrome to do preconnect when prerender fails.
const base::Feature kPrerenderFallbackToPreconnect{
"PrerenderFallbackToPreconnect", base::FEATURE_DISABLED_BY_DEFAULT};
// Show Flash deprecation warning to users who have manually enabled Flash.
const base::Feature kFlashDeprecationWarning{"FlashDeprecationWarning",
// If enabled, Print Preview will use the CloudPrinterHandler instead of the
// cloud print interface to communicate with the cloud print server. This
// prevents Print Preview from making direct network requests. See
const base::Feature kCloudPrinterHandler{"CloudPrinterHandler",
// If enabled, the Print Preview UI will use a different layout. See
const base::Feature kNewPrintPreviewLayout{"NewPrintPreviewLayout",
// Enables or disables push subscriptions keeping Chrome running in the
// background when closed.
const base::Feature kPushMessagingBackgroundMode{
"PushMessagingBackgroundMode", base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables permanent removal of Legacy Supervised Users on startup.
const base::Feature kRemoveSupervisedUsersOnStartup{
"RemoveSupervisedUsersOnStartup", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables Load image context menu item for broken images.
const base::Feature kLoadBrokenImagesFromContextMenu{
"LoadBrokenImagesFromContextMenu", base::FEATURE_ENABLED_BY_DEFAULT};
// Controls whether to show Safety Tip warnings on low-reputation sites.
const base::Feature kSafetyTipUI{"SafetyTip",
// Controls whether the user is prompted when sites request attestation.
const base::Feature kSecurityKeyAttestationPrompt{
"SecurityKeyAttestationPrompt", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_ANDROID)
const base::Feature kShowTrustedPublisherURL{"ShowTrustedPublisherURL",
// Alternative to switches::kSitePerProcess, for turning on full site isolation.
// Launch bug: This is a //chrome-layer feature to
// avoid turning on site-per-process by default for *all* //content embedders
// (e.g. this approach lets ChromeCast avoid site-per-process mode).
// TODO(alexmos): Move this and the other site isolation features below to
// browser_features, as they are only used on the browser side.
const base::Feature kSitePerProcess {
#if defined(OS_ANDROID)
// Controls a mode for dynamically process-isolating sites where the user has
// entered a password. This is intended to be used primarily when full site
// isolation is turned off. To check whether this mode is enabled, use
// ChromeSiteIsolationPolicy::IsIsolationForPasswordSitesEnabled() rather than
// checking the feature directly, since that decision is influenced by other
// factors as well.
const base::Feature kSiteIsolationForPasswordSites{
"site-isolation-for-password-sites", base::FEATURE_DISABLED_BY_DEFAULT};
// kSitePerProcessOnlyForHighMemoryClients is checked before kSitePerProcess,
// and (if enabled) can restrict if kSitePerProcess feature is checked at all -
// no check will be made on devices with low memory (these devices will have no
// Site Isolation via kSitePerProcess trials and won't activate either the
// control or the experiment group). The threshold for what is considered a
// "low memory" device is set (in MB) via a field trial param with the name
// defined below ("site-per-process-low-memory-cutoff-mb") and compared against
// base::SysInfo::AmountOfPhysicalMemoryMB().
const base::Feature kSitePerProcessOnlyForHighMemoryClients{
const char kSitePerProcessOnlyForHighMemoryClientsParamName[] =
#if defined(OS_CHROMEOS)
// Enables or disables automatic setup of USB printers.
const base::Feature kStreamlinedUsbPrinterSetup{
"StreamlinedUsbPrinterSetup", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables the ability to add a Samba Share to the Files app
const base::Feature kNativeSmb{"NativeSmb", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_CHROMEOS)
// Enables or disables the ability to use the sound content setting to mute a
// website.
const base::Feature kSoundContentSetting{"SoundContentSetting",
#if defined(OS_CHROMEOS)
// Enables or disables chrome://sys-internals.
const base::Feature kSysInternals{"SysInternals",
// Enables or disables the System Web App manager.
const base::Feature kSystemWebApps{"SystemWebApps",
// Enables or disables the App Management UI.
const base::Feature kAppManagement{"AppManagement",
// Disable downloads of unsafe file types over insecure transports if initiated
// from a secure page
const base::Feature kTreatUnsafeDownloadsAsActive{
"TreatUnsafeDownloadsAsActive", base::FEATURE_DISABLED_BY_DEFAULT};
const char kTreatUnsafeDownloadsAsActiveParamName[] = "ExtensionList";
// Enables or disables the intervention that unloads ad iframes with intensive
// resource usage.
const base::Feature kHeavyAdIntervention{"HeavyAdIntervention",
// Enables or disables the blocklist for the heavy ad intervention. This
// throttles the amount of interventions that can occur on a given host in a
// time period. This is separate from the intervention feature so it does not
// interfere with field trial activation, as this blocklist is created for every
// user.
const base::Feature kHeavyAdBlocklist{"HeavyAdBlocklist",
#if defined(OS_CHROMEOS)
// Enables or disables usage time state notifier for supervised accounts on
// Chrome OS.
const base::Feature kUsageTimeStateNotifier{"UsageTimeStateNotifier",
#if defined(OS_ANDROID)
const base::Feature kUseDisplayWideColorGamut{"UseDisplayWideColorGamut",
bool UseDisplayWideColorGamut() {
auto compute_use_display_wide_color_gamut = []() {
// Enabled this feature for devices listed in "enabled_models" field trial
// param. This is a comma separated list.
std::string enabled_models_list = base::GetFieldTrialParamValueByFeature(
kUseDisplayWideColorGamut, "enabled_models");
if (enabled_models_list.empty())
return false;
const char* current_model =
std::vector<std::string> enabled_models =
base::SplitString(enabled_models_list, ",", base::KEEP_WHITESPACE,
for (const std::string& model : enabled_models) {
if (model == current_model)
return true;
return false;
// As it takes some work to compute this, cache the result.
static base::NoDestructor<bool> is_wide_color_gamut_enabled(
return *is_wide_color_gamut_enabled;
#if defined(OS_CHROMEOS)
// Enables or disables the FTL signaling service for CRD sessions in Kiosk mode.
const base::Feature kUseFtlSignalingForCrdHostDelegate{
"UseFtlSignalingForCrdHostDelegate", base::FEATURE_ENABLED_BY_DEFAULT};
#if defined(OS_CHROMEOS)
// Enables or disables logging for adaptive screen brightness on Chrome OS.
const base::Feature kAdaptiveScreenBrightnessLogging{
"AdaptiveScreenBrightnessLogging", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables user activity event logging for power management on
// Chrome OS.
const base::Feature kUserActivityEventLogging{"UserActivityEventLogging",
// Enables using the main HTTP cache for media files as well.
const base::Feature kUseSameCacheForMedia{"UseSameCacheForMedia",
#if defined(OS_CHROMEOS)
// Enables support of libcups APIs from ARC
const base::Feature kArcCupsApi{"ArcCupsApi",
// Enables or disables serving printing requests from VMs on ChromeOS.
const base::Feature kCrosVmCupsProxy{"CrosVmCupsProxy",
// Enables or disables pin quick unlock.
// TODO( Remove this & the backing code.
const base::Feature kQuickUnlockPin{"QuickUnlockPin",
// Enables pin on the login screen.
const base::Feature kQuickUnlockPinSignin{"QuickUnlockPinSignin",
// Enables or disables fingerprint quick unlock.
const base::Feature kQuickUnlockFingerprint{"QuickUnlockFingerprint",
// Enables or disables the bulk printer policies on Chrome OS.
const base::Feature kBulkPrinters{"BulkPrinters",
// Enables or disables flash component updates on Chrome OS.
const base::Feature kCrosCompUpdates{"CrosCompUpdates",
// Enables or disables TPM firmware update capability on Chrome OS.
const base::Feature kTPMFirmwareUpdate{"TPMFirmwareUpdate",
// Enables or disables "usm" service in the list of user services returned by
// userInfo Gaia message.
const base::Feature kCrOSEnableUSMUserService{"CrOSEnableUSMUserService",
// Enables or disables initialization & use of the Chrome OS ML Service.
const base::Feature kMachineLearningService{"MachineLearningService",
// Enable USBGuard at the lockscreen on Chrome OS.
// TODO( Remove this kill-switch
const base::Feature kUsbguard{"USBGuard", base::FEATURE_DISABLED_BY_DEFAULT};
// Enable USB Bouncer for managing a device whitelist for USBGuard on Chrome OS.
const base::Feature kUsbbouncer{"USBBouncer",
// Enable support for multiple scheduler configurations.
const base::Feature kSchedulerConfiguration{"SchedulerConfiguration",
#endif // defined(OS_CHROMEOS)
#if !defined(OS_ANDROID)
// Allow capturing of WebRTC event logs, and uploading of those logs to Crash.
// Please note that a Chrome policy must also be set, for this to have effect.
// Effectively, this is a kill-switch for the feature.
// TODO( Remove this kill-switch.
const base::Feature kWebRtcRemoteEventLog{"WebRtcRemoteEventLog",
// Compress remote-bound WebRTC event logs (if used; see kWebRtcRemoteEventLog).
const base::Feature kWebRtcRemoteEventLogGzipped{
"WebRtcRemoteEventLogGzipped", base::FEATURE_ENABLED_BY_DEFAULT};
// Whether to enable "dark mode" enhancements in Mac Mojave or Windows 10 for
// UIs implemented with web technologies.
const base::Feature kWebUIDarkMode {
#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_ANDROID)
#endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_ANDROID)
#if defined(OS_WIN)
// Enables the accelerated default browser flow for Windows 10.
const base::Feature kWin10AcceleratedDefaultBrowserFlow{
"Win10AcceleratedDefaultBrowserFlow", base::FEATURE_ENABLED_BY_DEFAULT};
#endif // defined(OS_WIN)
// Enables writing basic system profile to the persistent histograms files
// earlier.
const base::Feature kWriteBasicSystemProfileToPersistentHistogramsFile{
} // namespace features