1 // Copyright 2016 The Chromium Authors. All rights reserved.
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/common/chrome_features.h"
6
7 #include "base/command_line.h"
8 #include "base/feature_list.h"
9 #include "base/strings/string_split.h"
10 #include "build/build_config.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "extensions/buildflags/buildflags.h"
13 #include "ppapi/buildflags/buildflags.h"
14
15 namespace features {
16
17 // All features in alphabetical order.
18
19 #if BUILDFLAG(ENABLE_EXTENSIONS)
20 // Sets whether dismissing the new-tab-page override bubble counts as
21 // acknowledgement.
22 const base::Feature kAcknowledgeNtpOverrideOnDeactivate{
23 "AcknowledgeNtpOverrideOnDeactivate", base::FEATURE_DISABLED_BY_DEFAULT};
24 #endif
25
26 #if defined(OS_CHROMEOS)
27 // Enables or disables logging for adaptive screen brightness on Chrome OS.
28 const base::Feature kAdaptiveScreenBrightnessLogging{
29 "AdaptiveScreenBrightnessLogging", base::FEATURE_ENABLED_BY_DEFAULT};
30 #endif
31
32 #if defined(OS_ANDROID)
33 const base::Feature kAddToHomescreenMessaging{
34 "AddToHomescreenMessaging", base::FEATURE_DISABLED_BY_DEFAULT};
35 #endif
36
37 #if defined(OS_CHROMEOS)
38 // Shows a setting that allows disabling mouse acceleration.
39 const base::Feature kAllowDisableMouseAcceleration{
40 "AllowDisableMouseAcceleration", base::FEATURE_ENABLED_BY_DEFAULT};
41 #endif
42
43 // Always reinstall system web apps, instead of only doing so after version
44 // upgrade or locale changes.
45 const base::Feature kAlwaysReinstallSystemWebApps{
46 "ReinstallSystemWebApps", base::FEATURE_DISABLED_BY_DEFAULT};
47
48 #if defined(OS_ANDROID)
49 const base::Feature kAndroidDarkSearch{"AndroidDarkSearch",
50 base::FEATURE_DISABLED_BY_DEFAULT};
51 #endif // defined(OS_ANDROID)
52
53 #if defined(OS_CHROMEOS)
54 // Controls whether web apps can be installed via APKs on Chrome OS.
55 const base::Feature kApkWebAppInstalls{"ApkWebAppInstalls",
56 base::FEATURE_ENABLED_BY_DEFAULT};
57 #endif // defined(OS_CHROMEOS)
58
59 #if defined(OS_CHROMEOS)
60 // Enables app activity reporting for child user.
61 // Requires |kPerAppTimeLimits| to be enabled.
62 const base::Feature kAppActivityReporting{"AppActivityReporting",
63 base::FEATURE_ENABLED_BY_DEFAULT};
64 #endif
65
66 #if !defined(OS_ANDROID)
67 // App Service related flags. See components/services/app_service/README.md.
68 const base::Feature kAppServiceAdaptiveIcon{"AppServiceAdaptiveIcon",
69 base::FEATURE_DISABLED_BY_DEFAULT};
70 const base::Feature kAppServiceExternalProtocol{
71 "AppServiceExternalProtocol", base::FEATURE_DISABLED_BY_DEFAULT};
72 const base::Feature kAppServiceIntentHandling{"AppServiceIntentHandling",
73 base::FEATURE_ENABLED_BY_DEFAULT};
74 #endif // !defined(OS_ANDROID)
75
76 #if defined(OS_MAC)
77 // Can be used to disable RemoteCocoa (hosting NSWindows for apps in the app
78 // process). For debugging purposes only.
79 const base::Feature kAppShimRemoteCocoa{"AppShimRemoteCocoa",
80 base::FEATURE_ENABLED_BY_DEFAULT};
81
82 // This is used to control the new app close behavior on macOS wherein closing
83 // all windows for an app leaves the app running.
84 // https://crbug.com/1080729
85 const base::Feature kAppShimNewCloseBehavior{"AppShimNewCloseBehavior",
86 base::FEATURE_DISABLED_BY_DEFAULT};
87 #endif // defined(OS_MAC)
88
89 // Enables the built-in DNS resolver.
90 const base::Feature kAsyncDns {
91 "AsyncDns",
92 #if defined(OS_CHROMEOS) || defined(OS_MAC) || defined(OS_ANDROID)
93 base::FEATURE_ENABLED_BY_DEFAULT
94 #else
95 base::FEATURE_DISABLED_BY_DEFAULT
96 #endif
97 };
98
99 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
100 // Enables the Restart background mode optimization. When all Chrome UI is
101 // closed and it goes in the background, allows to restart the browser to
102 // discard memory.
103 const base::Feature kBackgroundModeAllowRestart{
104 "BackgroundModeAllowRestart", base::FEATURE_DISABLED_BY_DEFAULT};
105 #endif // defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD)
106
107 #if defined(OS_CHROMEOS)
108 // Enable Borealis on Chrome OS.
109 const base::Feature kBorealis{"Borealis", base::FEATURE_DISABLED_BY_DEFAULT};
110 #endif
111
112 #if BUILDFLAG(TRIAL_COMPARISON_CERT_VERIFIER_SUPPORTED)
113 // Enables the dual certificate verification trial feature.
114 // https://crbug.com/649026
115 const base::Feature kCertDualVerificationTrialFeature{
116 "CertDualVerificationTrial", base::FEATURE_DISABLED_BY_DEFAULT};
117 #endif
118
119 // Enables change picture video mode.
120 const base::Feature kChangePictureVideoMode{"ChangePictureVideoMode",
121 base::FEATURE_ENABLED_BY_DEFAULT};
122
123 #if defined(OS_WIN)
124 const base::Feature kChromeCleanupScanCompletedNotification{
125 "ChromeCleanupScanCompletedNotification",
126 base::FEATURE_DISABLED_BY_DEFAULT};
127 #endif
128
129 #if defined(OS_ANDROID)
130 // Enables clearing of browsing data which is older than given time period.
131 const base::Feature kClearOldBrowsingData{"ClearOldBrowsingData",
132 base::FEATURE_DISABLED_BY_DEFAULT};
133 #endif
134
135 const base::Feature kClickToOpenPDFPlaceholder{
136 "ClickToOpenPDFPlaceholder", base::FEATURE_ENABLED_BY_DEFAULT};
137
138 const base::Feature kClientStorageAccessContextAuditing{
139 "ClientStorageAccessContextAuditing", base::FEATURE_DISABLED_BY_DEFAULT};
140
141 const base::Feature kContentSettingsRedesign{"ContentSettingsRedesign",
142 base::FEATURE_DISABLED_BY_DEFAULT};
143
144 // Enables a redesign of the cookies page.
145 const base::Feature kCookiesPageRedesign{"CookiesPageRedesign",
146 base::FEATURE_DISABLED_BY_DEFAULT};
147
148 #if defined(OS_ANDROID)
149 // Restricts all of Chrome's threads to use only LITTLE cores on big.LITTLE
150 // architectures.
151 const base::Feature kCpuAffinityRestrictToLittleCores{
152 "CpuAffinityRestrictToLittleCores", base::FEATURE_DISABLED_BY_DEFAULT};
153 #endif
154
155 #if defined(OS_CHROMEOS)
156 // Enables or disables "usm" service in the list of user services returned by
157 // userInfo Gaia message.
158 const base::Feature kCrOSEnableUSMUserService{"CrOSEnableUSMUserService",
159 base::FEATURE_ENABLED_BY_DEFAULT};
160
161 // Enables or disables flash component updates on Chrome OS.
162 const base::Feature kCrosCompUpdates{"CrosCompUpdates",
163 base::FEATURE_ENABLED_BY_DEFAULT};
164
165 // Enable project Crostini, Linux VMs on Chrome OS.
166 const base::Feature kCrostini{"Crostini", base::FEATURE_DISABLED_BY_DEFAULT};
167
168 // Enable additional Crostini session status reporting for
169 // managed devices only, i.e. reports of installed apps and kernel version.
170 const base::Feature kCrostiniAdditionalEnterpriseReporting{
171 "CrostiniAdditionalEnterpriseReporting", base::FEATURE_ENABLED_BY_DEFAULT};
172
173 // Enable advanced access controls for Crostini-related features
174 // (e.g. restricting VM CLI tools access, restricting Crostini root access).
175 const base::Feature kCrostiniAdvancedAccessControls{
176 "CrostiniAdvancedAccessControls", base::FEATURE_DISABLED_BY_DEFAULT};
177
178 // Enables infrastructure for applying Ansible playbook to default Crostini
179 // container.
180 const base::Feature kCrostiniAnsibleInfrastructure{
181 "CrostiniAnsibleInfrastructure", base::FEATURE_ENABLED_BY_DEFAULT};
182
183 // Enables infrastructure for generating Ansible playbooks for the default
184 // Crostini container from software configurations in JSON schema.
185 const base::Feature kCrostiniAnsibleSoftwareManagement{
186 "CrostiniAnsibleSoftwareManagement", base::FEATURE_DISABLED_BY_DEFAULT};
187
188 // Enables support for sideloading android apps into Arc via crostini.
189 const base::Feature kCrostiniArcSideload{"CrostiniArcSideload",
190 base::FEATURE_ENABLED_BY_DEFAULT};
191
192 // Enables custom UI for forcibly closing unresponsive windows.
193 const base::Feature kCrostiniForceClose{"CrostiniForceClose",
194 base::FEATURE_ENABLED_BY_DEFAULT};
195
196 // Enables distributed model for TPM1.2, i.e., using tpm_managerd and
197 // attestationd.
198 const base::Feature kCryptohomeDistributedModel{
199 "CryptohomeDistributedModel", base::FEATURE_DISABLED_BY_DEFAULT};
200
201 // Enables cryptohome UserDataAuth interface, a new dbus interface that is
202 // fully protobuf and uses libbrillo for dbus instead of the deprecated
203 // glib-dbus.
204 const base::Feature kCryptohomeUserDataAuth{"CryptohomeUserDataAuth",
205 base::FEATURE_DISABLED_BY_DEFAULT};
206
207 // Kill switch for cryptohome UserDataAuth interface. UserDataAuth is a new
208 // dbus interface that is fully protobuf and uses libbrillo for dbus instead
209 // instead of the deprecated glib-dbus.
210 const base::Feature kCryptohomeUserDataAuthKillswitch{
211 "CryptohomeUserDataAuthKillswitch", base::FEATURE_DISABLED_BY_DEFAULT};
212 #endif
213
214 #if defined(OS_CHROMEOS)
215 // Enables parsing and enforcing Data Leak Prevention policy rules that
216 // restricts usage of some system features, e.g.clipboard, screenshot, etc.
217 // for confidential content.
218 const base::Feature kDataLeakPreventionPolicy{"DataLeakPreventionPolicy",
219 base::FEATURE_ENABLED_BY_DEFAULT};
220 #endif
221
222 #if defined(OS_CHROMEOS)
223 // Enables passing additional user authentication in requests to DMServer
224 // (policy fetch, status report upload).
225 const base::Feature kDMServerOAuthForChildUser{
226 "DMServerOAuthForChildUser", base::FEATURE_ENABLED_BY_DEFAULT};
227 #endif
228
229 #if !defined(OS_ANDROID)
230 // Whether to allow installed-by-default web apps to be installed or not.
231 const base::Feature kDefaultWebAppInstallation{
232 "DefaultWebAppInstallation", base::FEATURE_ENABLED_BY_DEFAULT};
233 #endif
234
235 // Enable using tab sharing infobars for desktop capture.
236 const base::Feature kDesktopCaptureTabSharingInfobar{
237 "DesktopCaptureTabSharingInfobar", base::FEATURE_ENABLED_BY_DEFAULT};
238
239 // Enables Desktop PWA installs to have a menu of shortcuts associated with
240 // the app icon in the taskbar on Windows, or the dock on macOS or Linux.
241 const base::Feature kDesktopPWAsAppIconShortcutsMenu{
242 "DesktopPWAsAppIconShortcutsMenu", base::FEATURE_ENABLED_BY_DEFAULT};
243
244 // When installing default installed PWAs, we wait for service workers
245 // to cache resources.
246 const base::Feature kDesktopPWAsCacheDuringDefaultInstall{
247 "DesktopPWAsCacheDuringDefaultInstall", base::FEATURE_ENABLED_BY_DEFAULT};
248
249 // Enables local PWA installs to update their app manifest data if the site
250 // changes its manifest.
251 const base::Feature kDesktopPWAsLocalUpdating{"DesktopPWAsLocalUpdating",
252 base::FEATURE_ENABLED_BY_DEFAULT};
253
254 // Enables or disables the WebAppMigrationUserDisplayModeCleanUp code for
255 // cleaning up the fallout of https://crbug.com/1125020.
256 const base::Feature kDesktopPWAsMigrationUserDisplayModeCleanUp{
257 "DesktopPWAsMigrationUserDisplayModeCleanUp",
258 base::FEATURE_ENABLED_BY_DEFAULT};
259
260 // Enables or disables Desktop PWAs to be auto-started on OS login.
261 const base::Feature kDesktopPWAsRunOnOsLogin{"DesktopPWAsRunOnOsLogin",
262 base::FEATURE_DISABLED_BY_DEFAULT};
263
264 // Enables or disables usage of shared LevelDB instance (ModelTypeStoreService).
265 // If this flag is disabled, the new Web Apps system uses its own isolated
266 // LevelDB instance for manual testing purposes. Requires
267 // kDesktopPWAsWithoutExtensions to be enabled.
268 // TODO(crbug.com/877898): Delete this feature flag before
269 // kDesktopPWAsWithoutExtensions launch.
270 const base::Feature kDesktopPWAsSharedStoreService{
271 "DesktopPWAsSharedStoreService", base::FEATURE_ENABLED_BY_DEFAULT};
272
273 // Adds a tab strip to PWA windows, used for UI experimentation.
274 // TODO(crbug.com/897314): Enable this feature.
275 const base::Feature kDesktopPWAsTabStrip{"DesktopPWAsTabStrip",
276 base::FEATURE_DISABLED_BY_DEFAULT};
277
278 // Makes user navigations via links within web app scopes get captured tab
279 // tabbed app windows.
280 // TODO(crbug.com/897314): Enable this feature.
281 const base::Feature kDesktopPWAsTabStripLinkCapturing{
282 "DesktopPWAsTabStripLinkCapturing", base::FEATURE_DISABLED_BY_DEFAULT};
283
284 // Enables or disables new Desktop PWAs implementation that does not use
285 // extensions.
286 const base::Feature kDesktopPWAsWithoutExtensions{
287 "DesktopPWAsWithoutExtensions", base::FEATURE_ENABLED_BY_DEFAULT};
288
289 // Enable DNS over HTTPS (DoH).
290 const base::Feature kDnsOverHttps {
291 "DnsOverHttps",
292 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) || \
293 defined(OS_ANDROID)
294 base::FEATURE_ENABLED_BY_DEFAULT
295 #else
296 base::FEATURE_DISABLED_BY_DEFAULT
297 #endif
298 };
299
300 // Provides a mechanism to remove providers from the dropdown list in the
301 // settings UI. Separate multiple provider ids with commas. See the
302 // mapping in net/dns/dns_util.cc for provider ids.
303 const base::FeatureParam<std::string> kDnsOverHttpsDisabledProvidersParam{
304 &kDnsOverHttps, "DisabledProviders", ""};
305
306 // Set whether fallback to insecure DNS is allowed by default. This setting may
307 // be overridden for individual transactions.
308 const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
309 "Fallback", true};
310
311 // Sets whether the DoH setting is displayed in the settings UI.
312 const base::FeatureParam<bool> kDnsOverHttpsShowUiParam {
313 &kDnsOverHttps, "ShowUi",
314 #if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MAC) || \
315 defined(OS_ANDROID)
316 true
317 #else
318 false
319 #endif
320 };
321
322 // Supply one or more space-separated DoH server URI templates to use when this
323 // feature is enabled. If no templates are specified, then a hardcoded mapping
324 // will be used to construct a list of DoH templates associated with the IP
325 // addresses of insecure resolvers in the discovered configuration.
326 const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
327 &kDnsOverHttps, "Templates", ""};
328
329 #if defined(OS_ANDROID)
330 // Enable changing default downloads storage location on Android.
331 const base::Feature kDownloadsLocationChange{"DownloadsLocationChange",
332 base::FEATURE_ENABLED_BY_DEFAULT};
333 #endif
334
335 #if defined(OS_ANDROID)
336 // Enable loading native libraries earlier in startup on Android.
337 const base::Feature kEarlyLibraryLoad{"EarlyLibraryLoad",
338 base::FEATURE_DISABLED_BY_DEFAULT};
339 #endif
340
341 // Enables all registered system web apps, regardless of their respective
342 // feature flags.
343 const base::Feature kEnableAllSystemWebApps{"EnableAllSystemWebApps",
344 base::FEATURE_DISABLED_BY_DEFAULT};
345
346 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) || \
347 defined(OS_MAC)
COMPONENT_EXPORT(CHROME_FEATURES) const348 COMPONENT_EXPORT(CHROME_FEATURES)
349 // Enables ephemeral Guest profiles on desktop.
350 extern const base::Feature kEnableEphemeralGuestProfilesOnDesktop{
351 "EnableEphemeralGuestProfilesOnDesktop", base::FEATURE_DISABLED_BY_DEFAULT};
352 #endif // defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD) ||
353 // defined(OS_MAC)
354
355 #if defined(OS_WIN)
356 // Enables users to create a desktop shortcut for incognito mode.
357 const base::Feature kEnableIncognitoShortcutOnDesktop{
358 "EnableIncognitoShortcutOnDesktop", base::FEATURE_DISABLED_BY_DEFAULT};
359 #endif
360
361 #if defined(OS_MAC)
362 const base::Feature kEnterpriseReportingApiKeychainRecreation{
363 "EnterpriseReportingApiKeychainRecreation",
364 base::FEATURE_DISABLED_BY_DEFAULT};
365 #endif
366
367 #if defined(OS_CHROMEOS)
368 // Upload enterprise cloud reporting from Chrome OS.
369 const base::Feature kEnterpriseReportingInChromeOS{
370 "EnterpriseReportingInChromeOS", base::FEATURE_DISABLED_BY_DEFAULT};
371 #endif
372
373 #if defined(OS_CHROMEOS)
374 // Enables event-based status reporting for child accounts in Chrome OS.
375 const base::Feature kEventBasedStatusReporting{
376 "EventBasedStatusReporting", base::FEATURE_ENABLED_BY_DEFAULT};
377 #endif
378
379 #if !defined(OS_ANDROID)
380 // Enables real-time reporting for extension request
381 const base::Feature kEnterpriseRealtimeExtensionRequest{
382 "EnterpriseRealtimeExtensionRequest", base::FEATURE_ENABLED_BY_DEFAULT};
383 #endif
384
385 // If enabled, this feature's |kExternalInstallDefaultButtonKey| field trial
386 // parameter value controls which |ExternalInstallBubbleAlert| button is the
387 // default.
388 const base::Feature kExternalExtensionDefaultButtonControl{
389 "ExternalExtensionDefaultButtonControl", base::FEATURE_DISABLED_BY_DEFAULT};
390
391 #if BUILDFLAG(ENABLE_PLUGINS)
392 // Show Flash deprecation warning to users who have manually enabled Flash.
393 // https://crbug.com/918428
394 const base::Feature kFlashDeprecationWarning{"FlashDeprecationWarning",
395 base::FEATURE_ENABLED_BY_DEFAULT};
396 #endif
397
398 // Enables or disables the FlocIdComputed event logging, which happens when a
399 // floc id is first computed for a browsing session or is refreshed due to a
400 // long period of time has passed since the last computation.
401 const base::Feature kFlocIdComputedEventLogging{
402 "FlocIdComputedEventLogging", base::FEATURE_ENABLED_BY_DEFAULT};
403
404 // If enabled, the sim-hash floc computed from history will be further encoded
405 // based on the sorting-lsh.
406 const base::Feature kFlocIdSortingLshBasedComputation{
407 "FlocIdSortingLshBasedComputation", base::FEATURE_DISABLED_BY_DEFAULT};
408
409 // Enables Focus Mode which brings up a PWA-like window look.
410 const base::Feature kFocusMode{"FocusMode", base::FEATURE_DISABLED_BY_DEFAULT};
411
412 #if defined(OS_WIN)
413 // Enables using GDI to print text as simply text.
414 const base::Feature kGdiTextPrinting{"GdiTextPrinting",
415 base::FEATURE_DISABLED_BY_DEFAULT};
416 #endif
417
418 // Controls whether the GeoLanguage system is enabled. GeoLanguage uses IP-based
419 // coarse geolocation to provide an estimate (for use by other Chrome features
420 // such as Translate) of the local/regional language(s) corresponding to the
421 // device's location. If this feature is disabled, the GeoLanguage provider is
422 // not initialized at startup, and clients calling it will receive an empty list
423 // of languages.
424 const base::Feature kGeoLanguage{"GeoLanguage",
425 base::FEATURE_DISABLED_BY_DEFAULT};
426
427 #if !defined(OS_ANDROID)
428 // Enables or disables the Happiness Tracking System for Desktop Chrome.
429 const base::Feature kHappinessTrackingSurveysForDesktop{
430 "HappinessTrackingSurveysForDesktop", base::FEATURE_DISABLED_BY_DEFAULT};
431
432 // Enables or disables the Happiness Tracking System demo mode for Desktop
433 // Chrome.
434 const base::Feature kHappinessTrackingSurveysForDesktopDemo{
435 "HappinessTrackingSurveysForDesktopDemo",
436 base::FEATURE_DISABLED_BY_DEFAULT};
437
438 // Enables or disables the Happiness Tracking System for same-site cookies
439 // issues in Chrome DevTools on Desktop.
440 const base::Feature
441 kHappinessTrackingSurveysForDesktopDevToolsIssuesCookiesSameSite{
442 "HappinessTrackingSurveysForDesktopDevToolsIssuesCookiesSameSite",
443 base::FEATURE_DISABLED_BY_DEFAULT};
444
445 // Enables the migration of Happiness Tracking Surveys on Desktop (to the latest
446 // version).
447 const base::Feature kHappinessTrackingSurveysForDesktopMigration{
448 "HappinessTrackingSurveysForDesktopMigration",
449 base::FEATURE_ENABLED_BY_DEFAULT};
450
451 // Enables or disables the Happiness Tracking System for Desktop Chrome
452 // Settings.
453 const base::Feature kHappinessTrackingSurveysForDesktopSettings{
454 "HappinessTrackingSurveysForDesktopSettings",
455 base::FEATURE_DISABLED_BY_DEFAULT};
456
457 // Enables or disables the Happiness Tracking System for Desktop Chrome
458 // Privacy Settings.
459 const base::Feature kHappinessTrackingSurveysForDesktopSettingsPrivacy{
460 "HappinessTrackingSurveysForDesktopSettingsPrivacy",
461 base::FEATURE_DISABLED_BY_DEFAULT};
462 #endif // !defined(OS_ANDROID)
463
464 #if defined(OS_CHROMEOS)
465 // Enables or disables the Happiness Tracking System for the device.
466 const base::Feature kHappinessTrackingSystem{"HappinessTrackingSystem",
467 base::FEATURE_DISABLED_BY_DEFAULT};
468 #endif
469
470 // Enables or disables the intervention that unloads ad iframes with intensive
471 // resource usage.
472 const base::Feature kHeavyAdIntervention{"HeavyAdIntervention",
473 base::FEATURE_DISABLED_BY_DEFAULT};
474
475 // Enables or disables reporting on the intervention that unloads ad iframes
476 // with intensive resource usage.
477 const base::Feature kHeavyAdInterventionWarning{
478 "HeavyAdInterventionWarning", base::FEATURE_ENABLED_BY_DEFAULT};
479
480 // Enables or disables the privacy mitigations for the heavy ad intervention.
481 // This throttles the amount of interventions that can occur on a given host in
482 // a time period. It also adds noise to the thresholds used. This is separate
483 // from the intervention feature so it does not interfere with field trial
484 // activation, as this blocklist is created for every user, and noise is decided
485 // prior to seeing a heavy ad.
486 const base::Feature kHeavyAdPrivacyMitigations{
487 "HeavyAdPrivacyMitigations", base::FEATURE_ENABLED_BY_DEFAULT};
488
489 #if defined(OS_MAC)
490 const base::Feature kImmersiveFullscreen{"ImmersiveFullscreen",
491 base::FEATURE_DISABLED_BY_DEFAULT};
492 #endif
493
494 #if defined(OS_CHROMEOS)
495 // Enables scraping of password-expiry information during SAML login flow, which
496 // can lead to an in-session flow for changing SAML password if it has expired.
497 // This is safe to enable by default since it does not cause the password-expiry
498 // information to be stored, or any user-visible change - in order for anything
499 // to happen, the domain administrator has to intentionally send this extra
500 // info in the SAML response, and enable the InSessionPasswordChange policy.
501 // So, this feature is just for disabling the scraping code if it causes
502 // any unforeseen issues.
503 const base::Feature kInSessionPasswordChange{"InSessionPasswordChange",
504 base::FEATURE_ENABLED_BY_DEFAULT};
505 #endif // defined(OS_CHROMEOS)
506
507 #if defined(OS_WIN)
508 // A feature that controls whether Chrome warns about incompatible applications.
509 // This feature requires Windows 10 or higher to work because it depends on
510 // the "Apps & Features" system settings.
511 const base::Feature kIncompatibleApplicationsWarning{
512 "IncompatibleApplicationsWarning", base::FEATURE_DISABLED_BY_DEFAULT};
513 #endif
514
515 #if defined(OS_ANDROID)
516 // Enables or disables the installable ambient badge infobar.
517 const base::Feature kInstallableAmbientBadgeInfoBar{
518 "InstallableAmbientBadgeInfoBar", base::FEATURE_ENABLED_BY_DEFAULT};
519 #endif
520
521 #if !defined(OS_ANDROID)
522 // Support sharing in Chrome OS intent handling.
523 const base::Feature kIntentHandlingSharing{"IntentHandlingSharing",
524 base::FEATURE_DISABLED_BY_DEFAULT};
525 // Allow user to have preference for PWA in the intent picker.
526 const base::Feature kIntentPickerPWAPersistence{
527 "IntentPickerPWAPersistence", base::FEATURE_DISABLED_BY_DEFAULT};
528 #endif // !defined(OS_ANDROID)
529
530 // If enabled, CloudPolicyInvalidator and RemoteCommandInvalidator instances
531 // will have unique owner name.
532 const base::Feature kInvalidatorUniqueOwnerName{
533 "InvalidatorUniqueOwnerName", base::FEATURE_DISABLED_BY_DEFAULT};
534
535 #if defined(OS_CHROMEOS)
536 const base::Feature kKernelnextVMs{"KernelnextVMs",
537 base::FEATURE_DISABLED_BY_DEFAULT};
538 #endif
539
540 // Enables LiteVideos, a data-saving optimization that throttles media requests
541 // to reduce the bitrate of adaptive media streams. Only for Lite mode users
542 // (formerly DataSaver).
543 const base::Feature kLiteVideo{"LiteVideo", base::FEATURE_DISABLED_BY_DEFAULT};
544
545 #if defined(OS_MAC)
546 // Uses NSFullSizeContentViewWindowMask where available instead of adding our
547 // own views to the window frame. This is a temporary kill switch, it can be
548 // removed once we feel okay about leaving it on.
549 const base::Feature kMacFullSizeContentView{"MacFullSizeContentView",
550 base::FEATURE_ENABLED_BY_DEFAULT};
551
552 #endif
553
554 #if defined(OS_MAC)
555 // Enables the Material Design download shelf on Mac.
556 const base::Feature kMacMaterialDesignDownloadShelf{
557 "MacMDDownloadShelf", base::FEATURE_ENABLED_BY_DEFAULT};
558 #endif
559
560 #if defined(OS_MAC)
561 // In case a website is trying to use the camera/microphone, but Chrome itself
562 // is blocked on the system level to access these, show an icon in the Omnibox,
563 // which, when clicked, displays a bubble with information on how to toggle
564 // Chrome's system-level media permissions.
565 const base::Feature kMacSystemMediaPermissionsInfoUi{
566 "MacSystemMediaPermissionsInfoUI", base::FEATURE_ENABLED_BY_DEFAULT};
567
568 // Enable screen capture system permission check on Mac 10.15+.
569 const base::Feature kMacSystemScreenCapturePermissionCheck{
570 "MacSystemScreenCapturePermissionCheck", base::FEATURE_ENABLED_BY_DEFAULT};
571 #endif
572
573 #if defined(OS_CHROMEOS)
574 // Whether to show the Metered toggle in Settings, allowing users to toggle
575 // whether to treat a WiFi or Cellular network as 'metered'.
576 const base::Feature kMeteredShowToggle{"MeteredShowToggle",
577 base::FEATURE_DISABLED_BY_DEFAULT};
578 #endif
579
580 #if defined(OS_ANDROID)
581 // Enables the new design of metrics settings.
582 const base::Feature kMetricsSettingsAndroid{"MetricsSettingsAndroid",
583 base::FEATURE_DISABLED_BY_DEFAULT};
584 #endif
585
586 // Enables the use of native notification centers instead of using the Message
587 // Center for displaying the toasts. The feature is hardcoded to enabled for
588 // Chrome OS.
589 #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) && !defined(OS_CHROMEOS)
590 const base::Feature kNativeNotifications{"NativeNotifications",
591 base::FEATURE_ENABLED_BY_DEFAULT};
592 #endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
593
594 // When kNoReferrers is enabled, most HTTP requests will provide empty
595 // referrers instead of their ordinary behavior.
596 const base::Feature kNoReferrers{"NoReferrers",
597 base::FEATURE_DISABLED_BY_DEFAULT};
598
599 #if defined(OS_WIN)
600 // Changes behavior of requireInteraction for notifications. Instead of staying
601 // on-screen until dismissed, they are instead shown for a very long time.
602 const base::Feature kNotificationDurationLongForRequireInteraction{
603 "NotificationDurationLongForRequireInteraction",
604 base::FEATURE_DISABLED_BY_DEFAULT};
605 #endif // OS_WIN
606
607 #if defined(OS_POSIX)
608 // Enables NTLMv2, which implicitly disables NTLMv1.
609 const base::Feature kNtlmV2Enabled{"NtlmV2Enabled",
610 base::FEATURE_ENABLED_BY_DEFAULT};
611 #endif
612
613 #if !defined(OS_ANDROID)
614 const base::Feature kOnConnectNative{"OnConnectNative",
615 base::FEATURE_DISABLED_BY_DEFAULT};
616 #endif
617
618 // Enables/disables marketing emails for other countries other than US,CA,UK.
619 const base::Feature kOobeMarketingAdditionalCountriesSupported{
620 "kOobeMarketingAdditionalCountriesSupported",
621 base::FEATURE_ENABLED_BY_DEFAULT};
622
623 // Enables/disables marketing emails for double opt-in countries.
624 const base::Feature kOobeMarketingDoubleOptInCountriesSupported{
625 "kOobeMarketingDoubleOptInCountriesSupported",
626 base::FEATURE_ENABLED_BY_DEFAULT};
627
628 // Enables or disables the marketing opt-in screen in OOBE
629 const base::Feature kOobeMarketingScreen{"OobeMarketingScreen",
630 base::FEATURE_ENABLED_BY_DEFAULT};
631
632 #if defined(OS_ANDROID)
633 // Enables or disabled the OOM intervention.
634 const base::Feature kOomIntervention{"OomIntervention",
635 base::FEATURE_ENABLED_BY_DEFAULT};
636 #endif
637
638 #if defined(OS_CHROMEOS)
639 // Enables usage of Parent Access Code in the login flow for reauth and add
640 // user. Requires |kParentAccessCode| to be enabled.
641 const base::Feature kParentAccessCodeForOnlineLogin{
642 "ParentAccessCodeForOnlineLogin", base::FEATURE_ENABLED_BY_DEFAULT};
643
644 // Enables enforcement of per-app time limits for child user.
645 const base::Feature kPerAppTimeLimits{"PerAppTimeLimits",
646 base::FEATURE_ENABLED_BY_DEFAULT};
647 #endif
648
649 // Enables using the prediction service for permission prompts.
650 const base::Feature kPermissionPredictions{"PermissionPredictions",
651 base::FEATURE_DISABLED_BY_DEFAULT};
652
653 #if defined(OS_CHROMEOS)
654 // Enable support for "Plugin VMs" on Chrome OS.
655 const base::Feature kPluginVm{"PluginVm", base::FEATURE_DISABLED_BY_DEFAULT};
656 #endif
657
658 // Allows prediction operations (e.g., prefetching) on all connection types.
659 const base::Feature kPredictivePrefetchingAllowedOnAllConnectionTypes{
660 "PredictivePrefetchingAllowedOnAllConnectionTypes",
661 base::FEATURE_ENABLED_BY_DEFAULT};
662
663 // Allows Chrome to do preconnect when prerender fails.
664 const base::Feature kPrerenderFallbackToPreconnect{
665 "PrerenderFallbackToPreconnect", base::FEATURE_ENABLED_BY_DEFAULT};
666
667 // Enables additional contextual entry points to privacy settings.
668 const base::Feature kPrivacyAdvisor{"PrivacyAdvisor",
669 base::FEATURE_DISABLED_BY_DEFAULT};
670
671 #if defined(OS_ANDROID)
672 const base::Feature kPrivacyReorderedAndroid{"PrivacyReorderedAndroid",
673 base::FEATURE_DISABLED_BY_DEFAULT};
674 #endif
675
676 // Whether to display redesign of the chrome privacy settings page
677 // to the user.
678 const base::Feature kPrivacySettingsRedesign{"PrivacySettingsRedesign",
679 base::FEATURE_ENABLED_BY_DEFAULT};
680
681 // Enables or disables push subscriptions keeping Chrome running in the
682 // background when closed.
683 const base::Feature kPushMessagingBackgroundMode{
684 "PushMessagingBackgroundMode", base::FEATURE_DISABLED_BY_DEFAULT};
685
686 #if defined(OS_CHROMEOS)
687 // Enables or disables fingerprint quick unlock.
688 const base::Feature kQuickUnlockFingerprint{"QuickUnlockFingerprint",
689 base::FEATURE_DISABLED_BY_DEFAULT};
690 #endif
691
692 // Enables using quiet prompts for notification permission requests.
693 const base::Feature kQuietNotificationPrompts{"QuietNotificationPrompts",
694 base::FEATURE_ENABLED_BY_DEFAULT};
695
696 // Enables notification permission revocation for abusive origins.
697 const base::Feature kAbusiveNotificationPermissionRevocation{
698 "AbusiveOriginNotificationPermissionRevocation",
699 base::FEATURE_DISABLED_BY_DEFAULT};
700
701 #if defined(OS_CHROMEOS)
702 // Enables permanent removal of Legacy Supervised Users on startup.
703 const base::Feature kRemoveSupervisedUsersOnStartup{
704 "RemoveSupervisedUsersOnStartup", base::FEATURE_DISABLED_BY_DEFAULT};
705 #endif
706
707 #if defined(OS_ANDROID)
708 const base::Feature kSafetyCheckAndroid{"SafetyCheckAndroid",
709 base::FEATURE_DISABLED_BY_DEFAULT};
710 #endif
711
712 #if defined(OS_WIN)
713 const base::Feature kSafetyCheckChromeCleanerChild{
714 "SafetyCheckChromeCleanerChild", base::FEATURE_DISABLED_BY_DEFAULT};
715 #endif
716
717 #if defined(OS_CHROMEOS)
718 // Enable support for multiple scheduler configurations.
719 const base::Feature kSchedulerConfiguration{"SchedulerConfiguration",
720 base::FEATURE_DISABLED_BY_DEFAULT};
721 #endif // defined(OS_CHROMEOS)
722
723 // Controls whether SCT audit reports are queued and the rate at which they
724 // should be sampled.
725 const base::Feature kSCTAuditing{"SCTAuditing",
726 base::FEATURE_DISABLED_BY_DEFAULT};
727 constexpr base::FeatureParam<double> kSCTAuditingSamplingRate{
728 &kSCTAuditing, "sampling_rate", 0.0};
729
730 // Controls whether the user is prompted when sites request attestation.
731 const base::Feature kSecurityKeyAttestationPrompt{
732 "SecurityKeyAttestationPrompt", base::FEATURE_ENABLED_BY_DEFAULT};
733
734 #if defined(OS_CHROMEOS)
735 const base::Feature kSharesheet{"Sharesheet",
736 base::FEATURE_DISABLED_BY_DEFAULT};
737 #endif
738
739 #if defined(OS_MAC)
740 // Enables the "this OS is obsolete" infobar on Mac 10.10.
741 // TODO(ellyjones): Remove this after the last 10.10 release.
742 const base::Feature kShow10_10ObsoleteInfobar{
743 "Show1010ObsoleteInfobar", base::FEATURE_DISABLED_BY_DEFAULT};
744 #endif // defined(OS_MAC)
745
746 // Alternative to switches::kSitePerProcess, for turning on full site isolation.
747 // Launch bug: https://crbug.com/810843. This is a //chrome-layer feature to
748 // avoid turning on site-per-process by default for *all* //content embedders
749 // (e.g. this approach lets ChromeCast avoid site-per-process mode).
750 //
751 // TODO(alexmos): Move this and the other site isolation features below to
752 // browser_features, as they are only used on the browser side.
753 const base::Feature kSitePerProcess {
754 "site-per-process",
755 #if defined(OS_ANDROID)
756 base::FEATURE_DISABLED_BY_DEFAULT
757 #else
758 base::FEATURE_ENABLED_BY_DEFAULT
759 #endif
760 };
761
762 #if defined(OS_CHROMEOS)
763 // Enables or disables SmartDim on Chrome OS.
764 const base::Feature kSmartDim{"SmartDim", base::FEATURE_DISABLED_BY_DEFAULT};
765
766 // Enables or disables using smbfs for accessing SMB file shares.
767 const base::Feature kSmbFs{"SmbFs", base::FEATURE_ENABLED_BY_DEFAULT};
768 #endif // defined(OS_CHROMEOS)
769
770 // Enables or disables the ability to use the sound content setting to mute a
771 // website.
772 const base::Feature kSoundContentSetting{"SoundContentSetting",
773 base::FEATURE_ENABLED_BY_DEFAULT};
774
775 #if defined(OS_CHROMEOS)
776 // Enables or disables chrome://sys-internals.
777 const base::Feature kSysInternals{"SysInternals",
778 base::FEATURE_DISABLED_BY_DEFAULT};
779 #endif
780
781 #if defined(OS_CHROMEOS)
782 // Enables or disables TPM firmware update capability on Chrome OS.
783 const base::Feature kTPMFirmwareUpdate{"TPMFirmwareUpdate",
784 base::FEATURE_ENABLED_BY_DEFAULT};
785 #endif
786
787 #if !defined(OS_ANDROID)
788 // Enables logging UKMs for background tab activity by TabActivityWatcher.
789 const base::Feature kTabMetricsLogging{"TabMetricsLogging",
790 base::FEATURE_ENABLED_BY_DEFAULT};
791 #endif
792
793 // Enables the teamfood flags.
794 const base::Feature kTeamfoodFlags{"TeamfoodFlags",
795 base::FEATURE_DISABLED_BY_DEFAULT};
796
797 #if defined(OS_WIN)
798 // Enables the blocking of third-party modules. This feature requires Windows 8
799 // or higher because it depends on the ProcessExtensionPointDisablePolicy
800 // mitigation, which was not available on Windows 7.
801 // Note: Due to a limitation in the implementation of this feature, it is
802 // required to start the browser two times to fully enable or disable it.
803 const base::Feature kThirdPartyModulesBlocking{
804 "ThirdPartyModulesBlocking", base::FEATURE_DISABLED_BY_DEFAULT};
805 #endif
806
807 // Disable downloads of unsafe file types over insecure transports if initiated
808 // from a secure page
809 const base::Feature kTreatUnsafeDownloadsAsActive{
810 "TreatUnsafeDownloadsAsActive", base::FEATURE_DISABLED_BY_DEFAULT};
811
812 #if defined(OS_CHROMEOS)
813 // Enable uploading of a zip archive of system logs instead of individual files.
814 const base::Feature kUploadZippedSystemLogs{"UploadZippedSystemLogs",
815 base::FEATURE_ENABLED_BY_DEFAULT};
816
817 // Enable USB Bouncer for managing a device whitelist for USBGuard on Chrome OS.
818 const base::Feature kUsbbouncer{"USBBouncer",
819 base::FEATURE_DISABLED_BY_DEFAULT};
820
821 // Enable USBGuard at the lockscreen on Chrome OS.
822 // TODO(crbug.com/874630): Remove this kill-switch
823 const base::Feature kUsbguard{"USBGuard", base::FEATURE_ENABLED_BY_DEFAULT};
824 #endif
825
826 #if defined(OS_CHROMEOS)
827 // Enables or disables user activity event logging for power management on
828 // Chrome OS.
829 const base::Feature kUserActivityEventLogging{"UserActivityEventLogging",
830 base::FEATURE_ENABLED_BY_DEFAULT};
831 #endif
832
833 #if !defined(OS_ANDROID)
834 // Allow capturing of WebRTC event logs, and uploading of those logs to Crash.
835 // Please note that a Chrome policy must also be set, for this to have effect.
836 // Effectively, this is a kill-switch for the feature.
837 // TODO(crbug.com/775415): Remove this kill-switch.
838 const base::Feature kWebRtcRemoteEventLog{"WebRtcRemoteEventLog",
839 base::FEATURE_ENABLED_BY_DEFAULT};
840 // Compress remote-bound WebRTC event logs (if used; see kWebRtcRemoteEventLog).
841 const base::Feature kWebRtcRemoteEventLogGzipped{
842 "WebRtcRemoteEventLogGzipped", base::FEATURE_ENABLED_BY_DEFAULT};
843 #endif
844
845 #if defined(OS_WIN) || defined(OS_CHROMEOS)
846 // Enables Web Share (navigator.share)
847 const base::Feature kWebShare{"WebShare", base::FEATURE_DISABLED_BY_DEFAULT};
848 #endif
849
850 // Enables setting time limit for Chrome and PWA's on child user device.
851 // Requires |kPerAppTimeLimits| to be enabled.
852 #if defined(OS_CHROMEOS)
853 const base::Feature kWebTimeLimits{"WebTimeLimits",
854 base::FEATURE_DISABLED_BY_DEFAULT};
855 #endif // defined(OS_CHROMEOS)
856
857 // Whether to enable "dark mode" enhancements in Mac Mojave or Windows 10 for
858 // UIs implemented with web technologies.
859 const base::Feature kWebUIDarkMode {
860 "WebUIDarkMode",
861 #if defined(OS_MAC) || defined(OS_WIN) || defined(OS_ANDROID)
862 base::FEATURE_ENABLED_BY_DEFAULT
863 #else
864 base::FEATURE_DISABLED_BY_DEFAULT
865 #endif // defined(OS_MAC) || defined(OS_WIN) || defined(OS_ANDROID)
866 };
867
868 #if defined(OS_CHROMEOS)
869 // Populates storage dimensions in UMA log if enabled. Requires diagnostics
870 // package in the image.
871 const base::Feature kUmaStorageDimensions{"UmaStorageDimensions",
872 base::FEATURE_DISABLED_BY_DEFAULT};
873 // Allow a Wilco DTC (diagnostics and telemetry controller) on Chrome OS.
874 // More info about the project may be found here:
875 // https://docs.google.com/document/d/18Ijj8YlC8Q3EWRzLspIi2dGxg4vIBVe5sJgMPt9SWYo
876 const base::Feature kWilcoDtc{"WilcoDtc", base::FEATURE_DISABLED_BY_DEFAULT};
877 #endif
878
879 #if defined(OS_WIN)
880 // Enables the accelerated default browser flow for Windows 10.
881 const base::Feature kWin10AcceleratedDefaultBrowserFlow{
882 "Win10AcceleratedDefaultBrowserFlow", base::FEATURE_ENABLED_BY_DEFAULT};
883 #endif // defined(OS_WIN)
884
885 const base::Feature kWindowNaming{"WindowNaming",
886 base::FEATURE_DISABLED_BY_DEFAULT};
887
888 // Enables writing basic system profile to the persistent histograms files
889 // earlier.
890 const base::Feature kWriteBasicSystemProfileToPersistentHistogramsFile{
891 "WriteBasicSystemProfileToPersistentHistogramsFile",
892 base::FEATURE_ENABLED_BY_DEFAULT};
893
894 #if defined(OS_CHROMEOS)
IsParentAccessCodeForOnlineLoginEnabled()895 bool IsParentAccessCodeForOnlineLoginEnabled() {
896 return base::FeatureList::IsEnabled(kParentAccessCodeForOnlineLogin);
897 }
898 #endif // defined(OS_CHROMEOS)
899
900 } // namespace features
901