[M120][Tizen][Onscreen] Fix build errors for TV profile
[platform/framework/web/chromium-efl.git] / chrome / browser / browser_features.cc
1 // Copyright 2018 The Chromium Authors
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/browser/browser_features.h"
6
7 #include "base/feature_list.h"
8 #include "build/branding_buildflags.h"
9 #include "build/build_config.h"
10 #include "build/chromeos_buildflags.h"
11
12 #if BUILDFLAG(IS_WIN)
13 #include "chrome/browser/net/system_network_context_manager.h"
14 #endif
15
16 namespace features {
17
18 // Enables using the ClosedTabCache to instantly restore recently closed tabs
19 // using the "Reopen Closed Tab" button.
20 BASE_FEATURE(kClosedTabCache,
21              "ClosedTabCache",
22              base::FEATURE_DISABLED_BY_DEFAULT);
23
24 // Destroy profiles when their last browser window is closed, instead of when
25 // the browser exits.
26 // On Lacros the feature is enabled only for secondary profiles, check the
27 // implementation of `ProfileManager::ProfileInfo::FromUnownedProfile()`.
28 BASE_FEATURE(kDestroyProfileOnBrowserClose,
29              "DestroyProfileOnBrowserClose",
30 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || \
31     BUILDFLAG(IS_CHROMEOS_LACROS)
32              base::FEATURE_ENABLED_BY_DEFAULT);
33 #else
34              base::FEATURE_DISABLED_BY_DEFAULT);
35 #endif
36
37 // DestroyProfileOnBrowserClose only covers deleting regular (non-System)
38 // Profiles. This flags lets us destroy the System Profile, as well.
39 BASE_FEATURE(kDestroySystemProfiles,
40              "DestroySystemProfiles",
41              base::FEATURE_DISABLED_BY_DEFAULT);
42
43 // Let DevTools front-end talk to the target of type "tab" rather than
44 // "frame" when inspecting a WebContents.
45 BASE_FEATURE(kDevToolsTabTarget,
46              "DevToolsTabTarget",
47              base::FEATURE_ENABLED_BY_DEFAULT);
48
49 // Let DevTools front-end log extensive VisualElements-style UMA metrics for
50 // impressions and interactions.
51 BASE_FEATURE(kDevToolsVeLogging,
52              "DevToolsVeLogging",
53              base::FEATURE_DISABLED_BY_DEFAULT);
54
55 // Nukes profile directory before creating a new profile using
56 // ProfileManager::CreateMultiProfileAsync().
57 BASE_FEATURE(kNukeProfileBeforeCreateMultiAsync,
58              "NukeProfileBeforeCreateMultiAsync",
59              base::FEATURE_ENABLED_BY_DEFAULT);
60
61 // Enables executing the browser commands sent by the NTP promos.
62 BASE_FEATURE(kPromoBrowserCommands,
63              "PromoBrowserCommands",
64              base::FEATURE_ENABLED_BY_DEFAULT);
65
66 // Parameter name for the promo browser command ID provided along with
67 // kPromoBrowserCommands.
68 // The value of this parameter should be parsable as an unsigned integer and
69 // should map to one of the browser commands specified in:
70 // ui/webui/resources/js/browser_command/browser_command.mojom
71 const char kBrowserCommandIdParam[] = "BrowserCommandIdParam";
72
73 #if BUILDFLAG(IS_CHROMEOS_ASH)
74 // Enables reading and writing PWA notification permissions from quick settings
75 // menu.
76 BASE_FEATURE(kQuickSettingsPWANotifications,
77              "QuickSettingsPWA",
78              base::FEATURE_DISABLED_BY_DEFAULT);
79 #endif
80
81 #if BUILDFLAG(IS_CHROMEOS)
82 // Enables being able to zoom a web page by double tapping in Chrome OS tablet
83 // mode.
84 BASE_FEATURE(kDoubleTapToZoomInTabletMode,
85              "DoubleTapToZoomInTabletMode",
86              base::FEATURE_DISABLED_BY_DEFAULT);
87 #endif
88
89 #if !BUILDFLAG(IS_ANDROID)
90 // Adds an item to the context menu that copies a link to the page with the
91 // selected text highlighted.
92 BASE_FEATURE(kCopyLinkToText,
93              "CopyLinkToText",
94              base::FEATURE_ENABLED_BY_DEFAULT);
95
96 // Adds a "Snooze" action to mute notifications during screen sharing sessions.
97 BASE_FEATURE(kMuteNotificationSnoozeAction,
98              "MuteNotificationSnoozeAction",
99              base::FEATURE_DISABLED_BY_DEFAULT);
100 #endif
101
102 // Gates sandboxed iframe navigation toward external protocol behind any of:
103 // - allow-top-navigation
104 // - allow-top-navigation-to-custom-protocols
105 // - allow-top-navigation-with-user-gesture (+ user gesture)
106 // - allow-popups
107 //
108 // Motivation:
109 // Developers are surprised that a sandboxed iframe can navigate and/or
110 // redirect the user toward an external application.
111 // General iframe navigation in sandboxed iframe are not blocked normally,
112 // because they stay within the iframe. However they can be seen as a popup or
113 // a top-level navigation when it leads to opening an external application. In
114 // this case, it makes sense to extend the scope of sandbox flags, to block
115 // malvertising.
116 //
117 // Implementation bug: https://crbug.com/1253379
118 // I2S: https://groups.google.com/a/chromium.org/g/blink-dev/c/-t-f7I6VvOI
119 //
120 // Enabled in M103. Flag to be removed in M106
121 BASE_FEATURE(kSandboxExternalProtocolBlocked,
122              "SandboxExternalProtocolBlocked",
123              base::FEATURE_ENABLED_BY_DEFAULT);
124 // Enabled in M100. Flag to be removed in M106
125 BASE_FEATURE(kSandboxExternalProtocolBlockedWarning,
126              "SandboxExternalProtocolBlockedWarning",
127              base::FEATURE_ENABLED_BY_DEFAULT);
128
129 // Enables migration of the network context data from `unsandboxed_data_path` to
130 // `data_path`. See the explanation in network_context.mojom.
131 BASE_FEATURE(kTriggerNetworkDataMigration,
132              "TriggerNetworkDataMigration",
133 #if BUILDFLAG(IS_WIN)
134              base::FEATURE_ENABLED_BY_DEFAULT
135 #else
136              base::FEATURE_DISABLED_BY_DEFAULT
137 #endif
138 );
139
140 #if BUILDFLAG(IS_CHROMEOS)
141 // If enabled, a blue border is drawn around shared tabs on ChromeOS.
142 // If disabled, the blue border is not used on ChromeOS.
143 //
144 // Motivation:
145 //  The blue border behavior used to cause problems on ChromeOS - see
146 //  crbug.com/1320262 for Ash (fixed) and crbug.com/1030925 for Lacros
147 //  (relatively old bug - we would like to observe whether it's still
148 //  there). This flag is introduced as means of disabling this feature in case
149 //  of possible future regressions.
150 //
151 // TODO(crbug.com/1251999): Remove this flag once we confirm that blue border
152 // works fine on ChromeOS.
153 //
154 // b/279051234: We suspect the tab sharing blue border may cause a bad issue
155 // on ChromeOS where a window can not be interacted at all. Disable the feature
156 // on ChromeOS.
157 BASE_FEATURE(kTabCaptureBlueBorderCrOS,
158              "TabCaptureBlueBorderCrOS",
159              base::FEATURE_DISABLED_BY_DEFAULT);
160 #endif
161
162 // Enables runtime detection of USB devices which provide a WebUSB landing page
163 // descriptor.
164 BASE_FEATURE(kWebUsbDeviceDetection,
165              "WebUsbDeviceDetection",
166              base::FEATURE_ENABLED_BY_DEFAULT);
167
168 // Enables Certificate Transparency on Desktop.
169 // Enabling CT enforcement requires maintaining a log policy, and the ability to
170 // update the list of accepted logs. Embedders who are planning to enable this
171 // should first reach out to chrome-certificate-transparency@google.com.
172 BASE_FEATURE(kCertificateTransparencyAskBeforeEnabling,
173              "CertificateTransparencyAskBeforeEnabling",
174 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
175              base::FEATURE_ENABLED_BY_DEFAULT);
176 #else
177              base::FEATURE_DISABLED_BY_DEFAULT);
178 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
179
180 BASE_FEATURE(kLargeFaviconFromGoogle,
181              "LargeFaviconFromGoogle",
182              base::FEATURE_DISABLED_BY_DEFAULT);
183 const base::FeatureParam<int> kLargeFaviconFromGoogleSizeInDip{
184     &kLargeFaviconFromGoogle, "favicon_size_in_dip", 128};
185
186 // Controls whether the static key pinning list can be updated via component
187 // updater.
188 BASE_FEATURE(kKeyPinningComponentUpdater,
189              "KeyPinningComponentUpdater",
190              base::FEATURE_ENABLED_BY_DEFAULT);
191
192 // When this feature is enabled, the network service will restart unsandboxed if
193 // a previous attempt to launch it sandboxed failed.
194 BASE_FEATURE(kRestartNetworkServiceUnsandboxedForFailedLaunch,
195              "RestartNetworkServiceUnsandboxedForFailedLaunch",
196              base::FEATURE_ENABLED_BY_DEFAULT);
197
198 #if BUILDFLAG(IS_WIN)
199 // When this feature is enabled, metrics are gathered regarding the performance
200 // and reliability of app-bound encryption primitives on a background thread.
201 BASE_FEATURE(kAppBoundEncryptionMetrics,
202              "AppBoundEncryptionMetrics",
203              base::FEATURE_ENABLED_BY_DEFAULT);
204
205 // Enables locking the cookie database for profiles.
206 // TODO(crbug.com/1430226): Remove after fully launched.
207 BASE_FEATURE(kLockProfileCookieDatabase,
208              "LockProfileCookieDatabase",
209              base::FEATURE_ENABLED_BY_DEFAULT);
210
211 // Don't call the Win32 API PrefetchVirtualMemory when loading chrome.dll inside
212 // non-browser processes. This is done by passing flags to these processes. This
213 // prevents pulling the entirety of chrome.dll into physical memory (albeit only
214 // pri-2 physical memory) under the assumption that during chrome execution,
215 // portions of the DLL which are used will already be present, hopefully leading
216 // to less needless memory consumption.
217 BASE_FEATURE(kNoPreReadMainDll,
218              "NoPreReadMainDll",
219              base::FEATURE_DISABLED_BY_DEFAULT);
220 #endif
221
222 // Enables showing the email of the flex org admin that setup CBCM in the
223 // management disclosures.
224 #if BUILDFLAG(IS_CHROMEOS)
225 BASE_FEATURE(kFlexOrgManagementDisclosure,
226              "FlexOrgManagementDisclosure",
227              base::FEATURE_DISABLED_BY_DEFAULT);
228 #else
229 BASE_FEATURE(kFlexOrgManagementDisclosure,
230              "FlexOrgManagementDisclosure",
231              base::FEATURE_ENABLED_BY_DEFAULT);
232 #endif  // BUILDFLAG(IS_CHROMEOS)
233
234 // Enables usage of the FedCM API without third party cookies at the same time.
235 BASE_FEATURE(kFedCmWithoutThirdPartyCookies,
236              "FedCmWithoutThirdPartyCookies",
237              base::FEATURE_DISABLED_BY_DEFAULT);
238
239 // Enables the Incoming Call Notifications scenario. When created by an
240 // installed origin, an incoming call notification should have increased
241 // priority, colored buttons, a ringtone, and a default "close" button.
242 // Otherwise, if the origin is not installed, it should behave like the default
243 // notifications, but with the added "Close" button. See
244 // https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Notifications/notifications_actions_customization.md
245 BASE_FEATURE(kIncomingCallNotifications,
246              "IncomingCallNotifications",
247              base::FEATURE_DISABLED_BY_DEFAULT);
248
249 // Enables omnibox trigger prerendering.
250 BASE_FEATURE(kOmniboxTriggerForPrerender2,
251              "OmniboxTriggerForPrerender2",
252              base::FEATURE_ENABLED_BY_DEFAULT);
253
254 // Enables bookmark trigger prerendering.
255 BASE_FEATURE(kBookmarkTriggerForPrerender2,
256              "BookmarkTriggerForPrerender2",
257              base::FEATURE_DISABLED_BY_DEFAULT);
258
259 // Enables New Tab Page trigger prerendering.
260 BASE_FEATURE(kNewTabPageTriggerForPrerender2,
261              "NewTabPageTriggerForPrerender2",
262              base::FEATURE_DISABLED_BY_DEFAULT);
263
264 BASE_FEATURE(kSupportSearchSuggestionForPrerender2,
265              "SupportSearchSuggestionForPrerender2",
266              base::FEATURE_DISABLED_BY_DEFAULT);
267
268 const base::FeatureParam<SearchPreloadShareableCacheType>::Option
269     search_preload_shareable_cache_types[] = {
270         {SearchPreloadShareableCacheType::kEnabled, "enabled"},
271         {SearchPreloadShareableCacheType::kDisabled, "disabled"}};
272 const base::FeatureParam<SearchPreloadShareableCacheType>
273     kSearchPreloadShareableCacheTypeParam{
274         &kSupportSearchSuggestionForPrerender2, "shareable_cache",
275         SearchPreloadShareableCacheType::kEnabled,
276         &search_preload_shareable_cache_types};
277
278 BASE_FEATURE(kPrerenderDSEHoldback,
279              "PrerenderDSEHoldback",
280              base::FEATURE_DISABLED_BY_DEFAULT);
281
282 BASE_FEATURE(kAutocompleteActionPredictorConfidenceCutoff,
283              "AutocompleteActionPredictorConfidenceCutoff",
284              base::FEATURE_DISABLED_BY_DEFAULT);
285
286 // Enables omnibox trigger no state prefetch. Only one of
287 // kOmniboxTriggerForPrerender2 or kOmniboxTriggerForNoStatePrefetch can be
288 // enabled in the experiment. If both are enabled, only
289 // kOmniboxTriggerForPrerender2 takes effect.
290 // TODO(crbug.com/1267731): Remove this flag once the experiments are completed.
291 BASE_FEATURE(kOmniboxTriggerForNoStatePrefetch,
292              "OmniboxTriggerForNoStatePrefetch",
293              base::FEATURE_DISABLED_BY_DEFAULT);
294
295 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
296 BASE_FEATURE(kPayloadTestComponent,
297              "PayloadTestComponent",
298              base::FEATURE_DISABLED_BY_DEFAULT);
299 #endif
300
301 }  // namespace features