chrome_features.cc 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  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. #include "chrome/common/chrome_features.h"
  5. #include "base/command_line.h"
  6. #include "base/feature_list.h"
  7. #include "base/strings/string_split.h"
  8. #include "build/build_config.h"
  9. #include "build/chromeos_buildflags.h"
  10. #include "chrome/common/chrome_switches.h"
  11. #include "ppapi/buildflags/buildflags.h"
  12. namespace features {
  13. // All features in alphabetical order.
  14. #if BUILDFLAG(IS_CHROMEOS_ASH)
  15. // If enabled device status collector will add the type of session (Affiliated
  16. // User, Kiosks, Managed Guest Sessions) to the device status report.
  17. const base::Feature kActivityReportingSessionType{
  18. "ActivityReportingSessionType", base::FEATURE_ENABLED_BY_DEFAULT};
  19. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  20. #if BUILDFLAG(IS_CHROMEOS_ASH)
  21. // Enables or disables logging for adaptive screen brightness on Chrome OS.
  22. const base::Feature kAdaptiveScreenBrightnessLogging{
  23. "AdaptiveScreenBrightnessLogging", base::FEATURE_ENABLED_BY_DEFAULT};
  24. #endif
  25. #if BUILDFLAG(IS_CHROMEOS_ASH)
  26. // Shows settings to adjust and disable touchpad haptic feedback.
  27. const base::Feature kAllowDisableTouchpadHapticFeedback{
  28. "AllowDisableTouchpadHapticFeedback", base::FEATURE_ENABLED_BY_DEFAULT};
  29. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  30. #if BUILDFLAG(IS_CHROMEOS_ASH)
  31. // Shows settings to adjust the touchpad haptic click settings.
  32. const base::Feature kAllowTouchpadHapticClickSettings{
  33. "AllowTouchpadHapticClickSettings", base::FEATURE_ENABLED_BY_DEFAULT};
  34. #endif // defined(IS_CHROMEOS_ASH)
  35. #if BUILDFLAG(IS_ANDROID)
  36. const base::Feature kAnonymousUpdateChecks{"AnonymousUpdateChecks",
  37. base::FEATURE_ENABLED_BY_DEFAULT};
  38. #endif
  39. #if BUILDFLAG(IS_CHROMEOS_ASH)
  40. const base::Feature kAppDiscoveryForOobe{"AppDiscoveryForOobe",
  41. base::FEATURE_ENABLED_BY_DEFAULT};
  42. #endif
  43. #if BUILDFLAG(IS_CHROMEOS_ASH)
  44. const base::Feature kAppManagementAppDetails{"AppManagementAppDetails",
  45. base::FEATURE_DISABLED_BY_DEFAULT};
  46. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  47. #if BUILDFLAG(IS_CHROMEOS_ASH)
  48. const base::Feature kAppDeduplicationService{"AppDeduplicationService",
  49. base::FEATURE_DISABLED_BY_DEFAULT};
  50. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  51. #if BUILDFLAG(IS_CHROMEOS_ASH)
  52. const base::Feature kAppProvisioningStatic{"AppProvisioningStatic",
  53. base::FEATURE_DISABLED_BY_DEFAULT};
  54. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  55. #if BUILDFLAG(IS_MAC)
  56. // Can be used to disable RemoteCocoa (hosting NSWindows for apps in the app
  57. // process). For debugging purposes only.
  58. const base::Feature kAppShimRemoteCocoa{"AppShimRemoteCocoa",
  59. base::FEATURE_ENABLED_BY_DEFAULT};
  60. // This is used to control the new app close behavior on macOS wherein closing
  61. // all windows for an app leaves the app running.
  62. // https://crbug.com/1080729
  63. const base::Feature kAppShimNewCloseBehavior{"AppShimNewCloseBehavior",
  64. base::FEATURE_DISABLED_BY_DEFAULT};
  65. #endif // BUILDFLAG(IS_MAC)
  66. // Enables the built-in DNS resolver.
  67. const base::Feature kAsyncDns {
  68. "AsyncDns",
  69. #if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
  70. base::FEATURE_ENABLED_BY_DEFAULT
  71. #else
  72. base::FEATURE_DISABLED_BY_DEFAULT
  73. #endif
  74. };
  75. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
  76. BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
  77. // Enables or disables the Autofill survey triggered by opening a prompt to
  78. // save address info.
  79. const base::Feature kAutofillAddressSurvey{"AutofillAddressSurvey",
  80. base::FEATURE_DISABLED_BY_DEFAULT};
  81. // Enables or disables the Autofill survey triggered by opening a prompt to
  82. // save credit card info.
  83. const base::Feature kAutofillCardSurvey{"AutofillCardSurvey",
  84. base::FEATURE_DISABLED_BY_DEFAULT};
  85. // Enables or disables the Autofill survey triggered by opening a prompt to
  86. // save password info.
  87. const base::Feature kAutofillPasswordSurvey{"AutofillPasswordSurvey",
  88. base::FEATURE_DISABLED_BY_DEFAULT};
  89. #endif
  90. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  91. // Enables the Restart background mode optimization. When all Chrome UI is
  92. // closed and it goes in the background, allows to restart the browser to
  93. // discard memory.
  94. const base::Feature kBackgroundModeAllowRestart{
  95. "BackgroundModeAllowRestart", base::FEATURE_DISABLED_BY_DEFAULT};
  96. #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  97. #if !BUILDFLAG(IS_ANDROID)
  98. const base::Feature kBlockMigratedDefaultChromeAppSync{
  99. "BlockMigratedDefaultChromeAppSync", base::FEATURE_ENABLED_BY_DEFAULT};
  100. #endif
  101. #if BUILDFLAG(IS_CHROMEOS_ASH)
  102. // Enable Borealis on Chrome OS.
  103. const base::Feature kBorealis{"Borealis", base::FEATURE_DISABLED_BY_DEFAULT};
  104. #endif
  105. // Enables change picture video mode.
  106. const base::Feature kChangePictureVideoMode{"ChangePictureVideoMode",
  107. base::FEATURE_ENABLED_BY_DEFAULT};
  108. const base::Feature kClientStorageAccessContextAuditing{
  109. "ClientStorageAccessContextAuditing", base::FEATURE_DISABLED_BY_DEFAULT};
  110. const base::Feature kConsolidatedSiteStorageControls{
  111. "ConsolidatedSiteStorageControls", base::FEATURE_DISABLED_BY_DEFAULT};
  112. #if BUILDFLAG(IS_CHROMEOS_ASH)
  113. // Enables or disables "usm" service in the list of user services returned by
  114. // userInfo Gaia message.
  115. const base::Feature kCrOSEnableUSMUserService{"CrOSEnableUSMUserService",
  116. base::FEATURE_ENABLED_BY_DEFAULT};
  117. // Enables or disables flash component updates on Chrome OS.
  118. const base::Feature kCrosCompUpdates{"CrosCompUpdates",
  119. base::FEATURE_ENABLED_BY_DEFAULT};
  120. // Enable project Crostini, Linux VMs on Chrome OS.
  121. const base::Feature kCrostini{"Crostini", base::FEATURE_DISABLED_BY_DEFAULT};
  122. // Enable additional Crostini session status reporting for
  123. // managed devices only, i.e. reports of installed apps and kernel version.
  124. const base::Feature kCrostiniAdditionalEnterpriseReporting{
  125. "CrostiniAdditionalEnterpriseReporting", base::FEATURE_ENABLED_BY_DEFAULT};
  126. // Enable advanced access controls for Crostini-related features
  127. // (e.g. restricting VM CLI tools access, restricting Crostini root access).
  128. const base::Feature kCrostiniAdvancedAccessControls{
  129. "CrostiniAdvancedAccessControls", base::FEATURE_DISABLED_BY_DEFAULT};
  130. // Enables infrastructure for applying Ansible playbook to default Crostini
  131. // container.
  132. const base::Feature kCrostiniAnsibleInfrastructure{
  133. "CrostiniAnsibleInfrastructure", base::FEATURE_ENABLED_BY_DEFAULT};
  134. // Enables infrastructure for generating Ansible playbooks for the default
  135. // Crostini container from software configurations in JSON schema.
  136. const base::Feature kCrostiniAnsibleSoftwareManagement{
  137. "CrostiniAnsibleSoftwareManagement", base::FEATURE_DISABLED_BY_DEFAULT};
  138. // Enables support for sideloading android apps into Arc via crostini.
  139. const base::Feature kCrostiniArcSideload{"CrostiniArcSideload",
  140. base::FEATURE_ENABLED_BY_DEFAULT};
  141. // Enables custom UI for forcibly closing unresponsive windows.
  142. const base::Feature kCrostiniForceClose{"CrostiniForceClose",
  143. base::FEATURE_ENABLED_BY_DEFAULT};
  144. // Enables distributed model for TPM1.2, i.e., using tpm_managerd and
  145. // attestationd.
  146. const base::Feature kCryptohomeDistributedModel{
  147. "CryptohomeDistributedModel", base::FEATURE_DISABLED_BY_DEFAULT};
  148. // Enables cryptohome UserDataAuth interface, a new dbus interface that is
  149. // fully protobuf and uses libbrillo for dbus instead of the deprecated
  150. // glib-dbus.
  151. const base::Feature kCryptohomeUserDataAuth{"CryptohomeUserDataAuth",
  152. base::FEATURE_DISABLED_BY_DEFAULT};
  153. // Kill switch for cryptohome UserDataAuth interface. UserDataAuth is a new
  154. // dbus interface that is fully protobuf and uses libbrillo for dbus instead
  155. // instead of the deprecated glib-dbus.
  156. const base::Feature kCryptohomeUserDataAuthKillswitch{
  157. "CryptohomeUserDataAuthKillswitch", base::FEATURE_DISABLED_BY_DEFAULT};
  158. #endif
  159. #if BUILDFLAG(IS_CHROMEOS)
  160. // Enables parsing and enforcing Data Leak Prevention policy rules that
  161. // restricts usage of some system features, e.g.clipboard, screenshot, etc.
  162. // for confidential content.
  163. const base::Feature kDataLeakPreventionPolicy{"DataLeakPreventionPolicy",
  164. base::FEATURE_ENABLED_BY_DEFAULT};
  165. // Enables starting of Data Leak Prevention Files Daemon by sending the
  166. // DLP policy there. The daemon might restrict access to some protected files.
  167. const base::Feature kDataLeakPreventionFilesRestriction{
  168. "DataLeakPreventionFilesRestriction", base::FEATURE_DISABLED_BY_DEFAULT};
  169. #endif
  170. #if BUILDFLAG(IS_CHROMEOS_ASH)
  171. // When enabled, newly installed ARC apps will not capture links clicked in the
  172. // browser by default. Users can still enable link capturing for apps through
  173. // the intent picker or settings.
  174. const base::Feature kDefaultLinkCapturingInBrowser{
  175. "DefaultLinkCapturingInBrowser", base::FEATURE_ENABLED_BY_DEFAULT};
  176. #endif
  177. #if BUILDFLAG(IS_CHROMEOS_ASH)
  178. // Enables passing additional user authentication in requests to DMServer
  179. // (policy fetch, status report upload).
  180. const base::Feature kDMServerOAuthForChildUser{
  181. "DMServerOAuthForChildUser", base::FEATURE_ENABLED_BY_DEFAULT};
  182. #endif
  183. #if !BUILDFLAG(IS_ANDROID)
  184. // Whether to allow installed-by-default web apps to be installed or not.
  185. const base::Feature kPreinstalledWebAppInstallation{
  186. "DefaultWebAppInstallation", base::FEATURE_ENABLED_BY_DEFAULT};
  187. // Whether to run the PreinstalledWebAppDuplicationFixer code during start up.
  188. const base::Feature kPreinstalledWebAppDuplicationFixer{
  189. "PreinstalledWebAppDuplicationFixer", base::FEATURE_ENABLED_BY_DEFAULT};
  190. #endif
  191. // API that allows PWAs manually minimizing, maximizing and restoring windows.
  192. const base::Feature kDesktopPWAsAdditionalWindowingControls{
  193. "DesktopPWAsAdditionalWindowingControls",
  194. base::FEATURE_DISABLED_BY_DEFAULT};
  195. // When installing default installed PWAs, we wait for service workers
  196. // to cache resources.
  197. const base::Feature kDesktopPWAsCacheDuringDefaultInstall{
  198. "DesktopPWAsCacheDuringDefaultInstall", base::FEATURE_ENABLED_BY_DEFAULT};
  199. // Generates customised default offline page that is shown when web app is
  200. // offline if no custom page is provided by developer.
  201. #if BUILDFLAG(IS_ANDROID)
  202. const base::Feature kAndroidPWAsDefaultOfflinePage{
  203. "AndroidPWAsDefaultOfflinePage", base::FEATURE_DISABLED_BY_DEFAULT};
  204. #else
  205. const base::Feature kDesktopPWAsDefaultOfflinePage{
  206. "DesktopPWAsDefaultOfflinePage", base::FEATURE_DISABLED_BY_DEFAULT};
  207. #endif // BUILDFLAG(IS_ANDROID)
  208. // Moves the Extensions "puzzle piece" icon from the title bar into the app menu
  209. // for web app windows.
  210. const base::Feature kDesktopPWAsElidedExtensionsMenu {
  211. "DesktopPWAsElidedExtensionsMenu",
  212. #if BUILDFLAG(IS_CHROMEOS)
  213. base::FEATURE_ENABLED_BY_DEFAULT
  214. #else
  215. base::FEATURE_DISABLED_BY_DEFAULT
  216. #endif
  217. };
  218. // Whether to parse and enforce the WebAppSettings policy.
  219. const base::Feature kDesktopPWAsEnforceWebAppSettingsPolicy{
  220. "DesktopPWAsEnforceWebAppSettingsPolicy", base::FEATURE_ENABLED_BY_DEFAULT};
  221. // Enables or disables Desktop PWAs to be auto-started on OS login.
  222. const base::Feature kDesktopPWAsRunOnOsLogin {
  223. "DesktopPWAsRunOnOsLogin",
  224. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
  225. base::FEATURE_ENABLED_BY_DEFAULT
  226. #else
  227. base::FEATURE_DISABLED_BY_DEFAULT
  228. #endif
  229. };
  230. // Adds a user settings that allows PWAs to be opened with a tab strip.
  231. const base::Feature kDesktopPWAsTabStripSettings{
  232. "DesktopPWAsTabStripSettings", base::FEATURE_DISABLED_BY_DEFAULT};
  233. // Adds support for web bundles, making web apps able to be launched offline.
  234. const base::Feature kDesktopPWAsWebBundles{"DesktopPWAsWebBundles",
  235. base::FEATURE_DISABLED_BY_DEFAULT};
  236. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
  237. BUILDFLAG(IS_FUCHSIA)
  238. // Controls whether Chrome Apps are supported. See https://crbug.com/1221251.
  239. // If the feature is disabled, Chrome Apps continue to work. If enabled, Chrome
  240. // Apps will not launch and will be marked in the UI as deprecated.
  241. const base::Feature kChromeAppsDeprecation{"ChromeAppsDeprecation",
  242. base::FEATURE_DISABLED_BY_DEFAULT};
  243. // Controls whether force installed and preinstalled apps should be exempt from
  244. // deprecation.
  245. const base::Feature kKeepForceInstalledPreinstalledApps{
  246. "KeepForceInstalledPreinstalledApps", base::FEATURE_DISABLED_BY_DEFAULT};
  247. #endif
  248. // Enables notification permission revocation for origins that may send
  249. // disruptive notifications.
  250. const base::Feature kDisruptiveNotificationPermissionRevocation{
  251. "DisruptiveNotificationPermissionRevocation",
  252. base::FEATURE_DISABLED_BY_DEFAULT};
  253. // Enable DNS over HTTPS (DoH).
  254. const base::Feature kDnsOverHttps {
  255. "DnsOverHttps",
  256. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
  257. BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
  258. base::FEATURE_ENABLED_BY_DEFAULT
  259. #else
  260. base::FEATURE_DISABLED_BY_DEFAULT
  261. #endif
  262. };
  263. // Set whether fallback to insecure DNS is allowed by default. This setting may
  264. // be overridden for individual transactions.
  265. const base::FeatureParam<bool> kDnsOverHttpsFallbackParam{&kDnsOverHttps,
  266. "Fallback", true};
  267. // Sets whether the DoH setting is displayed in the settings UI.
  268. const base::FeatureParam<bool> kDnsOverHttpsShowUiParam {
  269. &kDnsOverHttps, "ShowUi",
  270. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
  271. BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
  272. true
  273. #else
  274. false
  275. #endif
  276. };
  277. // Supply one or more space-separated DoH server URI templates to use when this
  278. // feature is enabled. If no templates are specified, then a hardcoded mapping
  279. // will be used to construct a list of DoH templates associated with the IP
  280. // addresses of insecure resolvers in the discovered configuration.
  281. const base::FeatureParam<std::string> kDnsOverHttpsTemplatesParam{
  282. &kDnsOverHttps, "Templates", ""};
  283. #if BUILDFLAG(IS_CHROMEOS_ASH)
  284. // Enables the DNS-Over-HTTPS in the DNS proxy.
  285. const base::Feature kDnsProxyEnableDOH{"DnsProxyEnableDOH",
  286. base::FEATURE_ENABLED_BY_DEFAULT};
  287. #endif
  288. #if BUILDFLAG(IS_ANDROID)
  289. // Enable loading native libraries earlier in startup on Android.
  290. const base::Feature kEarlyLibraryLoad{"EarlyLibraryLoad",
  291. base::FEATURE_ENABLED_BY_DEFAULT};
  292. #endif
  293. #if BUILDFLAG(IS_ANDROID)
  294. // Under this flag Java bootstrap (aka startup) tasks that are run before native
  295. // initialization will not be specially prioritized by being posted at the front
  296. // of the Looper's queue.
  297. const base::Feature kElidePrioritizationOfPreNativeBootstrapTasks = {
  298. "ElidePrioritizationOfPreNativeBootstrapTasks",
  299. base::FEATURE_ENABLED_BY_DEFAULT};
  300. #endif
  301. // Enable the restricted web APIs for high-trusted apps.
  302. const base::Feature kEnableRestrictedWebApis{"EnableRestrictedWebApis",
  303. base::FEATURE_ENABLED_BY_DEFAULT};
  304. #if !BUILDFLAG(IS_ANDROID)
  305. // Enable WebHID on extension service workers.
  306. const base::Feature kEnableWebHidOnExtensionServiceWorker{
  307. "EnableWebHidOnExtensionServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT};
  308. #endif
  309. #if !BUILDFLAG(IS_ANDROID)
  310. // Lazy initialize IndividualSettings for extensions from enterprise policy
  311. // that are not installed.
  312. const base::Feature kExtensionDeferredIndividualSettings{
  313. "ExtensionDeferredIndividualSettings", base::FEATURE_ENABLED_BY_DEFAULT};
  314. #endif
  315. // Controls whether the user justification text field is visible on the
  316. // extension request dialog.
  317. const base::Feature kExtensionWorkflowJustification{
  318. "ExtensionWorkflowJustification", base::FEATURE_DISABLED_BY_DEFAULT};
  319. // If enabled, this feature's |kExternalInstallDefaultButtonKey| field trial
  320. // parameter value controls which |ExternalInstallBubbleAlert| button is the
  321. // default.
  322. const base::Feature kExternalExtensionDefaultButtonControl{
  323. "ExternalExtensionDefaultButtonControl", base::FEATURE_DISABLED_BY_DEFAULT};
  324. #if BUILDFLAG(IS_CHROMEOS_ASH)
  325. COMPONENT_EXPORT(CHROME_FEATURES)
  326. const base::Feature kFileTransferEnterpriseConnector{
  327. "FileTransferEnterpriseConnector", base::FEATURE_DISABLED_BY_DEFAULT};
  328. #endif
  329. #if BUILDFLAG(ENABLE_PLUGINS)
  330. // Show Flash deprecation warning to users who have manually enabled Flash.
  331. // https://crbug.com/918428
  332. const base::Feature kFlashDeprecationWarning{"FlashDeprecationWarning",
  333. base::FEATURE_ENABLED_BY_DEFAULT};
  334. #endif
  335. // Controls whether the GeoLanguage system is enabled. GeoLanguage uses IP-based
  336. // coarse geolocation to provide an estimate (for use by other Chrome features
  337. // such as Translate) of the local/regional language(s) corresponding to the
  338. // device's location. If this feature is disabled, the GeoLanguage provider is
  339. // not initialized at startup, and clients calling it will receive an empty list
  340. // of languages.
  341. const base::Feature kGeoLanguage{"GeoLanguage",
  342. base::FEATURE_DISABLED_BY_DEFAULT};
  343. #if !BUILDFLAG(IS_ANDROID)
  344. // Enables or disables the Happiness Tracking System demo mode for Desktop
  345. // Chrome.
  346. const base::Feature kHappinessTrackingSurveysForDesktopDemo{
  347. "HappinessTrackingSurveysForDesktopDemo",
  348. base::FEATURE_DISABLED_BY_DEFAULT};
  349. // Enables or disables the Happiness Tracking System for COEP issues in Chrome
  350. // DevTools on Desktop.
  351. const base::Feature kHaTSDesktopDevToolsIssuesCOEP{
  352. "HaTSDesktopDevToolsIssuesCOEP", base::FEATURE_DISABLED_BY_DEFAULT};
  353. // Enables or disables the Happiness Tracking System for Mixed Content issues in
  354. // Chrome DevTools on Desktop.
  355. const base::Feature kHaTSDesktopDevToolsIssuesMixedContent{
  356. "HaTSDesktopDevToolsIssuesMixedContent", base::FEATURE_DISABLED_BY_DEFAULT};
  357. // Enables or disables the Happiness Tracking System for same-site cookies
  358. // issues in Chrome DevTools on Desktop.
  359. const base::Feature
  360. kHappinessTrackingSurveysForDesktopDevToolsIssuesCookiesSameSite{
  361. "HappinessTrackingSurveysForDesktopDevToolsIssuesCookiesSameSite",
  362. base::FEATURE_DISABLED_BY_DEFAULT};
  363. // Enables or disables the Happiness Tracking System for Heavy Ad issues in
  364. // Chrome DevTools on Desktop.
  365. const base::Feature kHaTSDesktopDevToolsIssuesHeavyAd{
  366. "HaTSDesktopDevToolsIssuesHeavyAd", base::FEATURE_DISABLED_BY_DEFAULT};
  367. // Enables or disables the Happiness Tracking System for CSP issues in Chrome
  368. // DevTools on Desktop.
  369. const base::Feature kHaTSDesktopDevToolsIssuesCSP{
  370. "HaTSDesktopDevToolsIssuesCSP", base::FEATURE_DISABLED_BY_DEFAULT};
  371. // Enables or disables the Happiness Tracking System for Desktop Privacy Guide.
  372. const base::Feature kHappinessTrackingSurveysForDesktopPrivacyGuide{
  373. "HappinessTrackingSurveysForDesktopPrivacyGuide",
  374. base::FEATURE_DISABLED_BY_DEFAULT};
  375. const base::FeatureParam<base::TimeDelta>
  376. kHappinessTrackingSurveysForDesktopPrivacyGuideTime{
  377. &kHappinessTrackingSurveysForDesktopPrivacyGuide, "settings-time",
  378. base::Seconds(20)};
  379. // Enables or disables the Happiness Tracking System for Desktop Privacy
  380. // Sandbox.
  381. const base::Feature kHappinessTrackingSurveysForDesktopPrivacySandbox{
  382. "HappinessTrackingSurveysForDesktopPrivacySandbox",
  383. base::FEATURE_DISABLED_BY_DEFAULT};
  384. const base::FeatureParam<base::TimeDelta>
  385. kHappinessTrackingSurveysForDesktopPrivacySandboxTime{
  386. &kHappinessTrackingSurveysForDesktopPrivacySandbox, "settings-time",
  387. base::Seconds(20)};
  388. // Enables or disables the Happiness Tracking System for Desktop Chrome
  389. // Settings.
  390. const base::Feature kHappinessTrackingSurveysForDesktopSettings{
  391. "HappinessTrackingSurveysForDesktopSettings",
  392. base::FEATURE_DISABLED_BY_DEFAULT};
  393. // Enables or disables the Happiness Tracking System for Desktop Chrome
  394. // Privacy Settings.
  395. const base::Feature kHappinessTrackingSurveysForDesktopSettingsPrivacy{
  396. "HappinessTrackingSurveysForDesktopSettingsPrivacy",
  397. base::FEATURE_DISABLED_BY_DEFAULT};
  398. const base::FeatureParam<bool>
  399. kHappinessTrackingSurveysForDesktopSettingsPrivacyNoSandbox{
  400. &kHappinessTrackingSurveysForDesktopSettingsPrivacy, "no-sandbox",
  401. false};
  402. const base::FeatureParam<bool>
  403. kHappinessTrackingSurveysForDesktopSettingsPrivacyNoGuide{
  404. &kHappinessTrackingSurveysForDesktopSettingsPrivacy, "no-guide", false};
  405. const base::FeatureParam<base::TimeDelta>
  406. kHappinessTrackingSurveysForDesktopSettingsPrivacyTime{
  407. &kHappinessTrackingSurveysForDesktopSettingsPrivacy, "settings-time",
  408. base::Seconds(20)};
  409. // Enables or disables the Happiness Tracking System for Desktop Chrome
  410. // NTP Modules.
  411. const base::Feature kHappinessTrackingSurveysForDesktopNtpModules{
  412. "HappinessTrackingSurveysForDesktopNtpModules",
  413. base::FEATURE_DISABLED_BY_DEFAULT};
  414. const base::Feature kHappinessTrackingSurveysForNtpPhotosOptOut{
  415. "HappinessTrackingSurveysForrNtpPhotosOptOut",
  416. base::FEATURE_DISABLED_BY_DEFAULT};
  417. // Enables or disables the Happiness Tracking System for Chrome What's New.
  418. const base::Feature kHappinessTrackingSurveysForDesktopWhatsNew{
  419. "HappinessTrackingSurveysForDesktopWhatsNew",
  420. base::FEATURE_DISABLED_BY_DEFAULT};
  421. const base::FeatureParam<base::TimeDelta>
  422. kHappinessTrackingSurveysForDesktopWhatsNewTime{
  423. &kHappinessTrackingSurveysForDesktopWhatsNew, "whats-new-time",
  424. base::Seconds(20)};
  425. #endif // !BUILDFLAG(IS_ANDROID)
  426. #if BUILDFLAG(IS_CHROMEOS_ASH)
  427. // Enables or disables the Happiness Tracking System for the General survey.
  428. const base::Feature kHappinessTrackingSystem{"HappinessTrackingSystem",
  429. base::FEATURE_DISABLED_BY_DEFAULT};
  430. // Enables or disables the Happiness Tracking System for the Ent survey.
  431. const base::Feature kHappinessTrackingSystemEnt{
  432. "HappinessTrackingSystemEnt", base::FEATURE_DISABLED_BY_DEFAULT};
  433. // Enables or disables the Happiness Tracking System for the Stability survey.
  434. const base::Feature kHappinessTrackingSystemStability{
  435. "HappinessTrackingSystemStability", base::FEATURE_DISABLED_BY_DEFAULT};
  436. // Enables or disables the Happiness Tracking System for the Performance survey.
  437. const base::Feature kHappinessTrackingSystemPerformance{
  438. "HappinessTrackingSystemPerformance", base::FEATURE_DISABLED_BY_DEFAULT};
  439. // Enables or disables the Happiness Tracking System for Onboarding Experience.
  440. const base::Feature kHappinessTrackingSystemOnboarding{
  441. "HappinessTrackingOnboardingExperience", base::FEATURE_DISABLED_BY_DEFAULT};
  442. // Enables or disables the Happiness Tracking System for Unlock.
  443. const base::Feature kHappinessTrackingSystemUnlock{
  444. "HappinessTrackingUnlock", base::FEATURE_DISABLED_BY_DEFAULT};
  445. // Enables or disables the Happiness Tracking System for Smart Lock.
  446. const base::Feature kHappinessTrackingSystemSmartLock{
  447. "HappinessTrackingSmartLock", base::FEATURE_DISABLED_BY_DEFAULT};
  448. // Enables or disables the Happiness Tracking System for ARC Games survey.
  449. const base::Feature kHappinessTrackingSystemArcGames{
  450. "HappinessTrackingArcGames", base::FEATURE_DISABLED_BY_DEFAULT};
  451. // Enables or disables the Happiness Tracking System for Audio survey.
  452. const base::Feature kHappinessTrackingSystemAudio{
  453. "HappinessTrackingAudio", base::FEATURE_DISABLED_BY_DEFAULT};
  454. // Enables the Happiness Tracking System for Personalization Avatar survey.
  455. const base::Feature kHappinessTrackingPersonalizationAvatar{
  456. "HappinessTrackingPersonalizationAvatar",
  457. base::FEATURE_DISABLED_BY_DEFAULT};
  458. // Enables the Happiness Tracking System for Personalization Screensaver survey.
  459. const base::Feature kHappinessTrackingPersonalizationScreensaver{
  460. "HappinessTrackingPersonalizationScreensaver",
  461. base::FEATURE_DISABLED_BY_DEFAULT};
  462. // Enables the Happiness Tracking System for Personalization Wallpaper survey.
  463. const base::Feature kHappinessTrackingPersonalizationWallpaper{
  464. "HappinessTrackingPersonalizationWallpaper",
  465. base::FEATURE_DISABLED_BY_DEFAULT};
  466. // Enables the Happiness Tracking System for Media App PDF survey.
  467. const base::Feature kHappinessTrackingMediaAppPdf{
  468. "HappinessTrackingMediaAppPdf", base::FEATURE_DISABLED_BY_DEFAULT};
  469. // Enables or disables the Happiness Tracking System for Camera App survey.
  470. const base::Feature kHappinessTrackingSystemCameraApp{
  471. "HappinessTrackingCameraApp", base::FEATURE_DISABLED_BY_DEFAULT};
  472. // Enables the Happiness Tracking System for Photos Experience survey.
  473. const base::Feature kHappinessTrackingPhotosExperience{
  474. "HappinessTrackingPhotosExperience", base::FEATURE_DISABLED_BY_DEFAULT};
  475. #endif
  476. // Hides the origin text from showing up briefly in WebApp windows.
  477. const base::Feature kHideWebAppOriginText{"HideWebAppOriginText",
  478. base::FEATURE_DISABLED_BY_DEFAULT};
  479. // Sets whether the HTTPS-Only Mode setting is displayed in the settings UI.
  480. const base::Feature kHttpsOnlyMode{"HttpsOnlyMode",
  481. base::FEATURE_ENABLED_BY_DEFAULT};
  482. #if BUILDFLAG(IS_MAC)
  483. const base::Feature kImmersiveFullscreen{"ImmersiveFullscreen",
  484. base::FEATURE_DISABLED_BY_DEFAULT};
  485. #endif
  486. #if BUILDFLAG(IS_CHROMEOS_ASH)
  487. // Enables scraping of password-expiry information during SAML login flow, which
  488. // can lead to an in-session flow for changing SAML password if it has expired.
  489. // This is safe to enable by default since it does not cause the password-expiry
  490. // information to be stored, or any user-visible change - in order for anything
  491. // to happen, the domain administrator has to intentionally send this extra
  492. // info in the SAML response, and enable the InSessionPasswordChange policy.
  493. // So, this feature is just for disabling the scraping code if it causes
  494. // any unforeseen issues.
  495. const base::Feature kInSessionPasswordChange{"InSessionPasswordChange",
  496. base::FEATURE_ENABLED_BY_DEFAULT};
  497. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  498. #if BUILDFLAG(IS_WIN)
  499. // A feature that controls whether Chrome warns about incompatible applications.
  500. // This feature requires Windows 10 or higher to work because it depends on
  501. // the "Apps & Features" system settings.
  502. const base::Feature kIncompatibleApplicationsWarning{
  503. "IncompatibleApplicationsWarning", base::FEATURE_DISABLED_BY_DEFAULT};
  504. #endif
  505. #if BUILDFLAG(IS_ANDROID)
  506. // When enabled, users will see a warning when downloading from Incognito.
  507. const base::Feature kIncognitoDownloadsWarning{
  508. "IncognitoDownloadsWarning", base::FEATURE_DISABLED_BY_DEFAULT};
  509. #endif
  510. // When enabled, users will see updated UI in Incognito NTP
  511. const base::Feature kIncognitoNtpRevamp{"IncognitoNtpRevamp",
  512. base::FEATURE_DISABLED_BY_DEFAULT};
  513. #if BUILDFLAG(IS_CHROMEOS)
  514. const base::Feature kKioskEnableAppService("KioskEnableAppService",
  515. base::FEATURE_DISABLED_BY_DEFAULT);
  516. #endif // BUILDFLAG(IS_CHROMEOS)
  517. // When enabled, removes any entry points to the history UI from Incognito mode.
  518. const base::Feature kUpdateHistoryEntryPointsInIncognito{
  519. "UpdateHistoryEntryPointsInIncognito", base::FEATURE_ENABLED_BY_DEFAULT};
  520. #if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
  521. COMPONENT_EXPORT(CHROME_FEATURES)
  522. const base::Feature kLinuxLowMemoryMonitor{"LinuxLowMemoryMonitor",
  523. base::FEATURE_DISABLED_BY_DEFAULT};
  524. // Values taken from the low-memory-monitor documentation and also apply to the
  525. // portal API:
  526. // https://hadess.pages.freedesktop.org/low-memory-monitor/gdbus-org.freedesktop.LowMemoryMonitor.html
  527. constexpr base::FeatureParam<int> kLinuxLowMemoryMonitorModerateLevel{
  528. &kLinuxLowMemoryMonitor, "moderate_level", 50};
  529. constexpr base::FeatureParam<int> kLinuxLowMemoryMonitorCriticalLevel{
  530. &kLinuxLowMemoryMonitor, "critical_level", 255};
  531. #endif // BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
  532. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
  533. const base::Feature kListWebAppsSwitch{"ListWebAppsSwitch",
  534. base::FEATURE_DISABLED_BY_DEFAULT};
  535. #endif
  536. #if BUILDFLAG(IS_MAC)
  537. // Enable screen capture system permission check on Mac 10.15+.
  538. const base::Feature kMacSystemScreenCapturePermissionCheck{
  539. "MacSystemScreenCapturePermissionCheck", base::FEATURE_ENABLED_BY_DEFAULT};
  540. #endif
  541. #if BUILDFLAG(IS_CHROMEOS_ASH)
  542. // Whether to show the Metered toggle in Settings, allowing users to toggle
  543. // whether to treat a WiFi or Cellular network as 'metered'.
  544. const base::Feature kMeteredShowToggle{"MeteredShowToggle",
  545. base::FEATURE_DISABLED_BY_DEFAULT};
  546. // Whether to show the Hidden toggle in Settings, allowing users to toggle
  547. // whether to treat a WiFi network as having a hidden ssid.
  548. const base::Feature kShowHiddenNetworkToggle{"ShowHiddenNetworkToggle",
  549. base::FEATURE_ENABLED_BY_DEFAULT};
  550. #endif
  551. #if BUILDFLAG(IS_ANDROID)
  552. // Enables the new design of metrics settings.
  553. const base::Feature kMetricsSettingsAndroid{"MetricsSettingsAndroid",
  554. base::FEATURE_DISABLED_BY_DEFAULT};
  555. #endif
  556. const base::Feature kMoveWebApp{
  557. "MoveWebApp", base::FeatureState::FEATURE_DISABLED_BY_DEFAULT};
  558. const base::FeatureParam<std::string> kMoveWebAppUninstallStartUrlPrefix(
  559. &kMoveWebApp,
  560. "uninstallStartUrlPrefix",
  561. "");
  562. const base::FeatureParam<std::string> kMoveWebAppUninstallStartUrlPattern(
  563. &kMoveWebApp,
  564. "uninstallStartUrlPattern",
  565. "");
  566. const base::FeatureParam<std::string>
  567. kMoveWebAppInstallStartUrl(&kMoveWebApp, "installStartUrl", "");
  568. // Enables the use of system notification centers instead of using the Message
  569. // Center for displaying the toasts. The feature is hardcoded to enabled for
  570. // Chrome OS.
  571. #if BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS) && !BUILDFLAG(IS_CHROMEOS_ASH)
  572. const base::Feature kNativeNotifications{"NativeNotifications",
  573. base::FEATURE_ENABLED_BY_DEFAULT};
  574. const base::Feature kSystemNotifications{"SystemNotifications",
  575. base::FEATURE_ENABLED_BY_DEFAULT};
  576. #endif // BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS)
  577. #if BUILDFLAG(IS_MAC)
  578. // Enables the usage of Apple's new Notification API on macOS 10.14+
  579. const base::Feature kNewMacNotificationAPI{"NewMacNotificationAPI",
  580. base::FEATURE_DISABLED_BY_DEFAULT};
  581. #endif // BUILDFLAG(IS_MAC)
  582. // When kNoReferrers is enabled, most HTTP requests will provide empty
  583. // referrers instead of their ordinary behavior.
  584. const base::Feature kNoReferrers{"NoReferrers",
  585. base::FEATURE_DISABLED_BY_DEFAULT};
  586. #if BUILDFLAG(IS_WIN)
  587. // Changes behavior of requireInteraction for notifications. Instead of staying
  588. // on-screen until dismissed, they are instead shown for a very long time.
  589. const base::Feature kNotificationDurationLongForRequireInteraction{
  590. "NotificationDurationLongForRequireInteraction",
  591. base::FEATURE_DISABLED_BY_DEFAULT};
  592. #endif // BUILDFLAG(IS_WIN)
  593. #if !BUILDFLAG(IS_ANDROID)
  594. const base::Feature kOnConnectNative{"OnConnectNative",
  595. base::FEATURE_DISABLED_BY_DEFAULT};
  596. #endif
  597. // Enables/disables marketing emails for other countries other than US,CA,UK.
  598. const base::Feature kOobeMarketingAdditionalCountriesSupported{
  599. "kOobeMarketingAdditionalCountriesSupported",
  600. base::FEATURE_ENABLED_BY_DEFAULT};
  601. // Enables/disables marketing emails for double opt-in countries.
  602. const base::Feature kOobeMarketingDoubleOptInCountriesSupported{
  603. "kOobeMarketingDoubleOptInCountriesSupported",
  604. base::FEATURE_ENABLED_BY_DEFAULT};
  605. #if BUILDFLAG(IS_ANDROID)
  606. // Enables or disabled the OOM intervention.
  607. const base::Feature kOomIntervention{"OomIntervention",
  608. base::FEATURE_ENABLED_BY_DEFAULT};
  609. #endif
  610. #if BUILDFLAG(IS_CHROMEOS_ASH)
  611. // Enables usage of Parent Access Code in the login flow for reauth and add
  612. // user. Requires |kParentAccessCode| to be enabled.
  613. const base::Feature kParentAccessCodeForOnlineLogin{
  614. "ParentAccessCodeForOnlineLogin", base::FEATURE_ENABLED_BY_DEFAULT};
  615. #endif
  616. // Keep a client-side log of when websites access permission-gated capabilities
  617. // to allow the user to audit usage.
  618. const base::Feature kPermissionAuditing{"PermissionAuditing",
  619. base::FEATURE_DISABLED_BY_DEFAULT};
  620. // Enables using the prediction service for permission prompts. We will keep
  621. // this feature in order to allow us to update the holdback chance via finch.
  622. const base::Feature kPermissionPredictions{"PermissionPredictions",
  623. base::FEATURE_ENABLED_BY_DEFAULT};
  624. // The holdback chance is 30% but it can also be configured/updated
  625. // through finch if needed.
  626. const base::FeatureParam<double> kPermissionPredictionsHoldbackChance(
  627. &kPermissionPredictions,
  628. "holdback_chance",
  629. 0.3);
  630. // Enables using the prediction service for geolocation permission prompts.
  631. const base::Feature kPermissionGeolocationPredictions{
  632. "PermissionGeolocationPredictions", base::FEATURE_ENABLED_BY_DEFAULT};
  633. const base::FeatureParam<double>
  634. kPermissionGeolocationPredictionsHoldbackChance(
  635. &kPermissionGeolocationPredictions,
  636. "holdback_chance",
  637. 0.3);
  638. #if BUILDFLAG(IS_CHROMEOS_ASH)
  639. // Enable support for "Plugin VMs" on Chrome OS.
  640. const base::Feature kPluginVm{"PluginVm", base::FEATURE_DISABLED_BY_DEFAULT};
  641. #endif
  642. // Allows prediction operations (e.g., prefetching) on all connection types.
  643. const base::Feature kPredictivePrefetchingAllowedOnAllConnectionTypes{
  644. "PredictivePrefetchingAllowedOnAllConnectionTypes",
  645. base::FEATURE_ENABLED_BY_DEFAULT};
  646. const base::Feature kPrefixWebAppWindowsWithAppName{
  647. "PrefixWebAppWindowsWithAppName", base::FEATURE_ENABLED_BY_DEFAULT};
  648. // Allows Chrome to do preconnect when prerender fails.
  649. const base::Feature kPrerenderFallbackToPreconnect{
  650. "PrerenderFallbackToPreconnect", base::FEATURE_ENABLED_BY_DEFAULT};
  651. const base::Feature kPrivacyGuide2{"PrivacyGuide2",
  652. base::FEATURE_DISABLED_BY_DEFAULT};
  653. const base::Feature kPrivacyGuideAndroid{"PrivacyGuideAndroid",
  654. base::FEATURE_DISABLED_BY_DEFAULT};
  655. // Enables or disables push subscriptions keeping Chrome running in the
  656. // background when closed.
  657. const base::Feature kPushMessagingBackgroundMode{
  658. "PushMessagingBackgroundMode", base::FEATURE_DISABLED_BY_DEFAULT};
  659. // Shows a confirmation dialog when updates to a PWAs icon has been detected.
  660. const base::Feature kPwaUpdateDialogForIcon{"PwaUpdateDialogForIcon",
  661. base::FEATURE_DISABLED_BY_DEFAULT};
  662. // Shows a confirmation dialog when updates to a PWAs name has been detected.
  663. const base::Feature kPwaUpdateDialogForName{"PwaUpdateDialogForName",
  664. base::FEATURE_ENABLED_BY_DEFAULT};
  665. // Enables using quiet prompts for notification permission requests.
  666. const base::Feature kQuietNotificationPrompts{"QuietNotificationPrompts",
  667. base::FEATURE_ENABLED_BY_DEFAULT};
  668. // Enables recording additional web app related debugging data to be displayed
  669. // in: chrome://web-app-internals
  670. const base::Feature kRecordWebAppDebugInfo{"RecordWebAppDebugInfo",
  671. base::FEATURE_DISABLED_BY_DEFAULT};
  672. // Enables notification permission revocation for abusive origins.
  673. const base::Feature kAbusiveNotificationPermissionRevocation{
  674. "AbusiveOriginNotificationPermissionRevocation",
  675. base::FEATURE_ENABLED_BY_DEFAULT};
  676. const base::Feature kRemoveStatusBarInWebApps{"RemoveStatusBarInWebApps",
  677. base::FEATURE_ENABLED_BY_DEFAULT};
  678. #if BUILDFLAG(IS_CHROMEOS_ASH)
  679. // Enables permanent removal of Legacy Supervised Users on startup.
  680. const base::Feature kRemoveSupervisedUsersOnStartup{
  681. "RemoveSupervisedUsersOnStartup", base::FEATURE_DISABLED_BY_DEFAULT};
  682. #endif
  683. #if BUILDFLAG(IS_ANDROID)
  684. const base::Feature kRequestDesktopSiteForTablets{
  685. "RequestDesktopSiteForTablets", base::FEATURE_DISABLED_BY_DEFAULT};
  686. #endif
  687. #if !BUILDFLAG(IS_ANDROID)
  688. // Enables permission modules on Safety Check.
  689. const base::Feature kSafetyCheckPermissions{"SafetyCheckPermissions",
  690. base::FEATURE_DISABLED_BY_DEFAULT};
  691. #endif // !BUILDFLAG(IS_ANDROID)
  692. #if BUILDFLAG(IS_CHROMEOS_ASH)
  693. // Enable support for multiple scheduler configurations.
  694. const base::Feature kSchedulerConfiguration{"SchedulerConfiguration",
  695. base::FEATURE_DISABLED_BY_DEFAULT};
  696. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  697. // Controls whether SCT audit reports are queued and the rate at which they
  698. // should be sampled. Default sampling rate is 1/10,000 certificates.
  699. #if BUILDFLAG(IS_ANDROID)
  700. const base::Feature kSCTAuditing{"SCTAuditing",
  701. base::FEATURE_DISABLED_BY_DEFAULT};
  702. #else
  703. const base::Feature kSCTAuditing{"SCTAuditing",
  704. base::FEATURE_ENABLED_BY_DEFAULT};
  705. #endif
  706. constexpr base::FeatureParam<double> kSCTAuditingSamplingRate{
  707. &kSCTAuditing, "sampling_rate", 0.0001};
  708. // SCT auditing hashdance allows Chrome clients who are not opted-in to Enhanced
  709. // Safe Browsing Reporting to perform a k-anonymous query to see if Google knows
  710. // about an SCT seen in the wild. If it hasn't been seen, then it is considered
  711. // a security incident and uploaded to Google.
  712. const base::Feature kSCTAuditingHashdance{"SCTAuditingHashdance",
  713. base::FEATURE_ENABLED_BY_DEFAULT};
  714. // An estimated high bound for the time it takes Google to ingest updates to an
  715. // SCT log. Chrome will wait for at least this time plus the Log's Maximum Merge
  716. // Delay after an SCT's timestamp before performing a hashdance lookup query.
  717. const base::FeatureParam<base::TimeDelta> kSCTLogExpectedIngestionDelay{
  718. &kSCTAuditingHashdance,
  719. "sct_log_expected_ingestion_delay",
  720. base::Hours(1),
  721. };
  722. // A random delay will be added to the expected log ingestion delay between zero
  723. // and this maximum. This prevents a burst of queries once a new SCT is issued.
  724. const base::FeatureParam<base::TimeDelta> kSCTLogMaxIngestionRandomDelay{
  725. &kSCTAuditingHashdance,
  726. "sct_log_max_ingestion_random_delay",
  727. base::Hours(1),
  728. };
  729. // Controls whether the user is prompted when sites request attestation.
  730. const base::Feature kSecurityKeyAttestationPrompt{
  731. "SecurityKeyAttestationPrompt", base::FEATURE_ENABLED_BY_DEFAULT};
  732. // Alternative to switches::kSitePerProcess, for turning on full site isolation.
  733. // Launch bug: https://crbug.com/810843. This is a //chrome-layer feature to
  734. // avoid turning on site-per-process by default for *all* //content embedders
  735. // (e.g. this approach lets ChromeCast avoid site-per-process mode).
  736. //
  737. // TODO(alexmos): Move this and the other site isolation features below to
  738. // browser_features, as they are only used on the browser side.
  739. const base::Feature kSitePerProcess {
  740. "SitePerProcess",
  741. #if BUILDFLAG(IS_ANDROID)
  742. base::FEATURE_DISABLED_BY_DEFAULT
  743. #else
  744. base::FEATURE_ENABLED_BY_DEFAULT
  745. #endif
  746. };
  747. #if BUILDFLAG(IS_CHROMEOS_ASH)
  748. // Enables or disables SmartDim on Chrome OS.
  749. const base::Feature kSmartDim{"SmartDim", base::FEATURE_DISABLED_BY_DEFAULT};
  750. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  751. // Enables or disables the ability to use the sound content setting to mute a
  752. // website.
  753. const base::Feature kSoundContentSetting{"SoundContentSetting",
  754. base::FEATURE_ENABLED_BY_DEFAULT};
  755. #if BUILDFLAG(IS_CHROMEOS_ASH)
  756. // Enables or disables chrome://sys-internals.
  757. const base::Feature kSysInternals{"SysInternals",
  758. base::FEATURE_DISABLED_BY_DEFAULT};
  759. // Enables or disables TPM firmware update capability on Chrome OS.
  760. const base::Feature kTPMFirmwareUpdate{"TPMFirmwareUpdate",
  761. base::FEATURE_ENABLED_BY_DEFAULT};
  762. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  763. #if !BUILDFLAG(IS_ANDROID)
  764. // Enables logging UKMs for background tab activity by TabActivityWatcher.
  765. const base::Feature kTabMetricsLogging{"TabMetricsLogging",
  766. base::FEATURE_ENABLED_BY_DEFAULT};
  767. // Enables the demo version of the Support Tool. The tool will be available in
  768. // chrome://support-tool. See go/support-tool-v1-design for more details.
  769. const base::Feature kSupportTool{"SupportTool",
  770. base::FEATURE_DISABLED_BY_DEFAULT};
  771. #endif
  772. #if BUILDFLAG(IS_WIN)
  773. // Enables the blocking of third-party modules. This feature requires Windows 8
  774. // or higher because it depends on the ProcessExtensionPointDisablePolicy
  775. // mitigation, which was not available on Windows 7.
  776. // Note: Due to a limitation in the implementation of this feature, it is
  777. // required to start the browser two times to fully enable or disable it.
  778. const base::Feature kThirdPartyModulesBlocking{
  779. "ThirdPartyModulesBlocking", base::FEATURE_DISABLED_BY_DEFAULT};
  780. #endif
  781. // Disable downloads of unsafe file types over insecure transports if initiated
  782. // from a secure page. As of M89, mixed downloads are blocked on all platforms.
  783. const base::Feature kTreatUnsafeDownloadsAsActive{
  784. "TreatUnsafeDownloadsAsActive", base::FEATURE_ENABLED_BY_DEFAULT};
  785. #if !BUILDFLAG(IS_ANDROID)
  786. // Enables surveying of users of Trust & Safety features with HaTS.
  787. const base::Feature kTrustSafetySentimentSurvey{
  788. "TrustSafetySentimentSurvey", base::FEATURE_DISABLED_BY_DEFAULT};
  789. // The minimum and maximum time after a user has interacted with a Trust and
  790. // Safety they are eligible to be surveyed.
  791. const base::FeatureParam<base::TimeDelta>
  792. kTrustSafetySentimentSurveyMinTimeToPrompt{
  793. &kTrustSafetySentimentSurvey, "min-time-to-prompt", base::Minutes(2)};
  794. const base::FeatureParam<base::TimeDelta>
  795. kTrustSafetySentimentSurveyMaxTimeToPrompt{
  796. &kTrustSafetySentimentSurvey, "max-time-to-prompt", base::Minutes(60)};
  797. // The maximum and minimum range for the random number of NTPs that the user
  798. // must at least visit after interacting with a Trust and Safety feature to be
  799. // eligible for a survey.
  800. const base::FeatureParam<int> kTrustSafetySentimentSurveyNtpVisitsMinRange{
  801. &kTrustSafetySentimentSurvey, "ntp-visits-min-range", 2};
  802. const base::FeatureParam<int> kTrustSafetySentimentSurveyNtpVisitsMaxRange{
  803. &kTrustSafetySentimentSurvey, "ntp-visits-max-range", 4};
  804. // The feature area probabilities for each feature area considered as part of
  805. // the Trust & Safety sentiment survey.
  806. const base::FeatureParam<double>
  807. kTrustSafetySentimentSurveyPrivacySettingsProbability{
  808. &kTrustSafetySentimentSurvey, "privacy-settings-probability", 0.6};
  809. const base::FeatureParam<double>
  810. kTrustSafetySentimentSurveyTrustedSurfaceProbability{
  811. &kTrustSafetySentimentSurvey, "trusted-surface-probability", 0.4};
  812. const base::FeatureParam<double>
  813. kTrustSafetySentimentSurveyTransactionsProbability{
  814. &kTrustSafetySentimentSurvey, "transactions-probability", 0.05};
  815. const base::FeatureParam<double>
  816. kTrustSafetySentimentSurveyPrivacySandbox3ConsentAcceptProbability{
  817. &kTrustSafetySentimentSurvey,
  818. "privacy-sandbox-3-consent-accept-probability", 0.1};
  819. const base::FeatureParam<double>
  820. kTrustSafetySentimentSurveyPrivacySandbox3ConsentDeclineProbability{
  821. &kTrustSafetySentimentSurvey,
  822. "privacy-sandbox-3-consent-decline-probability", 0.5};
  823. const base::FeatureParam<double>
  824. kTrustSafetySentimentSurveyPrivacySandbox3NoticeDismissProbability{
  825. &kTrustSafetySentimentSurvey,
  826. "privacy-sandbox-3-notice-dismiss-probability", 0.5};
  827. const base::FeatureParam<double>
  828. kTrustSafetySentimentSurveyPrivacySandbox3NoticeOkProbability{
  829. &kTrustSafetySentimentSurvey, "privacy-sandbox-3-notice-ok-probability",
  830. 0.05};
  831. const base::FeatureParam<double>
  832. kTrustSafetySentimentSurveyPrivacySandbox3NoticeSettingsProbability{
  833. &kTrustSafetySentimentSurvey,
  834. "privacy-sandbox-3-notice-settings-probability", 0.8};
  835. const base::FeatureParam<double>
  836. kTrustSafetySentimentSurveyPrivacySandbox3NoticeLearnMoreProbability{
  837. &kTrustSafetySentimentSurvey,
  838. "privacy-sandbox-3-notice-learn-more-probability", 0.2};
  839. // The HaTS trigger IDs, which determine which survey is delivered from the HaTS
  840. // backend.
  841. const base::FeatureParam<std::string>
  842. kTrustSafetySentimentSurveyPrivacySettingsTriggerId{
  843. &kTrustSafetySentimentSurvey, "privacy-settings-trigger-id", ""};
  844. const base::FeatureParam<std::string>
  845. kTrustSafetySentimentSurveyTrustedSurfaceTriggerId{
  846. &kTrustSafetySentimentSurvey, "trusted-surface-trigger-id", ""};
  847. extern const base::FeatureParam<std::string>
  848. kTrustSafetySentimentSurveyTransactionsTriggerId{
  849. &kTrustSafetySentimentSurvey, "transactions-trigger-id", ""};
  850. extern const base::FeatureParam<std::string>
  851. kTrustSafetySentimentSurveyPrivacySandbox3ConsentAcceptTriggerId{
  852. &kTrustSafetySentimentSurvey,
  853. "privacy-sandbox-3-consent-accept-trigger-id", ""};
  854. extern const base::FeatureParam<std::string>
  855. kTrustSafetySentimentSurveyPrivacySandbox3ConsentDeclineTriggerId{
  856. &kTrustSafetySentimentSurvey,
  857. "privacy-sandbox-3-consent-decline-trigger-id", ""};
  858. extern const base::FeatureParam<std::string>
  859. kTrustSafetySentimentSurveyPrivacySandbox3NoticeDismissTriggerId{
  860. &kTrustSafetySentimentSurvey,
  861. "privacy-sandbox-3-notice-dismiss-trigger-id", ""};
  862. extern const base::FeatureParam<std::string>
  863. kTrustSafetySentimentSurveyPrivacySandbox3NoticeOkTriggerId{
  864. &kTrustSafetySentimentSurvey, "privacy-sandbox-3-notice-ok-trigger-id",
  865. ""};
  866. extern const base::FeatureParam<std::string>
  867. kTrustSafetySentimentSurveyPrivacySandbox3NoticeSettingsTriggerId{
  868. &kTrustSafetySentimentSurvey,
  869. "privacy-sandbox-3-notice-settings-trigger-id", ""};
  870. extern const base::FeatureParam<std::string>
  871. kTrustSafetySentimentSurveyPrivacySandbox3NoticeLearnMoreTriggerId{
  872. &kTrustSafetySentimentSurvey,
  873. "privacy-sandbox-3-notice-learn-more-trigger-id", ""};
  874. // The time the user must remain on settings after interacting with a privacy
  875. // setting to be considered.
  876. const base::FeatureParam<base::TimeDelta>
  877. kTrustSafetySentimentSurveyPrivacySettingsTime{&kTrustSafetySentimentSurvey,
  878. "privacy-settings-time",
  879. base::Seconds(20)};
  880. // The time the user must have the Trusted Surface bubble open to be considered.
  881. // Alternatively the user can interact with the bubble, in which case this time
  882. // is irrelevant.
  883. const base::FeatureParam<base::TimeDelta>
  884. kTrustSafetySentimentSurveyTrustedSurfaceTime{
  885. &kTrustSafetySentimentSurvey, "trusted-surface-time", base::Seconds(5)};
  886. // The time the user must remain on settings after visiting the password
  887. // manager page.
  888. const base::FeatureParam<base::TimeDelta>
  889. kTrustSafetySentimentSurveyTransactionsPasswordManagerTime{
  890. &kTrustSafetySentimentSurvey, "transactions-password-manager-time",
  891. base::Seconds(20)};
  892. #endif
  893. #if BUILDFLAG(IS_CHROMEOS_ASH)
  894. // Enable uploading of a zip archive of system logs instead of individual files.
  895. const base::Feature kUploadZippedSystemLogs{"UploadZippedSystemLogs",
  896. base::FEATURE_ENABLED_BY_DEFAULT};
  897. #endif
  898. #if BUILDFLAG(IS_CHROMEOS_ASH)
  899. // Enables or disables user activity event logging for power management on
  900. // Chrome OS.
  901. const base::Feature kUserActivityEventLogging{"UserActivityEventLogging",
  902. base::FEATURE_ENABLED_BY_DEFAULT};
  903. #endif
  904. #if !BUILDFLAG(IS_ANDROID)
  905. const base::Feature kWebAppManifestIconUpdating{
  906. "WebAppManifestIconUpdating", base::FEATURE_DISABLED_BY_DEFAULT};
  907. #endif // BUILDFLAG(IS_ANDROID)
  908. const base::Feature kWebAppManifestPolicyAppIdentityUpdate{
  909. "WebAppManifestPolicyAppIdentityUpdate", base::FEATURE_ENABLED_BY_DEFAULT};
  910. #if BUILDFLAG(IS_CHROMEOS_ASH)
  911. // When this feature flag is enabled together with the LacrosAvailability
  912. // policy, the Chrome app Kiosk session uses Lacros-chrome as the web browser to
  913. // launch Chrome apps. When disabled, the Ash-chrome will be used instead.
  914. const base::Feature kChromeKioskEnableLacros{"ChromeKioskEnableLacros",
  915. base::FEATURE_ENABLED_BY_DEFAULT};
  916. // When this feature flag is enabled together with the LacrosAvailability
  917. // policy, the web (PWA) Kiosk session uses Lacros-chrome as the web browser to
  918. // launch web (PWA) applications. When disabled, the Ash-chrome will be used
  919. // instead.
  920. const base::Feature kWebKioskEnableLacros{"WebKioskEnableLacros",
  921. base::FEATURE_ENABLED_BY_DEFAULT};
  922. // When enabled, the Ash browser only manages system web apps, and non-system
  923. // web apps are managed by the Lacros browser. When disabled, the Ash browser
  924. // manages all web apps.
  925. const base::Feature kWebAppsCrosapi{"WebAppsCrosapi",
  926. base::FEATURE_DISABLED_BY_DEFAULT};
  927. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  928. #if !BUILDFLAG(IS_ANDROID)
  929. // Allow capturing of WebRTC event logs, and uploading of those logs to Crash.
  930. // Please note that a Chrome policy must also be set, for this to have effect.
  931. // Effectively, this is a kill-switch for the feature.
  932. // TODO(crbug.com/775415): Remove this kill-switch.
  933. const base::Feature kWebRtcRemoteEventLog{"WebRtcRemoteEventLog",
  934. base::FEATURE_ENABLED_BY_DEFAULT};
  935. // Compress remote-bound WebRTC event logs (if used; see kWebRtcRemoteEventLog).
  936. const base::Feature kWebRtcRemoteEventLogGzipped{
  937. "WebRtcRemoteEventLogGzipped", base::FEATURE_ENABLED_BY_DEFAULT};
  938. #endif
  939. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS)
  940. // Enables Web Share (navigator.share)
  941. const base::Feature kWebShare{"WebShare", base::FEATURE_ENABLED_BY_DEFAULT};
  942. #endif
  943. #if BUILDFLAG(IS_MAC)
  944. // Enables Web Share (navigator.share) for macOS
  945. const base::Feature kWebShare{"WebShare", base::FEATURE_DISABLED_BY_DEFAULT};
  946. #endif
  947. // Whether to enable "dark mode" enhancements in Mac Mojave or Windows 10 for
  948. // UIs implemented with web technologies.
  949. const base::Feature kWebUIDarkMode {
  950. "WebUIDarkMode",
  951. #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || \
  952. BUILDFLAG(IS_CHROMEOS_ASH)
  953. base::FEATURE_ENABLED_BY_DEFAULT
  954. #else
  955. base::FEATURE_DISABLED_BY_DEFAULT
  956. #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) ||
  957. // BUILDFLAG(IS_CHROMEOS_ASH)
  958. };
  959. #if BUILDFLAG(IS_CHROMEOS_ASH)
  960. // Populates storage dimensions in UMA log if enabled. Requires diagnostics
  961. // package in the image.
  962. const base::Feature kUmaStorageDimensions{"UmaStorageDimensions",
  963. base::FEATURE_DISABLED_BY_DEFAULT};
  964. // Allow a Wilco DTC (diagnostics and telemetry controller) on Chrome OS.
  965. // More info about the project may be found here:
  966. // https://docs.google.com/document/d/18Ijj8YlC8Q3EWRzLspIi2dGxg4vIBVe5sJgMPt9SWYo
  967. const base::Feature kWilcoDtc{"WilcoDtc", base::FEATURE_DISABLED_BY_DEFAULT};
  968. #endif
  969. #if BUILDFLAG(IS_CHROMEOS_ASH)
  970. // Populates the user type on device type metrics in UMA log if enabled.
  971. const base::Feature kUserTypeByDeviceTypeMetricsProvider{
  972. "UserTypeByDeviceTypeMetricsProvider", base::FEATURE_ENABLED_BY_DEFAULT};
  973. #endif
  974. #if BUILDFLAG(IS_WIN)
  975. // Enables the accelerated default browser flow for Windows 10.
  976. const base::Feature kWin10AcceleratedDefaultBrowserFlow{
  977. "Win10AcceleratedDefaultBrowserFlow", base::FEATURE_ENABLED_BY_DEFAULT};
  978. #endif // BUILDFLAG(IS_WIN)
  979. // Enables writing basic system profile to the persistent histograms files
  980. // earlier.
  981. const base::Feature kWriteBasicSystemProfileToPersistentHistogramsFile{
  982. "WriteBasicSystemProfileToPersistentHistogramsFile",
  983. base::FEATURE_ENABLED_BY_DEFAULT};
  984. #if BUILDFLAG(IS_CHROMEOS_ASH)
  985. bool IsParentAccessCodeForOnlineLoginEnabled() {
  986. return base::FeatureList::IsEnabled(kParentAccessCodeForOnlineLogin);
  987. }
  988. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  989. // Enables omnibox trigger prerendering.
  990. const base::Feature kOmniboxTriggerForPrerender2{
  991. "OmniboxTriggerForPrerender2", base::FEATURE_DISABLED_BY_DEFAULT};
  992. const base::Feature kSupportSearchSuggestionForPrerender2{
  993. "SupportSearchSuggestionForPrerender2", base::FEATURE_DISABLED_BY_DEFAULT};
  994. const base::FeatureParam<SearchSuggestionPrerenderImplementationType>::Option
  995. search_suggestion_implementation_types[] = {
  996. {SearchSuggestionPrerenderImplementationType::kUsePrefetch,
  997. "use_prefetch"},
  998. {SearchSuggestionPrerenderImplementationType::kIgnorePrefetch,
  999. "ignore_prefetch"}};
  1000. const base::FeatureParam<SearchSuggestionPrerenderImplementationType>
  1001. kSearchSuggestionPrerenderImplementationTypeParam{
  1002. &kSupportSearchSuggestionForPrerender2, "implementation_type",
  1003. SearchSuggestionPrerenderImplementationType::kIgnorePrefetch,
  1004. &search_suggestion_implementation_types};
  1005. // Enables omnibox trigger no state prefetch. Only one of
  1006. // kOmniboxTriggerForPrerender2 or kOmniboxTriggerForNoStatePrefetch can be
  1007. // enabled in the experiment.
  1008. // TODO(crbug.com/1267731): Remove this flag once the experiments are completed.
  1009. const base::Feature kOmniboxTriggerForNoStatePrefetch{
  1010. "OmniboxTriggerForNoStatePrefetch", base::FEATURE_ENABLED_BY_DEFAULT};
  1011. #if BUILDFLAG(IS_CHROMEOS_ASH)
  1012. // A feature to indicate whether setting wake time >24hours away is supported by
  1013. // the platform's RTC.
  1014. // TODO(b/187516317): Remove when the issue is resolved in FW.
  1015. const base::Feature kSupportsRtcWakeOver24Hours{
  1016. "SupportsRtcWakeOver24Hours", base::FEATURE_ENABLED_BY_DEFAULT};
  1017. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  1018. const base::Feature kUseWebAppDBInsteadOfExternalPrefs{
  1019. "UseWebAppDBInsteadOfExternalPrefs", base::FEATURE_ENABLED_BY_DEFAULT};
  1020. } // namespace features