1 // Copyright (c) 2012 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.
5 #include "chrome/browser/about_flags.h"
12 #include "base/command_line.h"
13 #include "base/memory/singleton.h"
14 #include "base/stl_util.h"
15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/utf_string_conversions.h"
17 #include "base/values.h"
18 #include "cc/base/switches.h"
19 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
20 #include "chrome/browser/flags_storage.h"
21 #include "chrome/common/chrome_content_client.h"
22 #include "chrome/common/chrome_switches.h"
23 #include "components/autofill/core/common/autofill_switches.h"
24 #include "components/cloud_devices/common/cloud_devices_switches.h"
25 #include "components/nacl/common/nacl_switches.h"
26 #include "components/search/search_switches.h"
27 #include "content/public/browser/user_metrics.h"
28 #include "extensions/common/switches.h"
29 #include "grit/chromium_strings.h"
30 #include "grit/generated_resources.h"
31 #include "grit/google_chrome_strings.h"
32 #include "media/base/media_switches.h"
33 #include "ui/base/l10n/l10n_util.h"
34 #include "ui/base/ui_base_switches.h"
35 #include "ui/display/display_switches.h"
36 #include "ui/events/event_switches.h"
37 #include "ui/gfx/switches.h"
38 #include "ui/gl/gl_switches.h"
39 #include "ui/keyboard/keyboard_switches.h"
40 #include "ui/native_theme/native_theme_switches.h"
41 #include "ui/views/views_switches.h"
43 #if defined(OS_ANDROID)
44 #include "chrome/common/chrome_version_info.h"
45 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h"
49 #include "ash/ash_switches.h"
52 #if defined(OS_CHROMEOS)
53 #include "chromeos/chromeos_switches.h"
54 #include "third_party/cros_system_api/switches/chrome_switches.h"
57 #if defined(ENABLE_APP_LIST)
58 #include "ui/app_list/app_list_switches.h"
61 using base::UserMetricsAction
;
63 namespace about_flags
{
65 // Macros to simplify specifying the type.
66 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
67 Experiment::SINGLE_VALUE, \
68 command_line_switch, switch_value, NULL, NULL, NULL, 0
69 #define SINGLE_VALUE_TYPE(command_line_switch) \
70 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
71 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
72 disable_switch, disable_value) \
73 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
74 disable_switch, disable_value, NULL, 3
75 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
76 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
77 #define MULTI_VALUE_TYPE(choices) \
78 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
82 const unsigned kOsAll
= kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
;
83 const unsigned kOsDesktop
= kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
;
85 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
86 // whether the experiment is available on that platform.
87 void AddOsStrings(unsigned bitmask
, base::ListValue
* list
) {
90 const char* const name
;
95 {kOsCrOS
, "Chrome OS"},
96 {kOsAndroid
, "Android"},
97 {kOsCrOSOwnerOnly
, "Chrome OS (owner only)"},
99 for (size_t i
= 0; i
< ARRAYSIZE_UNSAFE(kBitsToOs
); ++i
)
100 if (bitmask
& kBitsToOs
[i
].bit
)
101 list
->Append(new base::StringValue(kBitsToOs
[i
].name
));
104 // Convert switch constants to proper CommandLine::StringType strings.
105 CommandLine::StringType
GetSwitchString(const std::string
& flag
) {
106 CommandLine
cmd_line(CommandLine::NO_PROGRAM
);
107 cmd_line
.AppendSwitch(flag
);
108 DCHECK_EQ(2U, cmd_line
.argv().size());
109 return cmd_line
.argv()[1];
112 // Scoops flags from a command line.
113 std::set
<CommandLine::StringType
> ExtractFlagsFromCommandLine(
114 const CommandLine
& cmdline
) {
115 std::set
<CommandLine::StringType
> flags
;
116 // First do the ones between --flag-switches-begin and --flag-switches-end.
117 CommandLine::StringVector::const_iterator first
=
118 std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
119 GetSwitchString(switches::kFlagSwitchesBegin
));
120 CommandLine::StringVector::const_iterator last
=
121 std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
122 GetSwitchString(switches::kFlagSwitchesEnd
));
123 if (first
!= cmdline
.argv().end() && last
!= cmdline
.argv().end())
124 flags
.insert(first
+ 1, last
);
125 #if defined(OS_CHROMEOS)
126 // Then add those between --policy-switches-begin and --policy-switches-end.
127 first
= std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
128 GetSwitchString(chromeos::switches::kPolicySwitchesBegin
));
129 last
= std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
130 GetSwitchString(chromeos::switches::kPolicySwitchesEnd
));
131 if (first
!= cmdline
.argv().end() && last
!= cmdline
.argv().end())
132 flags
.insert(first
+ 1, last
);
137 const Experiment::Choice kEnableCompositingForFixedPositionChoices
[] = {
138 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
139 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
140 switches::kEnableCompositingForFixedPosition
, ""},
141 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
142 switches::kDisableCompositingForFixedPosition
, ""},
143 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI
,
144 switches::kEnableHighDpiCompositingForFixedPosition
, ""}
147 const Experiment::Choice kEnableCompositingForTransitionChoices
[] = {
148 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
150 switches::kEnableCompositingForTransition
, ""},
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
152 switches::kDisableCompositingForTransition
, ""},
155 const Experiment::Choice kEnableAcceleratedFixedRootBackgroundChoices
[] = {
156 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
157 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
158 switches::kEnableAcceleratedFixedRootBackground
, ""},
159 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
160 switches::kDisableAcceleratedFixedRootBackground
, ""},
163 const Experiment::Choice kTouchEventsChoices
[] = {
164 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC
, "", "" },
165 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
166 switches::kTouchEvents
,
167 switches::kTouchEventsEnabled
},
168 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
169 switches::kTouchEvents
,
170 switches::kTouchEventsDisabled
}
173 #if defined(USE_AURA)
174 const Experiment::Choice kOverscrollHistoryNavigationChoices
[] = {
175 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
, "", "" },
176 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
177 switches::kOverscrollHistoryNavigation
,
179 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI
,
180 switches::kOverscrollHistoryNavigation
,
184 #if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_LINUX)
185 const Experiment::Choice kDeviceScaleFactorChoices
[] = {
186 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", ""},
187 { IDS_DEVICE_SCALE_FACTOR_1_1
, switches::kForceDeviceScaleFactor
, "1.1"},
188 { IDS_DEVICE_SCALE_FACTOR_1_2
, switches::kForceDeviceScaleFactor
, "1.2"},
189 { IDS_DEVICE_SCALE_FACTOR_1_25
, switches::kForceDeviceScaleFactor
, "1.25"},
190 { IDS_DEVICE_SCALE_FACTOR_1_3
, switches::kForceDeviceScaleFactor
, "1.3"},
191 { IDS_DEVICE_SCALE_FACTOR_1_4
, switches::kForceDeviceScaleFactor
, "1.4"},
192 { IDS_DEVICE_SCALE_FACTOR_2
, switches::kForceDeviceScaleFactor
, "2"},
196 #if !defined(DISABLE_NACL)
197 const Experiment::Choice kNaClDebugMaskChoices
[] = {
198 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
199 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
200 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
201 // so by default we want to avoid debugging that.
202 // NOTE: As the default value must be the empty string, the mask excluding
203 // the PNaCl translator and secure shell is substituted elsewhere.
204 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL
, "", "" },
205 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL
, switches::kNaClDebugMask
, "*://*" },
206 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG
,
207 switches::kNaClDebugMask
, "*://*/*debug.nmf" }
211 const Experiment::Choice kImplSidePaintingChoices
[] = {
212 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
213 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
214 switches::kEnableImplSidePainting
, ""},
215 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
216 switches::kDisableImplSidePainting
, ""}
219 const Experiment::Choice kLCDTextChoices
[] = {
220 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
221 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
, switches::kEnableLCDText
, ""},
222 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
, switches::kDisableLCDText
, ""}
225 const Experiment::Choice kDistanceFieldTextChoices
[] = {
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
227 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
228 switches::kEnableDistanceFieldText
, "" },
229 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
230 switches::kDisableDistanceFieldText
, "" }
234 const Experiment::Choice kDelegatedRendererChoices
[] = {
235 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
236 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
237 switches::kEnableDelegatedRenderer
, ""},
238 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
239 switches::kDisableDelegatedRenderer
, ""}
243 const Experiment::Choice kMaxTilesForInterestAreaChoices
[] = {
244 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
245 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT
,
246 cc::switches::kMaxTilesForInterestArea
, "64"},
247 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL
,
248 cc::switches::kMaxTilesForInterestArea
, "128"},
249 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE
,
250 cc::switches::kMaxTilesForInterestArea
, "256"},
251 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI
,
252 cc::switches::kMaxTilesForInterestArea
, "512"}
255 const Experiment::Choice kDefaultTileWidthChoices
[] = {
256 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
257 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT
,
258 switches::kDefaultTileWidth
, "128"},
259 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL
,
260 switches::kDefaultTileWidth
, "256"},
261 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE
,
262 switches::kDefaultTileWidth
, "512"},
263 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI
,
264 switches::kDefaultTileWidth
, "1024"}
267 const Experiment::Choice kDefaultTileHeightChoices
[] = {
268 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
269 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT
,
270 switches::kDefaultTileHeight
, "128"},
271 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL
,
272 switches::kDefaultTileHeight
, "256"},
273 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE
,
274 switches::kDefaultTileHeight
, "512"},
275 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI
,
276 switches::kDefaultTileHeight
, "1024"}
279 const Experiment::Choice kSimpleCacheBackendChoices
[] = {
280 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
281 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
282 switches::kUseSimpleCacheBackend
, "off" },
283 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
284 switches::kUseSimpleCacheBackend
, "on"}
287 #if defined(USE_AURA)
288 const Experiment::Choice kTabCaptureUpscaleQualityChoices
[] = {
289 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
290 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST
,
291 switches::kTabCaptureUpscaleQuality
, "fast" },
292 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD
,
293 switches::kTabCaptureUpscaleQuality
, "good" },
294 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST
,
295 switches::kTabCaptureUpscaleQuality
, "best" },
298 const Experiment::Choice kTabCaptureDownscaleQualityChoices
[] = {
299 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
300 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST
,
301 switches::kTabCaptureDownscaleQuality
, "fast" },
302 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD
,
303 switches::kTabCaptureDownscaleQuality
, "good" },
304 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST
,
305 switches::kTabCaptureDownscaleQuality
, "best" },
309 #if defined(USE_AURA) || defined(OS_LINUX)
310 const Experiment::Choice kOverlayScrollbarChoices
[] = {
311 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
312 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
313 switches::kEnableOverlayScrollbar
, ""},
314 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
315 switches::kDisableOverlayScrollbar
, ""}
319 const Experiment::Choice kZeroCopyChoices
[] = {
320 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
321 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
322 switches::kEnableZeroCopy
, ""},
323 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
324 switches::kDisableZeroCopy
, ""}
327 #if defined(OS_ANDROID)
328 const Experiment::Choice kZeroSuggestExperimentsChoices
[] = {
329 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
330 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED
,
331 switches::kEnableZeroSuggestMostVisited
, ""},
332 { IDS_FLAGS_ZERO_SUGGEST_ETHER_SERP
,
333 switches::kEnableZeroSuggestEtherSerp
, ""},
334 { IDS_FLAGS_ZERO_SUGGEST_ETHER_NO_SERP
,
335 switches::kEnableZeroSuggestEtherNoSerp
, ""},
336 { IDS_FLAGS_ZERO_SUGGEST_PERSONALIZED
,
337 switches::kEnableZeroSuggestPersonalized
, ""},
338 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
339 switches::kDisableZeroSuggest
, ""}
343 const Experiment::Choice kNumRasterThreadsChoices
[] = {
344 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
345 { IDS_FLAGS_NUM_RASTER_THREADS_ONE
, switches::kNumRasterThreads
, "1" },
346 { IDS_FLAGS_NUM_RASTER_THREADS_TWO
, switches::kNumRasterThreads
, "2" },
347 { IDS_FLAGS_NUM_RASTER_THREADS_THREE
, switches::kNumRasterThreads
, "3" },
348 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR
, switches::kNumRasterThreads
, "4" }
351 const Experiment::Choice kEnableGpuRasterizationChoices
[] = {
352 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
353 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
354 switches::kEnableGpuRasterization
, "" },
355 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
356 switches::kDisableGpuRasterization
, "" },
357 { IDS_FLAGS_FORCE_GPU_RASTERIZATION
,
358 switches::kForceGpuRasterization
, "" },
361 // We're using independent flags here (as opposed to a common flag with
362 // different values) to be able to enable/disable the entire experience
363 // associated with this feature server-side from the FieldTrial (the complete
364 // experience includes other flag changes as well). It is not currently possible
365 // to do that with "flag=value" flags.
366 const Experiment::Choice kSearchButtonInOmniboxChoices
[] = {
367 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
368 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
369 switches::kDisableSearchButtonInOmnibox
, ""},
370 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR
,
371 switches::kEnableSearchButtonInOmniboxForStr
, ""},
372 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR_OR_IIP
,
373 switches::kEnableSearchButtonInOmniboxForStrOrIip
, ""},
374 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLED
,
375 switches::kEnableSearchButtonInOmniboxAlways
, ""}
378 // See comment above for kSearchButtonInOmniboxChoices. The same reasoning
380 const Experiment::Choice kOriginChipChoices
[] = {
381 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
382 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
, switches::kDisableOriginChip
, ""},
383 { IDS_FLAGS_ORIGIN_CHIP_ALWAYS
, switches::kEnableOriginChipAlways
, ""},
384 { IDS_FLAGS_ORIGIN_CHIP_ON_SRP
, switches::kEnableOriginChipOnSrp
, ""}
387 const Experiment::Choice kTouchScrollingModeChoices
[] = {
388 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
389 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL
,
390 switches::kTouchScrollingMode
,
391 switches::kTouchScrollingModeTouchcancel
},
392 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE
,
393 switches::kTouchScrollingMode
,
394 switches::kTouchScrollingModeAsyncTouchmove
},
395 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE
,
396 switches::kTouchScrollingMode
,
397 switches::kTouchScrollingModeSyncTouchmove
},
400 #if defined(ENABLE_APP_LIST)
401 const Experiment::Choice kEnableSyncAppListChoices
[] = {
402 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
403 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
404 app_list::switches::kEnableSyncAppList
, "" },
405 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
406 app_list::switches::kDisableSyncAppList
, "" },
410 const Experiment::Choice kExtensionContentVerificationChoices
[] = {
411 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
412 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP
,
413 switches::kExtensionContentVerification
,
414 switches::kExtensionContentVerificationBootstrap
},
415 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE
,
416 switches::kExtensionContentVerification
,
417 switches::kExtensionContentVerificationEnforce
},
418 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT
,
419 switches::kExtensionContentVerification
,
420 switches::kExtensionContentVerificationEnforceStrict
},
423 #if defined(OS_ANDROID)
424 const Experiment::Choice kAnswersInSuggestChoices
[] = {
425 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
426 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
427 switches::kEnableAnswersInSuggest
, ""},
428 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
429 switches::kDisableAnswersInSuggest
, ""}
433 // Using independent flags (instead of flag=value flags) to be able to
434 // associate the version with a FieldTrial. FieldTrials don't currently support
436 const Experiment::Choice kSSLInterstitialVersions
[] = {
437 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
438 { IDS_FLAGS_SSL_INTERSTITIAL_VERSION_V1
,
439 switches::kSSLInterstitialV1
, "" },
440 { IDS_FLAGS_SSL_INTERSTITIAL_VERSION_V2_GRAY
,
441 switches::kSSLInterstitialV2
, "" },
442 { IDS_FLAGS_SSL_INTERSTITIAL_VERSION_V2_COLORFUL
,
443 switches::kSSLInterstitialV2Yellow
, "" },
444 { IDS_FLAGS_SSL_INTERSTITIAL_VERSION_GUARD
,
445 switches::kSSLInterstitialV2Guard
, "" },
446 { IDS_FLAGS_SSL_INTERSTITIAL_VERSION_V1_V2
,
447 switches::kSSLInterstitialV1WithV2Text
, "" },
450 // Using independent flags (instead of flag=value flags) to be able to
451 // associate the version with a FieldTrial. FieldTrials don't currently support
453 const Experiment::Choice kMalwareInterstitialVersions
[] = {
454 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
455 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V2
,
456 switches::kMalwareInterstitialV2
, "" },
457 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3
,
458 switches::kMalwareInterstitialV3
, "" },
459 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_ADVICE
,
460 switches::kMalwareInterstitialV3Advice
, "" },
461 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_SOCIAL
,
462 switches::kMalwareInterstitialV3Social
, "" },
463 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_NOTRECOMMEND
,
464 switches::kMalwareInterstitialV3NotRecommend
, "" },
465 { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_HISTORY
,
466 switches::kMalwareInterstitialV3History
, "" },
469 #if defined(OS_CHROMEOS)
470 const Experiment::Choice kEnableFileManagerMTPChoices
[] = {
471 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
472 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
473 chromeos::switches::kEnableFileManagerMTP
, "true" },
474 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
475 chromeos::switches::kEnableFileManagerMTP
, "false" }
478 const Experiment::Choice kEnableFileManagerNewGalleryChoices
[] = {
479 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", ""},
480 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
481 chromeos::switches::kFileManagerEnableNewGallery
, "true"},
482 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
483 chromeos::switches::kFileManagerEnableNewGallery
, "false"}
487 const Experiment::Choice kEnableSettingsWindowChoices
[] = {
488 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
489 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
490 ::switches::kEnableSettingsWindow
, "" },
491 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
492 ::switches::kDisableSettingsWindow
, "" },
495 // RECORDING USER METRICS FOR FLAGS:
496 // -----------------------------------------------------------------------------
497 // The first line of the experiment is the internal name. If you'd like to
498 // gather statistics about the usage of your flag, you should append a marker
499 // comment to the end of the feature name, like so:
500 // "my-special-feature", // FLAGS:RECORD_UMA
502 // After doing that, run
503 // tools/metrics/actions/extract_actions.py
504 // to add the metric to actions.xml (which will enable UMA to record your
505 // feature flag), then update the <owner>s and <description> sections. Make sure
506 // to include the actions.xml file when you upload your code for review!
508 // After your feature has shipped under a flag, you can locate the metrics under
509 // the action name AboutFlags_internal-action-name. Actions are recorded once
510 // per startup, so you should divide this number by AboutFlags_StartupTick to
511 // get a sense of usage. Note that this will not be the same as number of users
512 // with a given feature enabled because users can quit and relaunch the
513 // application multiple times over a given time interval. The dashboard also
514 // shows you how many (metrics reporting) users have enabled the flag over the
515 // last seven days. However, note that this is not the same as the number of
516 // users who have the flag enabled, since enabling the flag happens once,
517 // whereas running with the flag enabled happens until the user flips the flag
520 // To add a new experiment add to the end of kExperiments. There are two
521 // distinct types of experiments:
522 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
523 // macro for this type supplying the command line to the macro.
524 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
525 // deactivated state for this lab (i.e. no command line option). To specify
526 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
528 // See the documentation of Experiment for details on the fields.
530 // When adding a new choice, add it to the end of the list.
531 const Experiment kExperiments
[] = {
533 "ignore-gpu-blacklist",
534 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME
,
535 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION
,
537 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist
)
540 "force-accelerated-composited-scrolling",
541 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME
,
542 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION
,
544 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll
,
545 switches::kDisableAcceleratedOverflowScroll
)
548 "disable_layer_squashing",
549 IDS_FLAGS_DISABLE_LAYER_SQUASHING_NAME
,
550 IDS_FLAGS_DISABLE_LAYER_SQUASHING_DESCRIPTION
,
552 SINGLE_VALUE_TYPE(switches::kDisableLayerSquashing
)
556 "disable-direct-write",
557 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME
,
558 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION
,
560 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite
)
564 "enable-experimental-canvas-features",
565 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME
,
566 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION
,
568 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures
)
571 "disable-accelerated-2d-canvas",
572 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME
,
573 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION
,
575 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas
)
578 "enable-display-list-2d-canvas",
579 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME
,
580 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION
,
582 SINGLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas
)
585 "composited-layer-borders",
586 IDS_FLAGS_COMPOSITED_LAYER_BORDERS
,
587 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION
,
589 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders
)
593 IDS_FLAGS_SHOW_FPS_COUNTER
,
594 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION
,
596 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter
)
600 IDS_FLAGS_DISABLE_WEBGL_NAME
,
601 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION
,
603 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL
)
607 IDS_FLAGS_DISABLE_WEBRTC_NAME
,
608 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION
,
610 #if defined(OS_ANDROID)
611 SINGLE_VALUE_TYPE(switches::kDisableWebRTC
)
613 SINGLE_VALUE_TYPE("")
616 #if defined(ENABLE_WEBRTC)
618 "disable-webrtc-hw-decoding",
619 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME
,
620 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION
,
621 kOsAndroid
| kOsCrOS
,
622 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding
)
625 "disable-webrtc-hw-encoding",
626 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME
,
627 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION
,
628 kOsAndroid
| kOsCrOS
,
629 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding
)
632 #if defined(OS_ANDROID)
635 IDS_FLAGS_DISABLE_WEBAUDIO_NAME
,
636 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION
,
638 SINGLE_VALUE_TYPE(switches::kDisableWebAudio
)
642 "enable-compositing-for-fixed-position",
643 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME
,
644 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION
,
646 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices
)
649 "enable-compositing-for-transition",
650 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME
,
651 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION
,
653 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices
)
656 "enable-accelerated-fixed-root-background",
657 IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_NAME
,
658 IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_DESCRIPTION
,
660 MULTI_VALUE_TYPE(kEnableAcceleratedFixedRootBackgroundChoices
)
662 // Native client is compiled out when DISABLE_NACL is defined.
663 #if !defined(DISABLE_NACL)
665 "enable-nacl", // FLAGS:RECORD_UMA
666 IDS_FLAGS_ENABLE_NACL_NAME
,
667 IDS_FLAGS_ENABLE_NACL_DESCRIPTION
,
669 SINGLE_VALUE_TYPE(switches::kEnableNaCl
)
672 "enable-nacl-debug", // FLAGS:RECORD_UMA
673 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME
,
674 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION
,
676 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug
)
679 "nacl-debug-mask", // FLAGS:RECORD_UMA
680 IDS_FLAGS_NACL_DEBUG_MASK_NAME
,
681 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION
,
683 MULTI_VALUE_TYPE(kNaClDebugMaskChoices
)
687 "extension-apis", // FLAGS:RECORD_UMA
688 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME
,
689 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION
,
691 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis
)
694 "extensions-on-chrome-urls",
695 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME
,
696 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION
,
698 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs
)
701 "enable-fast-unload",
702 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME
,
703 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION
,
705 SINGLE_VALUE_TYPE(switches::kEnableFastUnload
)
708 "enable-app-window-controls",
709 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME
,
710 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION
,
712 SINGLE_VALUE_TYPE(switches::kEnableAppWindowControls
)
715 "disable-hyperlink-auditing",
716 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME
,
717 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION
,
719 SINGLE_VALUE_TYPE(switches::kNoPings
)
721 #if defined(OS_ANDROID)
724 IDS_FLAGS_ENABLE_NEW_NTP
,
725 IDS_FLAGS_ENABLE_NEW_NTP_DESCRIPTION
,
727 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewNTP
,
728 switches::kDisableNewNTP
)
732 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH
,
733 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION
,
735 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch
,
736 switches::kDisableContextualSearch
)
740 "show-autofill-type-predictions",
741 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME
,
742 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION
,
744 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions
)
747 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
748 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME
,
749 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION
,
750 // Can't expose the switch unless the code is compiled in.
751 // On by default for the Mac (different implementation in WebKit).
753 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling
)
755 #if defined(USE_AURA) || defined(OS_LINUX)
757 "overlay-scrollbars",
758 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME
,
759 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION
,
760 // Uses the system preference on Mac (a different implementation).
761 // On Android, this is always enabled.
762 kOsLinux
| kOsCrOS
| kOsWin
,
763 MULTI_VALUE_TYPE(kOverlayScrollbarChoices
)
768 IDS_FLAGS_ENABLE_PANELS_NAME
,
769 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION
,
771 SINGLE_VALUE_TYPE(switches::kEnablePanels
)
774 // See http://crbug.com/120416 for how to remove this flag.
775 "save-page-as-mhtml", // FLAGS:RECORD_UMA
776 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME
,
777 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION
,
778 kOsMac
| kOsWin
| kOsLinux
,
779 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML
)
783 IDS_FLAGS_ENABLE_QUIC_NAME
,
784 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION
,
786 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic
,
787 switches::kDisableQuic
)
791 IDS_FLAGS_ENABLE_SPDY4_NAME
,
792 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION
,
794 SINGLE_VALUE_TYPE(switches::kEnableSpdy4
)
798 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME
,
799 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION
,
800 kOsWin
| kOsMac
| kOsLinux
| kOsCrOS
,
801 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns
,
802 switches::kDisableAsyncDns
)
805 "disable-media-source",
806 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME
,
807 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION
,
809 SINGLE_VALUE_TYPE(switches::kDisableMediaSource
)
812 "enable-encrypted-media",
813 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME
,
814 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION
,
816 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia
)
819 "disable-prefixed-encrypted-media",
820 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME
,
821 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION
,
823 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia
)
825 #if defined(OS_ANDROID)
827 "disable-infobar-for-protected-media-identifier",
828 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME
,
829 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION
,
831 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier
)
834 "mediadrm-enable-non-compositing",
835 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME
,
836 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION
,
838 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing
)
840 #endif // defined(OS_ANDROID)
842 "enable-javascript-harmony",
843 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME
,
844 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION
,
846 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags
, "--harmony")
849 "disable-software-rasterizer",
850 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME
,
851 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION
,
852 #if defined(ENABLE_SWIFTSHADER)
857 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer
)
860 "enable-gpu-rasterization",
861 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME
,
862 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION
,
864 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices
)
867 "enable-experimental-web-platform-features",
868 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME
,
869 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION
,
871 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures
)
874 "disable-ntp-other-sessions-menu",
875 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME
,
876 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION
,
878 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu
)
881 "enable-devtools-experiments",
882 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME
,
883 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION
,
885 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments
)
888 "silent-debugger-extension-api",
889 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME
,
890 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION
,
892 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI
)
895 "spellcheck-autocorrect",
896 IDS_FLAGS_SPELLCHECK_AUTOCORRECT
,
897 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION
,
898 kOsWin
| kOsLinux
| kOsCrOS
,
899 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect
)
902 "enable-scroll-prediction",
903 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME
,
904 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION
,
906 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction
)
910 IDS_TOUCH_EVENTS_NAME
,
911 IDS_TOUCH_EVENTS_DESCRIPTION
,
913 MULTI_VALUE_TYPE(kTouchEventsChoices
)
916 "disable-touch-adjustment",
917 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME
,
918 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION
,
919 kOsWin
| kOsLinux
| kOsCrOS
,
920 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment
)
922 #if defined(OS_CHROMEOS)
924 "network-portal-notification",
925 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME
,
926 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION
,
928 ENABLE_DISABLE_VALUE_TYPE(
929 chromeos::switches::kEnableNetworkPortalNotification
,
930 chromeos::switches::kDisableNetworkPortalNotification
)
934 "enable-download-resumption",
935 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME
,
936 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION
,
938 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption
)
940 // Native client is compiled out when DISABLE_NACL is defined.
941 #if !defined(DISABLE_NACL)
943 "allow-nacl-socket-api",
944 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME
,
945 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION
,
947 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI
, "*")
950 #if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_LINUX)
952 "force-device-scale-factor",
953 IDS_FLAGS_FORCE_DEVICE_SCALE_FACTOR_NAME
,
954 IDS_FLAGS_FORCE_DEVICE_SCALE_FACTOR_DESCRIPTION
,
955 kOsLinux
| kOsWin
| kOsCrOS
,
956 MULTI_VALUE_TYPE(kDeviceScaleFactorChoices
)
959 #if defined(OS_CHROMEOS)
961 "allow-touchpad-three-finger-click",
962 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME
,
963 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION
,
965 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick
)
970 "disable-minimize-on-second-launcher-item-click",
971 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME
,
972 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION
,
974 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick
)
978 IDS_FLAGS_SHOW_TOUCH_HUD_NAME
,
979 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION
,
981 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud
)
985 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME
,
986 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION
,
987 kOsLinux
| kOsWin
| kOsCrOS
,
988 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch
, switches::kDisablePinch
),
990 #endif // defined(USE_ASH)
992 "enable-pinch-virtual-viewport",
993 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME
,
994 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION
,
995 kOsLinux
| kOsWin
| kOsCrOS
| kOsAndroid
,
996 ENABLE_DISABLE_VALUE_TYPE(
997 cc::switches::kEnablePinchVirtualViewport
,
998 cc::switches::kDisablePinchVirtualViewport
),
1001 "enable-viewport-meta",
1002 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME
,
1003 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION
,
1004 kOsLinux
| kOsWin
| kOsCrOS
| kOsMac
,
1005 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta
),
1007 #if defined(OS_CHROMEOS)
1009 "disable-boot-animation",
1010 IDS_FLAGS_DISABLE_BOOT_ANIMATION
,
1011 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION
,
1013 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation
),
1016 "enable-new-gallery",
1017 IDS_FLAGS_FILE_MANAGER_ENABLE_NEW_GALLERY_NAME
,
1018 IDS_FLAGS_FILE_MANAGER_ENABLE_NEW_GALLERY_DESCRIPTION
,
1020 MULTI_VALUE_TYPE(kEnableFileManagerNewGalleryChoices
)
1023 "enable-video-player-chromecast-support",
1024 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME
,
1025 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION
,
1027 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport
)
1030 "disable-office-editing-component-app",
1031 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME
,
1032 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION
,
1034 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp
),
1037 "disable-display-color-calibration",
1038 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME
,
1039 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION
,
1041 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration
),
1043 #endif // defined(OS_CHROMEOS)
1044 { "disable-accelerated-video-decode",
1045 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME
,
1046 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION
,
1048 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode
),
1050 #if defined(USE_ASH)
1052 "ash-debug-shortcuts",
1053 IDS_FLAGS_DEBUG_SHORTCUTS_NAME
,
1054 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION
,
1056 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts
),
1058 { "ash-enable-touch-view-testing",
1059 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME
,
1060 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION
,
1062 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting
),
1064 { "ash-disable-text-filtering-in-overview-mode",
1065 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_NAME
,
1066 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_DESCRIPTION
,
1068 SINGLE_VALUE_TYPE(ash::switches::kAshDisableTextFilteringInOverviewMode
),
1071 #if defined(OS_CHROMEOS)
1073 "enable-carrier-switching",
1074 IDS_FLAGS_ENABLE_CARRIER_SWITCHING
,
1075 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION
,
1077 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching
)
1080 "enable-request-tablet-site",
1081 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME
,
1082 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION
,
1084 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite
)
1088 "debug-packed-apps",
1089 IDS_FLAGS_DEBUG_PACKED_APP_NAME
,
1090 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION
,
1092 SINGLE_VALUE_TYPE(switches::kDebugPackedApps
)
1095 "enable-password-generation",
1096 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME
,
1097 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION
,
1098 kOsWin
| kOsLinux
| kOsCrOS
,
1099 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration
,
1100 autofill::switches::kDisablePasswordGeneration
)
1103 "enable-automatic-password-saving",
1104 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME
,
1105 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION
,
1108 password_manager::switches::kEnableAutomaticPasswordSaving
)
1111 "password-manager-reauthentication",
1112 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME
,
1113 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION
,
1115 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication
)
1118 "enable-deferred-image-decoding",
1119 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME
,
1120 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION
,
1121 kOsMac
| kOsLinux
| kOsCrOS
,
1122 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding
)
1125 "performance-monitor-gathering",
1126 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME
,
1127 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION
,
1129 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering
)
1132 "wallet-service-use-sandbox",
1133 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME
,
1134 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION
,
1135 kOsAndroid
| kOsDesktop
,
1136 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1137 autofill::switches::kWalletServiceUseSandbox
, "1",
1138 autofill::switches::kWalletServiceUseSandbox
, "0")
1140 #if defined(USE_AURA)
1142 "overscroll-history-navigation",
1143 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME
,
1144 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION
,
1146 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices
)
1150 "scroll-end-effect",
1151 IDS_FLAGS_SCROLL_END_EFFECT_NAME
,
1152 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION
,
1154 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1155 switches::kScrollEndEffect
, "1",
1156 switches::kScrollEndEffect
, "0")
1159 "enable-touch-drag-drop",
1160 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME
,
1161 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION
,
1163 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop
,
1164 switches::kDisableTouchDragDrop
)
1167 "enable-touch-editing",
1168 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME
,
1169 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION
,
1170 kOsCrOS
| kOsWin
| kOsLinux
,
1171 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing
,
1172 switches::kDisableTouchEditing
)
1175 "enable-suggestions-service",
1176 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME
,
1177 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION
,
1178 kOsAndroid
| kOsCrOS
,
1179 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService
,
1180 switches::kDisableSuggestionsService
)
1183 "enable-sync-synced-notifications",
1184 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME
,
1185 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION
,
1187 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications
,
1188 switches::kDisableSyncSyncedNotifications
)
1190 #if defined(ENABLE_APP_LIST)
1192 "enable-sync-app-list",
1193 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME
,
1194 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION
,
1196 MULTI_VALUE_TYPE(kEnableSyncAppListChoices
)
1199 #if defined(OS_MACOSX)
1201 "enable-avfoundation",
1202 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME
,
1203 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION
,
1205 SINGLE_VALUE_TYPE(switches::kEnableAVFoundation
)
1209 "impl-side-painting",
1210 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME
,
1211 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION
,
1213 MULTI_VALUE_TYPE(kImplSidePaintingChoices
)
1217 IDS_FLAGS_LCD_TEXT_NAME
,
1218 IDS_FLAGS_LCD_TEXT_DESCRIPTION
,
1220 MULTI_VALUE_TYPE(kLCDTextChoices
)
1222 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1224 "delegated-renderer",
1225 IDS_FLAGS_DELEGATED_RENDERER_NAME
,
1226 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION
,
1227 kOsAndroid
, // TODO(ccameron) Add mac support soon.
1228 MULTI_VALUE_TYPE(kDelegatedRendererChoices
)
1232 "max-tiles-for-interest-area",
1233 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME
,
1234 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION
,
1236 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices
)
1239 "enable-offline-auto-reload",
1240 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME
,
1241 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION
,
1243 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload
,
1244 switches::kDisableOfflineAutoReload
)
1247 "enable-offline-auto-reload-visible-only",
1248 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME
,
1249 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION
,
1251 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly
,
1252 switches::kDisableOfflineAutoReloadVisibleOnly
)
1255 "enable-offline-load-stale-cache",
1256 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME
,
1257 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION
,
1258 kOsLinux
| kOsMac
| kOsWin
| kOsAndroid
,
1259 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache
,
1260 switches::kDisableOfflineLoadStaleCache
)
1263 "default-tile-width",
1264 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME
,
1265 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION
,
1267 MULTI_VALUE_TYPE(kDefaultTileWidthChoices
)
1270 "default-tile-height",
1271 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME
,
1272 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION
,
1274 MULTI_VALUE_TYPE(kDefaultTileHeightChoices
)
1276 #if defined(OS_ANDROID)
1278 "disable-gesture-requirement-for-media-playback",
1279 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME
,
1280 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION
,
1282 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback
)
1285 #if defined(OS_CHROMEOS)
1287 "enable-virtual-keyboard",
1288 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME
,
1289 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION
,
1291 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard
)
1294 "enable-virtual-keyboard-overscroll",
1295 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME
,
1296 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION
,
1298 ENABLE_DISABLE_VALUE_TYPE(
1299 keyboard::switches::kEnableVirtualKeyboardOverscroll
,
1300 keyboard::switches::kDisableVirtualKeyboardOverscroll
)
1303 "enable-swipe-selection",
1304 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME
,
1305 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION
,
1307 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection
)
1310 "enable-input-view",
1311 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME
,
1312 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION
,
1314 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView
,
1315 keyboard::switches::kDisableInputView
)
1318 "enable-experimental-input-view-features",
1319 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME
,
1320 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION
,
1322 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures
)
1326 "enable-simple-cache-backend",
1327 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME
,
1328 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION
,
1329 kOsWin
| kOsMac
| kOsLinux
| kOsCrOS
,
1330 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices
)
1333 "enable-tcp-fast-open",
1334 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME
,
1335 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION
,
1336 kOsLinux
| kOsCrOS
| kOsAndroid
,
1337 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen
)
1339 #if defined(ENABLE_SERVICE_DISCOVERY)
1341 "disable-device-discovery",
1342 IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NAME
,
1343 IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_DESCRIPTION
,
1345 SINGLE_VALUE_TYPE(switches::kDisableDeviceDiscovery
)
1348 "device-discovery-notifications",
1349 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME
,
1350 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION
,
1352 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications
,
1353 switches::kDisableDeviceDiscoveryNotifications
)
1356 "enable-cloud-devices",
1357 IDS_FLAGS_ENABLE_CLOUD_DEVICES_NAME
,
1358 IDS_FLAGS_ENABLE_CLOUD_DEVICES_DESCRIPTION
,
1360 SINGLE_VALUE_TYPE(switches::kEnableCloudDevices
)
1363 "enable-print-preview-register-promos",
1364 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME
,
1365 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION
,
1367 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos
)
1369 #endif // ENABLE_SERVICE_DISCOVERY
1372 "enable-cloud-print-xps",
1373 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME
,
1374 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION
,
1376 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps
)
1379 #if defined(OS_MACOSX)
1381 "enable-simplified-fullscreen",
1382 IDS_FLAGS_ENABLE_SIMPLIFIED_FULLSCREEN_NAME
,
1383 IDS_FLAGS_ENABLE_SIMPLIFIED_FULLSCREEN_DESCRIPTION
,
1385 SINGLE_VALUE_TYPE(switches::kEnableSimplifiedFullscreen
)
1388 #if defined(USE_AURA)
1390 "tab-capture-upscale-quality",
1391 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME
,
1392 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION
,
1394 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices
)
1397 "tab-capture-downscale-quality",
1398 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME
,
1399 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION
,
1401 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices
)
1405 "enable-spelling-feedback-field-trial",
1406 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME
,
1407 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION
,
1409 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial
)
1412 "enable-webgl-draft-extensions",
1413 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME
,
1414 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION
,
1416 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions
)
1420 IDS_FLAGS_ENABLE_WEB_MIDI_NAME
,
1421 IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION
,
1422 kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
,
1423 SINGLE_VALUE_TYPE(switches::kEnableWebMIDI
)
1426 "enable-new-profile-management",
1427 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME
,
1428 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION
,
1429 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1430 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement
,
1431 switches::kDisableNewProfileManagement
)
1434 "enable-account-consistency",
1435 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME
,
1436 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION
,
1437 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1438 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency
,
1439 switches::kDisableAccountConsistency
)
1442 "enable-fast-user-switching",
1443 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME
,
1444 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION
,
1445 kOsMac
| kOsWin
| kOsLinux
,
1446 SINGLE_VALUE_TYPE(switches::kFastUserSwitching
)
1449 "enable-new-avatar-menu",
1450 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME
,
1451 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION
,
1452 kOsMac
| kOsWin
| kOsLinux
,
1453 SINGLE_VALUE_TYPE(switches::kNewAvatarMenu
)
1456 "enable-web-based-signin",
1457 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_NAME
,
1458 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_DESCRIPTION
,
1459 kOsMac
| kOsWin
| kOsLinux
,
1460 SINGLE_VALUE_TYPE(switches::kEnableWebBasedSignin
)
1463 "enable-google-profile-info",
1464 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME
,
1465 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION
,
1466 kOsMac
| kOsWin
| kOsLinux
,
1467 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo
)
1470 "reset-app-list-install-state",
1471 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME
,
1472 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION
,
1473 kOsMac
| kOsWin
| kOsLinux
,
1474 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState
)
1476 #if defined(ENABLE_APP_LIST)
1477 #if defined(OS_LINUX)
1479 // This is compiled out on non-Linux platforms because otherwise it would be
1480 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1481 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1483 IDS_FLAGS_ENABLE_APP_LIST_NAME
,
1484 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION
,
1486 SINGLE_VALUE_TYPE(switches::kEnableAppList
)
1491 IDS_FLAGS_ENABLE_APP_VIEW_NAME
,
1492 IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION
,
1494 SINGLE_VALUE_TYPE(switches::kEnableAppView
)
1497 "disable-app-list-app-info",
1498 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST
,
1499 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST_DESCRIPTION
,
1500 kOsLinux
| kOsWin
| kOsCrOS
,
1501 SINGLE_VALUE_TYPE(app_list::switches::kDisableAppInfo
)
1504 "enable-drive-apps-in-app-list",
1505 IDS_FLAGS_ENABLE_DRIVE_APPS_IN_APP_LIST_NAME
,
1506 IDS_FLAGS_ENABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION
,
1508 SINGLE_VALUE_TYPE(app_list::switches::kEnableDriveAppsInAppList
)
1511 #if defined(OS_ANDROID)
1513 "enable-accessibility-tab-switcher",
1514 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME
,
1515 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION
,
1517 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher
)
1520 // TODO(dmazzoni): remove this flag when native android accessibility
1521 // ships in the stable channel. http://crbug.com/356775
1522 "enable-accessibility-script-injection",
1523 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME
,
1524 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION
,
1526 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1527 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1532 IDS_FLAGS_ONE_COPY_NAME
,
1533 IDS_FLAGS_ONE_COPY_DESCRIPTION
,
1535 SINGLE_VALUE_TYPE(switches::kEnableOneCopy
)
1539 IDS_FLAGS_ZERO_COPY_NAME
,
1540 IDS_FLAGS_ZERO_COPY_DESCRIPTION
,
1542 MULTI_VALUE_TYPE(kZeroCopyChoices
)
1544 #if defined(OS_CHROMEOS)
1546 "enable-first-run-ui-transitions",
1547 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME
,
1548 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION
,
1550 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions
)
1554 "enable-streamlined-hosted-apps",
1555 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME
,
1556 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION
,
1557 kOsWin
| kOsCrOS
| kOsLinux
,
1558 SINGLE_VALUE_TYPE(switches::kEnableStreamlinedHostedApps
)
1561 "enable-prominent-url-app-flow",
1562 IDS_FLAGS_ENABLE_PROMINENT_URL_APP_FLOW_NAME
,
1563 IDS_FLAGS_ENABLE_PROMINENT_URL_APP_FLOW_DESCRIPTION
,
1564 kOsWin
| kOsCrOS
| kOsLinux
,
1565 SINGLE_VALUE_TYPE(switches::kEnableProminentURLAppFlow
)
1568 "enable-ephemeral-apps",
1569 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_NAME
,
1570 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_DESCRIPTION
,
1572 SINGLE_VALUE_TYPE(switches::kEnableEphemeralApps
)
1575 "enable-linkable-ephemeral-apps",
1576 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME
,
1577 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION
,
1579 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps
)
1582 "enable-service-worker-sync",
1583 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME
,
1584 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION
,
1586 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync
)
1588 #if defined(OS_ANDROID)
1590 "disable-click-delay",
1591 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME
,
1592 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION
,
1594 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1595 SINGLE_VALUE_TYPE("disable-click-delay")
1598 #if defined(OS_MACOSX)
1600 "enable-translate-new-ux",
1601 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME
,
1602 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION
,
1604 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX
)
1607 #if defined(TOOLKIT_VIEWS)
1609 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1610 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME
,
1611 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION
,
1612 kOsCrOS
| kOsWin
| kOsLinux
,
1613 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting
)
1617 "enable-apps-show-on-first-paint",
1618 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME
,
1619 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION
,
1621 SINGLE_VALUE_TYPE(switches::kEnableAppsShowOnFirstPaint
)
1624 "enhanced-bookmarks-experiment",
1625 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1626 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1628 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1629 switches::kEnhancedBookmarksExperiment
, "1",
1630 switches::kEnhancedBookmarksExperiment
, "0")
1633 "manual-enhanced-bookmarks",
1634 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1635 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1637 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks
)
1640 "manual-enhanced-bookmarks-optout",
1641 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1642 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1644 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout
)
1646 #if defined(OS_ANDROID)
1648 "enable-zero-suggest-experiment",
1649 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME
,
1650 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION
,
1652 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices
)
1656 "num-raster-threads",
1657 IDS_FLAGS_NUM_RASTER_THREADS_NAME
,
1658 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION
,
1660 MULTI_VALUE_TYPE(kNumRasterThreadsChoices
)
1663 "origin-chip-in-omnibox",
1664 IDS_FLAGS_ORIGIN_CHIP_NAME
,
1665 IDS_FLAGS_ORIGIN_CHIP_DESCRIPTION
,
1666 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
,
1667 MULTI_VALUE_TYPE(kOriginChipChoices
)
1670 "search-button-in-omnibox",
1671 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_NAME
,
1672 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_DESCRIPTION
,
1673 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
,
1674 MULTI_VALUE_TYPE(kSearchButtonInOmniboxChoices
)
1677 "disable-ignore-autocomplete-off",
1678 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_NAME
,
1679 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_DESCRIPTION
,
1681 SINGLE_VALUE_TYPE(autofill::switches::kDisableIgnoreAutocompleteOff
)
1684 "enable-permissions-bubbles",
1685 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME
,
1686 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION
,
1687 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
,
1688 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles
,
1689 switches::kDisablePermissionsBubbles
)
1692 "enable-session-crashed-bubble",
1693 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME
,
1694 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION
,
1696 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble
,
1697 switches::kDisableSessionCrashedBubble
)
1700 "out-of-process-pdf",
1701 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME
,
1702 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION
,
1704 SINGLE_VALUE_TYPE(switches::kOutOfProcessPdf
)
1706 #if defined(OS_ANDROID)
1708 "enable-fast-text-autosizing",
1709 IDS_FLAGS_ENABLE_FAST_TEXT_AUTOSIZING_NAME
,
1710 IDS_FLAGS_ENABLE_FAST_TEXT_AUTOSIZING_DESCRIPTION
,
1712 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableFastTextAutosizing
,
1713 switches::kDisableFastTextAutosizing
)
1717 IDS_FLAGS_DISABLE_CAST_NAME
,
1718 IDS_FLAGS_DISABLE_CAST_DESCRIPTION
,
1720 SINGLE_VALUE_TYPE(switches::kDisableCast
)
1723 "prefetch-search-results",
1724 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME
,
1725 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION
,
1727 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults
)
1730 #if defined(ENABLE_APP_LIST)
1732 "enable-experimental-app-list",
1733 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME
,
1734 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION
,
1735 kOsWin
| kOsLinux
| kOsCrOS
,
1736 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList
)
1739 "enable-centered-app-list",
1740 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME
,
1741 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION
,
1742 kOsWin
| kOsLinux
| kOsCrOS
,
1743 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList
)
1747 "touch-scrolling-mode",
1748 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME
,
1749 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION
,
1750 kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
,
1751 MULTI_VALUE_TYPE(kTouchScrollingModeChoices
)
1754 "bleeding-edge-renderer-mode",
1755 IDS_FLAGS_BLEEDING_RENDERER_NAME
,
1756 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION
,
1758 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths
)
1761 "enable-settings-window",
1762 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME
,
1763 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION
,
1765 MULTI_VALUE_TYPE(kEnableSettingsWindowChoices
)
1767 #if defined(OS_ANDROID)
1769 "enable-instant-search-clicks",
1770 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME
,
1771 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION
,
1773 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks
)
1777 "enable-save-password-bubble",
1778 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME
,
1779 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION
,
1780 kOsWin
| kOsLinux
| kOsCrOS
,
1781 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble
,
1782 switches::kDisableSavePasswordBubble
)
1784 #if defined(GOOGLE_CHROME_BUILD)
1786 "enable-easy-unlock",
1787 IDS_FLAGS_ENABLE_EASY_UNLOCK_NAME
,
1788 IDS_FLAGS_ENABLE_EASY_UNLOCK_DESCRIPTION
,
1790 SINGLE_VALUE_TYPE(switches::kEnableEasyUnlock
)
1793 #if defined(OS_CHROMEOS)
1795 "enable-filemanager-mtp",
1796 IDS_FLAGS_ENABLE_FILE_MANAGER_MTP_NAME
,
1797 IDS_FLAGS_ENABLE_FILE_MANAGER_MTP_DESCRIPTION
,
1799 MULTI_VALUE_TYPE(kEnableFileManagerMTPChoices
)
1802 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1803 // crbug.com/366483 for the target milestone.
1805 "allow-insecure-websocket-from-https-origin",
1806 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME
,
1807 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION
,
1809 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin
)
1812 "enable-apps-file-associations",
1813 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME
,
1814 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION
,
1816 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations
)
1818 #if defined(OS_ANDROID)
1820 "enable-embeddedsearch-api",
1821 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME
,
1822 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION
,
1824 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI
)
1827 "enable-app-install-alerts",
1828 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME
,
1829 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION
,
1831 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts
)
1835 "distance-field-text",
1836 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME
,
1837 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION
,
1839 MULTI_VALUE_TYPE(kDistanceFieldTextChoices
)
1842 "extension-content-verification",
1843 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME
,
1844 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION
,
1846 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices
)
1848 #if defined(USE_AURA)
1850 "text-input-focus-manager",
1851 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME
,
1852 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION
,
1853 kOsCrOS
| kOsLinux
| kOsWin
,
1854 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager
,
1855 switches::kDisableTextInputFocusManager
)
1859 "extension-active-script-permission",
1860 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME
,
1861 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION
,
1863 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction
)
1866 "harfbuzz-rendertext",
1867 IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME
,
1868 IDS_FLAGS_HARFBUZZ_RENDERTEXT_DESCRIPTION
,
1870 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText
,
1871 switches::kDisableHarfBuzzRenderText
)
1873 #if defined(OS_ANDROID)
1875 "answers-in-suggest",
1876 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME
,
1877 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION
,
1879 MULTI_VALUE_TYPE(kAnswersInSuggestChoices
)
1883 "ssl-interstitial-version",
1884 IDS_FLAGS_SSL_INTERSTITIAL_TRIAL_NAME
,
1885 IDS_FLAGS_SSL_INTERSTITIAL_TRIAL_DESCRIPTION
,
1887 MULTI_VALUE_TYPE(kSSLInterstitialVersions
)
1890 "malware-interstitial-version",
1891 IDS_FLAGS_MALWARE_INTERSTITIAL_TRIAL_NAME
,
1892 IDS_FLAGS_MALWARE_INTERSTITIAL_TRIAL_DESCRIPTION
,
1894 MULTI_VALUE_TYPE(kMalwareInterstitialVersions
)
1896 #if defined(OS_ANDROID)
1898 "enable-data-reduction-proxy-dev",
1899 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME
,
1900 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION
,
1902 ENABLE_DISABLE_VALUE_TYPE(
1903 data_reduction_proxy::switches::kEnableDataReductionProxyDev
,
1904 data_reduction_proxy::switches::kDisableDataReductionProxyDev
)
1907 #if defined(OS_CHROMEOS)
1909 "enable-ok-google-voice-search",
1910 IDS_FLAGS_OK_GOOGLE_NAME
,
1911 IDS_FLAGS_OK_GOOGLE_DESCRIPTION
,
1913 SINGLE_VALUE_TYPE(chromeos::switches::kEnableOkGoogleVoiceSearch
)
1917 "enable-embedded-extension-options",
1918 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME
,
1919 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION
,
1921 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions
)
1924 "enable-website-settings-manager",
1925 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME
,
1926 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION
,
1928 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager
)
1932 const Experiment
* experiments
= kExperiments
;
1933 size_t num_experiments
= arraysize(kExperiments
);
1935 // Stores and encapsulates the little state that about:flags has.
1938 FlagsState() : needs_restart_(false) {}
1939 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
1940 CommandLine
* command_line
,
1941 SentinelsMode sentinels
);
1942 bool IsRestartNeededToCommitChanges();
1943 void SetExperimentEnabled(
1944 FlagsStorage
* flags_storage
,
1945 const std::string
& internal_name
,
1947 void RemoveFlagsSwitches(
1948 std::map
<std::string
, CommandLine::StringType
>* switch_list
);
1949 void ResetAllFlags(FlagsStorage
* flags_storage
);
1952 // Returns the singleton instance of this class
1953 static FlagsState
* GetInstance() {
1954 return Singleton
<FlagsState
>::get();
1958 bool needs_restart_
;
1959 std::map
<std::string
, std::string
> flags_switches_
;
1961 DISALLOW_COPY_AND_ASSIGN(FlagsState
);
1964 // Adds the internal names for the specified experiment to |names|.
1965 void AddInternalName(const Experiment
& e
, std::set
<std::string
>* names
) {
1966 if (e
.type
== Experiment::SINGLE_VALUE
) {
1967 names
->insert(e
.internal_name
);
1969 DCHECK(e
.type
== Experiment::MULTI_VALUE
||
1970 e
.type
== Experiment::ENABLE_DISABLE_VALUE
);
1971 for (int i
= 0; i
< e
.num_choices
; ++i
)
1972 names
->insert(e
.NameForChoice(i
));
1976 // Confirms that an experiment is valid, used in a DCHECK in
1977 // SanitizeList below.
1978 bool ValidateExperiment(const Experiment
& e
) {
1980 case Experiment::SINGLE_VALUE
:
1981 DCHECK_EQ(0, e
.num_choices
);
1984 case Experiment::MULTI_VALUE
:
1985 DCHECK_GT(e
.num_choices
, 0);
1987 DCHECK(e
.choices
[0].command_line_switch
);
1988 DCHECK_EQ('\0', e
.choices
[0].command_line_switch
[0]);
1990 case Experiment::ENABLE_DISABLE_VALUE
:
1991 DCHECK_EQ(3, e
.num_choices
);
1993 DCHECK(e
.command_line_switch
);
1994 DCHECK(e
.command_line_value
);
1995 DCHECK(e
.disable_command_line_switch
);
1996 DCHECK(e
.disable_command_line_value
);
2004 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2005 // unknown, to prevent this list to become very long as experiments are added
2007 void SanitizeList(FlagsStorage
* flags_storage
) {
2008 std::set
<std::string
> known_experiments
;
2009 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2010 DCHECK(ValidateExperiment(experiments
[i
]));
2011 AddInternalName(experiments
[i
], &known_experiments
);
2014 std::set
<std::string
> enabled_experiments
= flags_storage
->GetFlags();
2016 std::set
<std::string
> new_enabled_experiments
=
2017 base::STLSetIntersection
<std::set
<std::string
> >(
2018 known_experiments
, enabled_experiments
);
2020 if (new_enabled_experiments
!= enabled_experiments
)
2021 flags_storage
->SetFlags(new_enabled_experiments
);
2024 void GetSanitizedEnabledFlags(
2025 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
2026 SanitizeList(flags_storage
);
2027 *result
= flags_storage
->GetFlags();
2030 bool SkipConditionalExperiment(const Experiment
& experiment
) {
2031 if (experiment
.internal_name
==
2032 std::string("enhanced-bookmarks-experiment")) {
2033 CommandLine
* command_line
= CommandLine::ForCurrentProcess();
2034 // Dont't skip experiment if it has non default value.
2035 // It means user selected it.
2036 if (command_line
->HasSwitch(switches::kEnhancedBookmarksExperiment
))
2039 return !IsEnhancedBookmarksExperimentEnabled();
2041 if ((experiment
.internal_name
== std::string("manual-enhanced-bookmarks")) ||
2042 (experiment
.internal_name
==
2043 std::string("manual-enhanced-bookmarks-optout"))) {
2047 #if defined(OS_ANDROID)
2048 // enable-data-reduction-proxy-dev is only available for the Dev channel.
2049 if (!strcmp("enable-data-reduction-proxy-dev", experiment
.internal_name
) &&
2050 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV
) {
2059 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2060 // enabled on the current platform.
2061 void GetSanitizedEnabledFlagsForCurrentPlatform(
2062 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
2063 GetSanitizedEnabledFlags(flags_storage
, result
);
2065 // Filter out any experiments that aren't enabled on the current platform. We
2066 // don't remove these from prefs else syncing to a platform with a different
2067 // set of experiments would be lossy.
2068 std::set
<std::string
> platform_experiments
;
2069 int current_platform
= GetCurrentPlatform();
2070 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2071 if (experiments
[i
].supported_platforms
& current_platform
)
2072 AddInternalName(experiments
[i
], &platform_experiments
);
2073 #if defined(OS_CHROMEOS)
2074 if (experiments
[i
].supported_platforms
& kOsCrOSOwnerOnly
)
2075 AddInternalName(experiments
[i
], &platform_experiments
);
2079 std::set
<std::string
> new_enabled_experiments
=
2080 base::STLSetIntersection
<std::set
<std::string
> >(
2081 platform_experiments
, *result
);
2083 result
->swap(new_enabled_experiments
);
2086 // Returns the Value representing the choice data in the specified experiment.
2087 base::Value
* CreateChoiceData(
2088 const Experiment
& experiment
,
2089 const std::set
<std::string
>& enabled_experiments
) {
2090 DCHECK(experiment
.type
== Experiment::MULTI_VALUE
||
2091 experiment
.type
== Experiment::ENABLE_DISABLE_VALUE
);
2092 base::ListValue
* result
= new base::ListValue
;
2093 for (int i
= 0; i
< experiment
.num_choices
; ++i
) {
2094 base::DictionaryValue
* value
= new base::DictionaryValue
;
2095 const std::string name
= experiment
.NameForChoice(i
);
2096 value
->SetString("internal_name", name
);
2097 value
->SetString("description", experiment
.DescriptionForChoice(i
));
2098 value
->SetBoolean("selected", enabled_experiments
.count(name
) > 0);
2099 result
->Append(value
);
2106 std::string
Experiment::NameForChoice(int index
) const {
2107 DCHECK(type
== Experiment::MULTI_VALUE
||
2108 type
== Experiment::ENABLE_DISABLE_VALUE
);
2109 DCHECK_LT(index
, num_choices
);
2110 return std::string(internal_name
) + testing::kMultiSeparator
+
2111 base::IntToString(index
);
2114 base::string16
Experiment::DescriptionForChoice(int index
) const {
2115 DCHECK(type
== Experiment::MULTI_VALUE
||
2116 type
== Experiment::ENABLE_DISABLE_VALUE
);
2117 DCHECK_LT(index
, num_choices
);
2119 if (type
== Experiment::ENABLE_DISABLE_VALUE
) {
2120 const int kEnableDisableDescriptionIds
[] = {
2121 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
,
2122 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
2123 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
2125 description_id
= kEnableDisableDescriptionIds
[index
];
2127 description_id
= choices
[index
].description_id
;
2129 return l10n_util::GetStringUTF16(description_id
);
2132 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2133 CommandLine
* command_line
,
2134 SentinelsMode sentinels
) {
2135 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage
,
2140 bool AreSwitchesIdenticalToCurrentCommandLine(
2141 const CommandLine
& new_cmdline
, const CommandLine
& active_cmdline
) {
2142 std::set
<CommandLine::StringType
> new_flags
=
2143 ExtractFlagsFromCommandLine(new_cmdline
);
2144 std::set
<CommandLine::StringType
> active_flags
=
2145 ExtractFlagsFromCommandLine(active_cmdline
);
2147 // Needed because std::equal doesn't check if the 2nd set is empty.
2148 if (new_flags
.size() != active_flags
.size())
2151 return std::equal(new_flags
.begin(), new_flags
.end(), active_flags
.begin());
2154 void GetFlagsExperimentsData(FlagsStorage
* flags_storage
,
2156 base::ListValue
* supported_experiments
,
2157 base::ListValue
* unsupported_experiments
) {
2158 std::set
<std::string
> enabled_experiments
;
2159 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2161 int current_platform
= GetCurrentPlatform();
2163 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2164 const Experiment
& experiment
= experiments
[i
];
2165 if (SkipConditionalExperiment(experiment
))
2168 base::DictionaryValue
* data
= new base::DictionaryValue();
2169 data
->SetString("internal_name", experiment
.internal_name
);
2170 data
->SetString("name",
2171 l10n_util::GetStringUTF16(experiment
.visible_name_id
));
2172 data
->SetString("description",
2173 l10n_util::GetStringUTF16(
2174 experiment
.visible_description_id
));
2176 base::ListValue
* supported_platforms
= new base::ListValue();
2177 AddOsStrings(experiment
.supported_platforms
, supported_platforms
);
2178 data
->Set("supported_platforms", supported_platforms
);
2180 switch (experiment
.type
) {
2181 case Experiment::SINGLE_VALUE
:
2184 enabled_experiments
.count(experiment
.internal_name
) > 0);
2186 case Experiment::MULTI_VALUE
:
2187 case Experiment::ENABLE_DISABLE_VALUE
:
2188 data
->Set("choices", CreateChoiceData(experiment
, enabled_experiments
));
2194 bool supported
= (experiment
.supported_platforms
& current_platform
) != 0;
2195 #if defined(OS_CHROMEOS)
2196 if (access
== kOwnerAccessToFlags
&&
2197 (experiment
.supported_platforms
& kOsCrOSOwnerOnly
) != 0) {
2202 supported_experiments
->Append(data
);
2204 unsupported_experiments
->Append(data
);
2208 bool IsRestartNeededToCommitChanges() {
2209 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2212 void SetExperimentEnabled(FlagsStorage
* flags_storage
,
2213 const std::string
& internal_name
,
2215 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage
,
2216 internal_name
, enable
);
2219 void RemoveFlagsSwitches(
2220 std::map
<std::string
, CommandLine::StringType
>* switch_list
) {
2221 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list
);
2224 void ResetAllFlags(FlagsStorage
* flags_storage
) {
2225 FlagsState::GetInstance()->ResetAllFlags(flags_storage
);
2228 int GetCurrentPlatform() {
2229 #if defined(OS_MACOSX)
2231 #elif defined(OS_WIN)
2233 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2235 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2237 #elif defined(OS_ANDROID)
2240 #error Unknown platform
2244 void RecordUMAStatistics(FlagsStorage
* flags_storage
) {
2245 std::set
<std::string
> flags
= flags_storage
->GetFlags();
2246 for (std::set
<std::string
>::iterator it
= flags
.begin(); it
!= flags
.end();
2248 std::string
action("AboutFlags_");
2250 content::RecordComputedAction(action
);
2252 // Since flag metrics are recorded every startup, add a tick so that the
2253 // stats can be made meaningful.
2255 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
2256 content::RecordAction(UserMetricsAction("StartupTick"));
2259 //////////////////////////////////////////////////////////////////////////////
2260 // FlagsState implementation.
2264 typedef std::map
<std::string
, std::pair
<std::string
, std::string
> >
2265 NameToSwitchAndValueMap
;
2267 void SetFlagToSwitchMapping(const std::string
& key
,
2268 const std::string
& switch_name
,
2269 const std::string
& switch_value
,
2270 NameToSwitchAndValueMap
* name_to_switch_map
) {
2271 DCHECK(name_to_switch_map
->end() == name_to_switch_map
->find(key
));
2272 (*name_to_switch_map
)[key
] = std::make_pair(switch_name
, switch_value
);
2275 void FlagsState::ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2276 CommandLine
* command_line
,
2277 SentinelsMode sentinels
) {
2278 if (command_line
->HasSwitch(switches::kNoExperiments
))
2281 std::set
<std::string
> enabled_experiments
;
2283 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage
,
2284 &enabled_experiments
);
2286 NameToSwitchAndValueMap name_to_switch_map
;
2287 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2288 const Experiment
& e
= experiments
[i
];
2289 if (e
.type
== Experiment::SINGLE_VALUE
) {
2290 SetFlagToSwitchMapping(e
.internal_name
, e
.command_line_switch
,
2291 e
.command_line_value
, &name_to_switch_map
);
2292 } else if (e
.type
== Experiment::MULTI_VALUE
) {
2293 for (int j
= 0; j
< e
.num_choices
; ++j
) {
2294 SetFlagToSwitchMapping(e
.NameForChoice(j
),
2295 e
.choices
[j
].command_line_switch
,
2296 e
.choices
[j
].command_line_value
,
2297 &name_to_switch_map
);
2300 DCHECK_EQ(e
.type
, Experiment::ENABLE_DISABLE_VALUE
);
2301 SetFlagToSwitchMapping(e
.NameForChoice(0), std::string(), std::string(),
2302 &name_to_switch_map
);
2303 SetFlagToSwitchMapping(e
.NameForChoice(1), e
.command_line_switch
,
2304 e
.command_line_value
, &name_to_switch_map
);
2305 SetFlagToSwitchMapping(e
.NameForChoice(2), e
.disable_command_line_switch
,
2306 e
.disable_command_line_value
, &name_to_switch_map
);
2310 if (sentinels
== kAddSentinels
) {
2311 command_line
->AppendSwitch(switches::kFlagSwitchesBegin
);
2312 flags_switches_
.insert(
2313 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesBegin
,
2316 for (std::set
<std::string
>::iterator it
= enabled_experiments
.begin();
2317 it
!= enabled_experiments
.end();
2319 const std::string
& experiment_name
= *it
;
2320 NameToSwitchAndValueMap::const_iterator name_to_switch_it
=
2321 name_to_switch_map
.find(experiment_name
);
2322 if (name_to_switch_it
== name_to_switch_map
.end()) {
2327 const std::pair
<std::string
, std::string
>&
2328 switch_and_value_pair
= name_to_switch_it
->second
;
2330 CHECK(!switch_and_value_pair
.first
.empty());
2331 command_line
->AppendSwitchASCII(switch_and_value_pair
.first
,
2332 switch_and_value_pair
.second
);
2333 flags_switches_
[switch_and_value_pair
.first
] = switch_and_value_pair
.second
;
2335 if (sentinels
== kAddSentinels
) {
2336 command_line
->AppendSwitch(switches::kFlagSwitchesEnd
);
2337 flags_switches_
.insert(
2338 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesEnd
,
2343 bool FlagsState::IsRestartNeededToCommitChanges() {
2344 return needs_restart_
;
2347 void FlagsState::SetExperimentEnabled(FlagsStorage
* flags_storage
,
2348 const std::string
& internal_name
,
2350 size_t at_index
= internal_name
.find(testing::kMultiSeparator
);
2351 if (at_index
!= std::string::npos
) {
2353 // We're being asked to enable a multi-choice experiment. Disable the
2354 // currently selected choice.
2355 DCHECK_NE(at_index
, 0u);
2356 const std::string experiment_name
= internal_name
.substr(0, at_index
);
2357 SetExperimentEnabled(flags_storage
, experiment_name
, false);
2359 // And enable the new choice, if it is not the default first choice.
2360 if (internal_name
!= experiment_name
+ "@0") {
2361 std::set
<std::string
> enabled_experiments
;
2362 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2363 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2364 flags_storage
->SetFlags(enabled_experiments
);
2369 std::set
<std::string
> enabled_experiments
;
2370 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2372 const Experiment
* e
= NULL
;
2373 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2374 if (experiments
[i
].internal_name
== internal_name
) {
2375 e
= experiments
+ i
;
2381 if (e
->type
== Experiment::SINGLE_VALUE
) {
2383 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2385 needs_restart_
|= (enabled_experiments
.erase(internal_name
) > 0);
2388 // Enable the first choice.
2389 needs_restart_
|= enabled_experiments
.insert(e
->NameForChoice(0)).second
;
2391 // Find the currently enabled choice and disable it.
2392 for (int i
= 0; i
< e
->num_choices
; ++i
) {
2393 std::string choice_name
= e
->NameForChoice(i
);
2394 if (enabled_experiments
.find(choice_name
) !=
2395 enabled_experiments
.end()) {
2396 needs_restart_
= true;
2397 enabled_experiments
.erase(choice_name
);
2398 // Continue on just in case there's a bug and more than one
2399 // experiment for this choice was enabled.
2405 flags_storage
->SetFlags(enabled_experiments
);
2408 void FlagsState::RemoveFlagsSwitches(
2409 std::map
<std::string
, CommandLine::StringType
>* switch_list
) {
2410 for (std::map
<std::string
, std::string
>::const_iterator
2411 it
= flags_switches_
.begin(); it
!= flags_switches_
.end(); ++it
) {
2412 switch_list
->erase(it
->first
);
2416 void FlagsState::ResetAllFlags(FlagsStorage
* flags_storage
) {
2417 needs_restart_
= true;
2419 std::set
<std::string
> no_experiments
;
2420 flags_storage
->SetFlags(no_experiments
);
2423 void FlagsState::reset() {
2424 needs_restart_
= false;
2425 flags_switches_
.clear();
2432 // WARNING: '@' is also used in the html file. If you update this constant you
2433 // also need to update the html file.
2434 const char kMultiSeparator
[] = "@";
2437 FlagsState::GetInstance()->reset();
2440 void SetExperiments(const Experiment
* e
, size_t count
) {
2442 experiments
= kExperiments
;
2443 num_experiments
= arraysize(kExperiments
);
2446 num_experiments
= count
;
2450 const Experiment
* GetExperiments(size_t* count
) {
2451 *count
= num_experiments
;
2455 } // namespace testing
2457 } // namespace about_flags