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"
13 #include "ash/ash_switches.h"
14 #include "base/command_line.h"
15 #include "base/memory/singleton.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/utf_string_conversions.h"
18 #include "base/values.h"
19 #include "cc/base/switches.h"
20 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
21 #include "chrome/browser/flags_storage.h"
22 #include "chrome/common/chrome_content_client.h"
23 #include "chrome/common/chrome_switches.h"
24 #include "components/autofill/core/common/autofill_switches.h"
25 #include "components/nacl/common/nacl_switches.h"
26 #include "content/public/browser/user_metrics.h"
27 #include "extensions/common/switches.h"
28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h"
30 #include "grit/google_chrome_strings.h"
31 #include "media/base/media_switches.h"
32 #include "ui/base/l10n/l10n_util.h"
33 #include "ui/base/ui_base_switches.h"
34 #include "ui/display/display_switches.h"
35 #include "ui/events/event_switches.h"
36 #include "ui/gfx/switches.h"
37 #include "ui/gl/gl_switches.h"
38 #include "ui/keyboard/keyboard_switches.h"
39 #include "ui/native_theme/native_theme_switches.h"
40 #include "ui/views/views_switches.h"
43 #include "ash/ash_switches.h"
46 #if defined(OS_CHROMEOS)
47 #include "chromeos/chromeos_switches.h"
48 #include "third_party/cros_system_api/switches/chrome_switches.h"
51 #if defined(ENABLE_APP_LIST)
52 #include "ui/app_list/app_list_switches.h"
55 using base::UserMetricsAction
;
57 namespace about_flags
{
59 // Macros to simplify specifying the type.
60 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
61 Experiment::SINGLE_VALUE, \
62 command_line_switch, switch_value, NULL, NULL, NULL, 0
63 #define SINGLE_VALUE_TYPE(command_line_switch) \
64 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
65 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
66 disable_switch, disable_value) \
67 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
68 disable_switch, disable_value, NULL, 3
69 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
70 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
71 #define MULTI_VALUE_TYPE(choices) \
72 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
76 const unsigned kOsAll
= kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
;
77 const unsigned kOsDesktop
= kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
;
79 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
80 // whether the experiment is available on that platform.
81 void AddOsStrings(unsigned bitmask
, base::ListValue
* list
) {
84 const char* const name
;
89 {kOsCrOS
, "Chrome OS"},
90 {kOsAndroid
, "Android"},
91 {kOsCrOSOwnerOnly
, "Chrome OS (owner only)"},
93 for (size_t i
= 0; i
< ARRAYSIZE_UNSAFE(kBitsToOs
); ++i
)
94 if (bitmask
& kBitsToOs
[i
].bit
)
95 list
->Append(new base::StringValue(kBitsToOs
[i
].name
));
98 // Convert switch constants to proper CommandLine::StringType strings.
99 CommandLine::StringType
GetSwitchString(const std::string
& flag
) {
100 CommandLine
cmd_line(CommandLine::NO_PROGRAM
);
101 cmd_line
.AppendSwitch(flag
);
102 DCHECK(cmd_line
.argv().size() == 2);
103 return cmd_line
.argv()[1];
106 // Scoops flags from a command line.
107 std::set
<CommandLine::StringType
> ExtractFlagsFromCommandLine(
108 const CommandLine
& cmdline
) {
109 std::set
<CommandLine::StringType
> flags
;
110 // First do the ones between --flag-switches-begin and --flag-switches-end.
111 CommandLine::StringVector::const_iterator first
=
112 std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
113 GetSwitchString(switches::kFlagSwitchesBegin
));
114 CommandLine::StringVector::const_iterator last
=
115 std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
116 GetSwitchString(switches::kFlagSwitchesEnd
));
117 if (first
!= cmdline
.argv().end() && last
!= cmdline
.argv().end())
118 flags
.insert(first
+ 1, last
);
119 #if defined(OS_CHROMEOS)
120 // Then add those between --policy-switches-begin and --policy-switches-end.
121 first
= std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
122 GetSwitchString(chromeos::switches::kPolicySwitchesBegin
));
123 last
= std::find(cmdline
.argv().begin(), cmdline
.argv().end(),
124 GetSwitchString(chromeos::switches::kPolicySwitchesEnd
));
125 if (first
!= cmdline
.argv().end() && last
!= cmdline
.argv().end())
126 flags
.insert(first
+ 1, last
);
131 const Experiment::Choice kEnableCompositingForFixedPositionChoices
[] = {
132 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
133 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
134 switches::kEnableCompositingForFixedPosition
, ""},
135 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
136 switches::kDisableCompositingForFixedPosition
, ""},
137 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI
,
138 switches::kEnableHighDpiCompositingForFixedPosition
, ""}
141 const Experiment::Choice kEnableCompositingForTransitionChoices
[] = {
142 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
143 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
144 switches::kEnableCompositingForTransition
, ""},
145 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
146 switches::kDisableCompositingForTransition
, ""},
149 const Experiment::Choice kEnableAcceleratedFixedRootBackgroundChoices
[] = {
150 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
151 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
152 switches::kEnableAcceleratedFixedRootBackground
, ""},
153 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
154 switches::kDisableAcceleratedFixedRootBackground
, ""},
157 const Experiment::Choice kTouchEventsChoices
[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC
, "", "" },
159 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
160 switches::kTouchEvents
,
161 switches::kTouchEventsEnabled
},
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
163 switches::kTouchEvents
,
164 switches::kTouchEventsDisabled
}
167 #if defined(USE_AURA)
168 const Experiment::Choice kOverscrollHistoryNavigationChoices
[] = {
169 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
, "", "" },
170 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
171 switches::kOverscrollHistoryNavigation
,
173 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI
,
174 switches::kOverscrollHistoryNavigation
,
179 const Experiment::Choice kNaClDebugMaskChoices
[] = {
180 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
181 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
182 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
183 // so by default we want to avoid debugging that.
184 // NOTE: As the default value must be the empty string, the mask excluding
185 // the PNaCl translator and secure shell is substituted elsewhere.
186 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL
, "", "" },
187 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL
, switches::kNaClDebugMask
, "*://*" },
188 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG
,
189 switches::kNaClDebugMask
, "*://*/*debug.nmf" }
192 const Experiment::Choice kImplSidePaintingChoices
[] = {
193 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
194 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
195 switches::kEnableImplSidePainting
, ""},
196 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
197 switches::kDisableImplSidePainting
, ""}
200 const Experiment::Choice kLCDTextChoices
[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
202 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
, switches::kEnableLCDText
, ""},
203 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
, switches::kDisableLCDText
, ""}
207 const Experiment::Choice kDelegatedRendererChoices
[] = {
208 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
209 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
210 switches::kEnableDelegatedRenderer
, ""},
211 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
212 switches::kDisableDelegatedRenderer
, ""}
216 const Experiment::Choice kMaxTilesForInterestAreaChoices
[] = {
217 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
218 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT
,
219 cc::switches::kMaxTilesForInterestArea
, "64"},
220 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL
,
221 cc::switches::kMaxTilesForInterestArea
, "128"},
222 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE
,
223 cc::switches::kMaxTilesForInterestArea
, "256"},
224 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI
,
225 cc::switches::kMaxTilesForInterestArea
, "512"}
228 const Experiment::Choice kDefaultTileWidthChoices
[] = {
229 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
230 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT
,
231 switches::kDefaultTileWidth
, "128"},
232 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL
,
233 switches::kDefaultTileWidth
, "256"},
234 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE
,
235 switches::kDefaultTileWidth
, "512"},
236 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI
,
237 switches::kDefaultTileWidth
, "1024"}
240 const Experiment::Choice kDefaultTileHeightChoices
[] = {
241 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
242 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT
,
243 switches::kDefaultTileHeight
, "128"},
244 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL
,
245 switches::kDefaultTileHeight
, "256"},
246 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE
,
247 switches::kDefaultTileHeight
, "512"},
248 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI
,
249 switches::kDefaultTileHeight
, "1024"}
252 const Experiment::Choice kSimpleCacheBackendChoices
[] = {
253 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
254 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
255 switches::kUseSimpleCacheBackend
, "off" },
256 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
257 switches::kUseSimpleCacheBackend
, "on"}
260 #if defined(USE_AURA)
261 const Experiment::Choice kTabCaptureUpscaleQualityChoices
[] = {
262 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
263 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST
,
264 switches::kTabCaptureUpscaleQuality
, "fast" },
265 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD
,
266 switches::kTabCaptureUpscaleQuality
, "good" },
267 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST
,
268 switches::kTabCaptureUpscaleQuality
, "best" },
271 const Experiment::Choice kTabCaptureDownscaleQualityChoices
[] = {
272 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
273 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST
,
274 switches::kTabCaptureDownscaleQuality
, "fast" },
275 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD
,
276 switches::kTabCaptureDownscaleQuality
, "good" },
277 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST
,
278 switches::kTabCaptureDownscaleQuality
, "best" },
282 #if defined(USE_AURA) || defined(OS_LINUX)
283 const Experiment::Choice kOverlayScrollbarChoices
[] = {
284 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
285 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
286 switches::kEnableOverlayScrollbar
, ""},
287 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
288 switches::kDisableOverlayScrollbar
, ""}
292 const Experiment::Choice kZeroCopyChoices
[] = {
293 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
294 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
295 switches::kEnableZeroCopy
, ""},
296 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
297 switches::kDisableZeroCopy
, ""}
300 #if defined(OS_ANDROID)
301 const Experiment::Choice kZeroSuggestExperimentsChoices
[] = {
302 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
303 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED
,
304 switches::kEnableZeroSuggestMostVisited
, ""},
305 { IDS_FLAGS_ZERO_SUGGEST_ETHER_SERP
,
306 switches::kEnableZeroSuggestEtherSerp
, ""},
307 { IDS_FLAGS_ZERO_SUGGEST_ETHER_NO_SERP
,
308 switches::kEnableZeroSuggestEtherNoSerp
, ""},
309 { IDS_FLAGS_ZERO_SUGGEST_PERSONALIZED
,
310 switches::kEnableZeroSuggestPersonalized
, ""},
311 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
312 switches::kDisableZeroSuggest
, ""}
316 const Experiment::Choice kNumRasterThreadsChoices
[] = {
317 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
318 { IDS_FLAGS_NUM_RASTER_THREADS_ONE
, switches::kNumRasterThreads
, "1" },
319 { IDS_FLAGS_NUM_RASTER_THREADS_TWO
, switches::kNumRasterThreads
, "2" },
320 { IDS_FLAGS_NUM_RASTER_THREADS_THREE
, switches::kNumRasterThreads
, "3" },
321 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR
, switches::kNumRasterThreads
, "4" }
324 const Experiment::Choice kEnableGpuRasterizationChoices
[] = {
325 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
326 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
327 switches::kEnableGpuRasterization
, "" },
328 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
329 switches::kDisableGpuRasterization
, "" },
330 { IDS_FLAGS_FORCE_GPU_RASTERIZATION
,
331 switches::kForceGpuRasterization
, "" },
334 // We're using independent flags here (as opposed to a common flag with
335 // different values) to be able to enable/disable the entire experience
336 // associated with this feature server-side from the FieldTrial (the complete
337 // experience includes other flag changes as well). It is not currently possible
338 // to do that with "flag=value" flags.
339 const Experiment::Choice kSearchButtonInOmniboxChoices
[] = {
340 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
341 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
342 switches::kDisableSearchButtonInOmnibox
, ""},
343 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR
,
344 switches::kEnableSearchButtonInOmniboxForStr
, ""},
345 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR_OR_IIP
,
346 switches::kEnableSearchButtonInOmniboxForStrOrIip
, ""},
347 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLED
,
348 switches::kEnableSearchButtonInOmniboxAlways
, ""}
351 // See comment above for kSearchButtonInOmniboxChoices. The same reasoning
353 const Experiment::Choice kOriginChipChoices
[] = {
354 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
355 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
, switches::kDisableOriginChip
, ""},
356 { IDS_FLAGS_ORIGIN_CHIP_TRAILING_LOCATION_BAR
,
357 switches::kEnableOriginChipTrailingLocationBar
, ""},
358 { IDS_FLAGS_ORIGIN_CHIP_LEADING_LOCATION_BAR
,
359 switches::kEnableOriginChipLeadingLocationBar
, ""},
360 { IDS_FLAGS_ORIGIN_CHIP_LEADING_MENU_BUTTON
,
361 switches::kEnableOriginChipLeadingMenuButton
, ""}
363 const Experiment::Choice kOriginChipV2Choices
[] = {
364 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
365 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
, switches::kDisableOriginChipV2
, ""},
366 { IDS_FLAGS_ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE
,
367 switches::kEnableOriginChipV2HideOnMouseRelease
, ""},
368 { IDS_FLAGS_ORIGIN_CHIP_V2_HIDE_ON_USER_INPUT
,
369 switches::kEnableOriginChipV2HideOnUserInput
, ""}
372 const Experiment::Choice kTouchScrollingModeChoices
[] = {
373 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
374 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL
,
375 switches::kTouchScrollingMode
,
376 switches::kTouchScrollingModeTouchcancel
},
377 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE
,
378 switches::kTouchScrollingMode
,
379 switches::kTouchScrollingModeAsyncTouchmove
},
380 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE
,
381 switches::kTouchScrollingMode
,
382 switches::kTouchScrollingModeSyncTouchmove
},
385 #if defined(ENABLE_APP_LIST)
386 const Experiment::Choice kEnableSyncAppListChoices
[] = {
387 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
388 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
389 app_list::switches::kEnableSyncAppList
, "" },
390 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
391 app_list::switches::kDisableSyncAppList
, "" },
395 // RECORDING USER METRICS FOR FLAGS:
396 // -----------------------------------------------------------------------------
397 // The first line of the experiment is the internal name. If you'd like to
398 // gather statistics about the usage of your flag, you should append a marker
399 // comment to the end of the feature name, like so:
400 // "my-special-feature", // FLAGS:RECORD_UMA
402 // After doing that, run
403 // tools/metrics/actions/extract_actions.py
404 // to add the metric to actions.xml (which will enable UMA to record your
405 // feature flag), then update the <owner>s and <description> sections. Make sure
406 // to include the actions.xml file when you upload your code for review!
408 // After your feature has shipped under a flag, you can locate the metrics under
409 // the action name AboutFlags_internal-action-name. Actions are recorded once
410 // per startup, so you should divide this number by AboutFlags_StartupTick to
411 // get a sense of usage. Note that this will not be the same as number of users
412 // with a given feature enabled because users can quit and relaunch the
413 // application multiple times over a given time interval. The dashboard also
414 // shows you how many (metrics reporting) users have enabled the flag over the
415 // last seven days. However, note that this is not the same as the number of
416 // users who have the flag enabled, since enabling the flag happens once,
417 // whereas running with the flag enabled happens until the user flips the flag
420 // To add a new experiment add to the end of kExperiments. There are two
421 // distinct types of experiments:
422 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
423 // macro for this type supplying the command line to the macro.
424 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
425 // deactivated state for this lab (i.e. no command line option). To specify
426 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
428 // See the documentation of Experiment for details on the fields.
430 // When adding a new choice, add it to the end of the list.
431 const Experiment kExperiments
[] = {
433 "conflicting-modules-check", // FLAGS:RECORD_UMA
434 IDS_FLAGS_CONFLICTS_CHECK_NAME
,
435 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION
,
437 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck
)
440 "ignore-gpu-blacklist",
441 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME
,
442 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION
,
444 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist
)
447 "threaded-compositing-mode",
448 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME
,
449 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION
,
450 #if !defined(USE_AURA)
455 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing
,
456 switches::kDisableThreadedCompositing
)
459 "force-accelerated-composited-scrolling",
460 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME
,
461 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION
,
463 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll
,
464 switches::kDisableAcceleratedOverflowScroll
)
467 "force-universal-accelerated-composited-scrolling",
468 IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME
,
469 IDS_FLAGS_FORCE_UNIVERSAL_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION
,
471 ENABLE_DISABLE_VALUE_TYPE(
472 switches::kEnableUniversalAcceleratedOverflowScroll
,
473 switches::kDisableUniversalAcceleratedOverflowScroll
)
476 "disable_layer_squashing",
477 IDS_FLAGS_DISABLE_LAYER_SQUASHING_NAME
,
478 IDS_FLAGS_DISABLE_LAYER_SQUASHING_DESCRIPTION
,
480 SINGLE_VALUE_TYPE(switches::kDisableLayerSquashing
)
484 "enable-direct-write",
485 IDS_FLAGS_ENABLE_DIRECT_WRITE_NAME
,
486 IDS_FLAGS_ENABLE_DIRECT_WRITE_DESCRIPTION
,
488 SINGLE_VALUE_TYPE(switches::kEnableDirectWrite
)
492 "enable-experimental-canvas-features",
493 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME
,
494 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION
,
496 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures
)
499 "disable-accelerated-2d-canvas",
500 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME
,
501 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION
,
503 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas
)
506 "composited-layer-borders",
507 IDS_FLAGS_COMPOSITED_LAYER_BORDERS
,
508 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION
,
510 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders
)
514 IDS_FLAGS_SHOW_FPS_COUNTER
,
515 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION
,
517 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter
)
521 IDS_FLAGS_DISABLE_WEBGL_NAME
,
522 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION
,
524 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL
)
528 IDS_FLAGS_DISABLE_WEBRTC_NAME
,
529 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION
,
531 #if defined(OS_ANDROID)
532 SINGLE_VALUE_TYPE(switches::kDisableWebRTC
)
534 SINGLE_VALUE_TYPE("")
537 #if defined(ENABLE_WEBRTC)
539 "disable-device-enumeration",
540 IDS_FLAGS_DISABLE_DEVICE_ENUMERATION_NAME
,
541 IDS_FLAGS_DISABLE_DEVICE_ENUMERATION_DESCRIPTION
,
543 SINGLE_VALUE_TYPE(switches::kDisableDeviceEnumeration
)
546 "disable-webrtc-hw-decoding",
547 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME
,
548 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION
,
549 kOsAndroid
| kOsCrOS
,
550 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding
)
553 "disable-webrtc-hw-encoding",
554 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME
,
555 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION
,
556 kOsAndroid
| kOsCrOS
,
557 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding
)
560 #if defined(OS_ANDROID)
563 IDS_FLAGS_DISABLE_WEBAUDIO_NAME
,
564 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION
,
566 SINGLE_VALUE_TYPE(switches::kDisableWebAudio
)
570 "fixed-position-creates-stacking-context",
571 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME
,
572 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION
,
574 ENABLE_DISABLE_VALUE_TYPE(
575 switches::kEnableFixedPositionCreatesStackingContext
,
576 switches::kDisableFixedPositionCreatesStackingContext
)
579 "enable-compositing-for-fixed-position",
580 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME
,
581 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION
,
583 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices
)
586 "enable-compositing-for-transition",
587 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME
,
588 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION
,
590 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices
)
593 "enable-accelerated-fixed-root-background",
594 IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_NAME
,
595 IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_DESCRIPTION
,
597 MULTI_VALUE_TYPE(kEnableAcceleratedFixedRootBackgroundChoices
)
599 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
601 "enable-nacl", // FLAGS:RECORD_UMA
602 IDS_FLAGS_ENABLE_NACL_NAME
,
603 IDS_FLAGS_ENABLE_NACL_DESCRIPTION
,
605 SINGLE_VALUE_TYPE(switches::kEnableNaCl
)
608 "enable-nacl-debug", // FLAGS:RECORD_UMA
609 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME
,
610 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION
,
612 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug
)
615 "disable-pnacl", // FLAGS:RECORD_UMA
616 IDS_FLAGS_DISABLE_PNACL_NAME
,
617 IDS_FLAGS_DISABLE_PNACL_DESCRIPTION
,
619 SINGLE_VALUE_TYPE(switches::kDisablePnacl
)
622 "nacl-debug-mask", // FLAGS:RECORD_UMA
623 IDS_FLAGS_NACL_DEBUG_MASK_NAME
,
624 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION
,
626 MULTI_VALUE_TYPE(kNaClDebugMaskChoices
)
629 "extension-apis", // FLAGS:RECORD_UMA
630 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME
,
631 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION
,
633 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis
)
636 "extensions-on-chrome-urls",
637 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME
,
638 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION
,
640 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs
)
643 "enable-fast-unload",
644 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME
,
645 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION
,
647 SINGLE_VALUE_TYPE(switches::kEnableFastUnload
)
651 IDS_FLAGS_ENABLE_ADVIEW_NAME
,
652 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION
,
654 SINGLE_VALUE_TYPE(switches::kEnableAdview
)
657 "enable-app-window-controls",
658 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME
,
659 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION
,
661 SINGLE_VALUE_TYPE(switches::kEnableAppWindowControls
)
664 "apps-new-install-bubble",
665 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME
,
666 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION
,
668 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble
)
671 "disable-hyperlink-auditing",
672 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME
,
673 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION
,
675 SINGLE_VALUE_TYPE(switches::kNoPings
)
677 #if defined(OS_ANDROID)
680 IDS_FLAGS_ENABLE_NEW_NTP
,
681 IDS_FLAGS_ENABLE_NEW_NTP_DESCRIPTION
,
683 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewNTP
,
684 switches::kDisableNewNTP
)
688 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH
,
689 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION
,
691 SINGLE_VALUE_TYPE(switches::kEnableContextualSearch
)
695 "show-autofill-type-predictions",
696 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME
,
697 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION
,
699 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions
)
702 "enable-gesture-tap-highlight",
703 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME
,
704 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION
,
705 kOsLinux
| kOsCrOS
| kOsWin
| kOsAndroid
,
706 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight
,
707 switches::kDisableGestureTapHighlight
)
710 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
711 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME
,
712 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION
,
713 // Can't expose the switch unless the code is compiled in.
714 // On by default for the Mac (different implementation in WebKit).
716 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling
)
718 #if defined(USE_AURA) || defined(OS_LINUX)
720 "overlay-scrollbars",
721 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME
,
722 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION
,
723 // Uses the system preference on Mac (a different implementation).
724 // On Android, this is always enabled.
725 kOsLinux
| kOsCrOS
| kOsWin
,
726 MULTI_VALUE_TYPE(kOverlayScrollbarChoices
)
731 IDS_FLAGS_ENABLE_PANELS_NAME
,
732 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION
,
734 SINGLE_VALUE_TYPE(switches::kEnablePanels
)
737 // See http://crbug.com/120416 for how to remove this flag.
738 "save-page-as-mhtml", // FLAGS:RECORD_UMA
739 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME
,
740 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION
,
741 kOsMac
| kOsWin
| kOsLinux
,
742 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML
)
746 IDS_FLAGS_ENABLE_QUIC_NAME
,
747 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION
,
749 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic
,
750 switches::kDisableQuic
)
754 IDS_FLAGS_ENABLE_QUIC_HTTPS_NAME
,
755 IDS_FLAGS_ENABLE_QUIC_HTTPS_DESCRIPTION
,
757 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuicHttps
,
758 switches::kDisableQuicHttps
)
762 IDS_FLAGS_ENABLE_SPDY4_NAME
,
763 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION
,
765 SINGLE_VALUE_TYPE(switches::kEnableSpdy4
)
769 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME
,
770 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION
,
771 kOsWin
| kOsMac
| kOsLinux
| kOsCrOS
,
772 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns
,
773 switches::kDisableAsyncDns
)
776 "disable-media-source",
777 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME
,
778 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION
,
780 SINGLE_VALUE_TYPE(switches::kDisableMediaSource
)
783 "enable-encrypted-media",
784 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME
,
785 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION
,
787 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia
)
790 "disable-prefixed-encrypted-media",
791 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME
,
792 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION
,
794 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia
)
796 #if defined(OS_ANDROID)
798 "disable-infobar-for-protected-media-identifier",
799 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME
,
800 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION
,
802 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier
)
805 "mediadrm-enable-non-compositing",
806 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME
,
807 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION
,
809 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing
)
811 #endif // defined(OS_ANDROID)
813 "enable-javascript-harmony",
814 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME
,
815 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION
,
817 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags
, "--harmony")
820 "disable-software-rasterizer",
821 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME
,
822 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION
,
823 #if defined(ENABLE_SWIFTSHADER)
828 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer
)
831 "enable-gpu-rasterization",
832 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME
,
833 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION
,
835 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices
)
838 "enable-experimental-web-platform-features",
839 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME
,
840 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION
,
842 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures
)
845 "disable-ntp-other-sessions-menu",
846 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME
,
847 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION
,
849 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu
)
852 "enable-devtools-experiments",
853 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME
,
854 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION
,
856 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments
)
859 "silent-debugger-extension-api",
860 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME
,
861 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION
,
863 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI
)
866 "spellcheck-autocorrect",
867 IDS_FLAGS_SPELLCHECK_AUTOCORRECT
,
868 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION
,
869 kOsWin
| kOsLinux
| kOsCrOS
,
870 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect
)
873 "enable-scroll-prediction",
874 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME
,
875 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION
,
877 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction
)
881 IDS_TOUCH_EVENTS_NAME
,
882 IDS_TOUCH_EVENTS_DESCRIPTION
,
884 MULTI_VALUE_TYPE(kTouchEventsChoices
)
887 "disable-touch-adjustment",
888 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME
,
889 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION
,
890 kOsWin
| kOsLinux
| kOsCrOS
,
891 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment
)
893 #if defined(OS_CHROMEOS)
895 "ash-disable-docked-windows",
896 IDS_FLAGS_DOCKED_WINDOWS_NAME
,
897 IDS_FLAGS_DOCKED_WINDOWS_DESCRIPTION
,
899 SINGLE_VALUE_TYPE(ash::switches::kAshDisableDockedWindows
)
902 "network-portal-notification",
903 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME
,
904 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION
,
906 ENABLE_DISABLE_VALUE_TYPE(
907 chromeos::switches::kEnableNetworkPortalNotification
,
908 chromeos::switches::kDisableNetworkPortalNotification
)
912 "enable-download-resumption",
913 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME
,
914 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION
,
916 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption
)
919 "allow-nacl-socket-api",
920 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME
,
921 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION
,
923 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI
, "*")
927 IDS_FLAGS_STACKED_TAB_STRIP_NAME
,
928 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION
,
930 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip
)
933 "force-device-scale-factor",
934 IDS_FLAGS_FORCE_HIGH_DPI_NAME
,
935 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION
,
937 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor
, "2")
939 #if defined(OS_CHROMEOS)
941 "allow-touchpad-three-finger-click",
942 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME
,
943 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION
,
945 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick
)
950 "disable-minimize-on-second-launcher-item-click",
951 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME
,
952 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION
,
954 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick
)
958 IDS_FLAGS_SHOW_TOUCH_HUD_NAME
,
959 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION
,
961 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud
)
965 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME
,
966 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION
,
967 kOsLinux
| kOsWin
| kOsCrOS
,
968 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch
, switches::kDisablePinch
),
970 #endif // defined(USE_ASH)
972 "enable-pinch-virtual-viewport",
973 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME
,
974 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION
,
975 kOsLinux
| kOsWin
| kOsCrOS
| kOsAndroid
,
976 ENABLE_DISABLE_VALUE_TYPE(
977 cc::switches::kEnablePinchVirtualViewport
,
978 cc::switches::kDisablePinchVirtualViewport
),
981 "enable-viewport-meta",
982 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME
,
983 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION
,
984 kOsLinux
| kOsWin
| kOsCrOS
| kOsMac
,
985 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta
),
987 #if defined(OS_CHROMEOS)
989 "disable-boot-animation",
990 IDS_FLAGS_DISABLE_BOOT_ANIMATION
,
991 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION
,
993 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation
),
996 "enable-new-audio-player",
997 IDS_FLAGS_FILE_MANAGER_ENABLE_NEW_AUDIO_PLAYER_NAME
,
998 IDS_FLAGS_FILE_MANAGER_ENABLE_NEW_AUDIO_PLAYER_DESCRIPTION
,
1000 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerEnableNewAudioPlayer
)
1003 "disable-quickoffice-component-app",
1004 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME
,
1005 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION
,
1007 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp
),
1010 "disable-saml-signin",
1011 IDS_FLAGS_DISABLE_SAML_SIGNIN_NAME
,
1012 IDS_FLAGS_DISABLE_SAML_SIGNIN_DESCRIPTION
,
1014 SINGLE_VALUE_TYPE(chromeos::switches::kDisableSamlSignin
),
1017 "enable-multi-profiles",
1018 IDS_FLAGS_ENABLE_MULTI_PROFILES_NAME
,
1019 IDS_FLAGS_ENABLE_MULTI_PROFILES_DESCRIPTION
,
1021 SINGLE_VALUE_TYPE(switches::kMultiProfiles
),
1024 "disable-display-color-calibration",
1025 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME
,
1026 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION
,
1028 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration
),
1030 #endif // defined(OS_CHROMEOS)
1031 { "disable-accelerated-video-decode",
1032 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME
,
1033 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION
,
1035 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode
),
1037 #if defined(USE_ASH)
1039 "ash-debug-shortcuts",
1040 IDS_FLAGS_DEBUG_SHORTCUTS_NAME
,
1041 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION
,
1043 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts
),
1045 { "ash-alternate-caption-button",
1046 IDS_FLAGS_ASH_FRAME_CAPTION_BUTTON_STYLE_NAME
,
1047 IDS_FLAGS_ASH_FRAME_CAPTION_BUTTON_STYLE_DESCRIPTION
,
1049 ENABLE_DISABLE_VALUE_TYPE(
1050 ash::switches::kAshEnableAlternateFrameCaptionButtonStyle
,
1051 ash::switches::kAshDisableAlternateFrameCaptionButtonStyle
),
1053 { "ash-enable-touch-view-testing",
1054 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME
,
1055 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION
,
1057 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting
),
1060 #if defined(OS_CHROMEOS)
1062 "enable-carrier-switching",
1063 IDS_FLAGS_ENABLE_CARRIER_SWITCHING
,
1064 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION
,
1066 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching
)
1069 "enable-request-tablet-site",
1070 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME
,
1071 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION
,
1073 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite
)
1077 "debug-packed-apps",
1078 IDS_FLAGS_DEBUG_PACKED_APP_NAME
,
1079 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION
,
1081 SINGLE_VALUE_TYPE(switches::kDebugPackedApps
)
1084 "enable-password-generation",
1085 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME
,
1086 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION
,
1088 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration
,
1089 autofill::switches::kDisablePasswordGeneration
)
1092 "enable-automatic-password-saving",
1093 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME
,
1094 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION
,
1097 password_manager::switches::kEnableAutomaticPasswordSaving
)
1100 "password-manager-reauthentication",
1101 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME
,
1102 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION
,
1104 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication
)
1107 "enable-deferred-image-decoding",
1108 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME
,
1109 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION
,
1110 kOsMac
| kOsLinux
| kOsCrOS
,
1111 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding
)
1114 "performance-monitor-gathering",
1115 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME
,
1116 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION
,
1118 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering
)
1121 "wallet-service-use-sandbox",
1122 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME
,
1123 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION
,
1124 kOsCrOS
| kOsWin
| kOsMac
,
1125 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1126 autofill::switches::kWalletServiceUseSandbox
, "1",
1127 autofill::switches::kWalletServiceUseSandbox
, "0")
1129 #if defined(USE_AURA)
1131 "overscroll-history-navigation",
1132 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME
,
1133 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION
,
1135 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices
)
1139 "scroll-end-effect",
1140 IDS_FLAGS_SCROLL_END_EFFECT_NAME
,
1141 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION
,
1143 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1144 switches::kScrollEndEffect
, "1",
1145 switches::kScrollEndEffect
, "0")
1148 "enable-touch-drag-drop",
1149 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME
,
1150 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION
,
1152 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop
,
1153 switches::kDisableTouchDragDrop
)
1156 "enable-touch-editing",
1157 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME
,
1158 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION
,
1160 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing
,
1161 switches::kDisableTouchEditing
)
1164 "enable-suggestions-service",
1165 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME
,
1166 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION
,
1167 kOsAndroid
| kOsCrOS
,
1168 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService
,
1169 switches::kDisableSuggestionsService
)
1172 "enable-sync-synced-notifications",
1173 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME
,
1174 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION
,
1176 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications
,
1177 switches::kDisableSyncSyncedNotifications
)
1179 #if defined(ENABLE_APP_LIST)
1181 "enable-sync-app-list",
1182 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME
,
1183 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION
,
1185 MULTI_VALUE_TYPE(kEnableSyncAppListChoices
)
1189 "enable-usermedia-screen-capture",
1190 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME
,
1191 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION
,
1193 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing
)
1195 #if defined(OS_MACOSX)
1197 "enable-avfoundation",
1198 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME
,
1199 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION
,
1201 SINGLE_VALUE_TYPE(switches::kEnableAVFoundation
)
1205 "impl-side-painting",
1206 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME
,
1207 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION
,
1209 MULTI_VALUE_TYPE(kImplSidePaintingChoices
)
1213 IDS_FLAGS_LCD_TEXT_NAME
,
1214 IDS_FLAGS_LCD_TEXT_DESCRIPTION
,
1216 MULTI_VALUE_TYPE(kLCDTextChoices
)
1220 "delegated-renderer",
1221 IDS_FLAGS_DELEGATED_RENDERER_NAME
,
1222 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION
,
1224 MULTI_VALUE_TYPE(kDelegatedRendererChoices
)
1228 "max-tiles-for-interest-area",
1229 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME
,
1230 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION
,
1232 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices
)
1235 "enable-offline-mode",
1236 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME
,
1237 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION
,
1239 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess
)
1242 "enable-offline-auto-reload",
1243 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME
,
1244 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION
,
1246 SINGLE_VALUE_TYPE(switches::kEnableOfflineAutoReload
)
1249 "enable-offline-load-stale-cache",
1250 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME
,
1251 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION
,
1252 kOsLinux
| kOsMac
| kOsWin
| kOsAndroid
,
1253 SINGLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache
)
1256 "default-tile-width",
1257 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME
,
1258 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION
,
1260 MULTI_VALUE_TYPE(kDefaultTileWidthChoices
)
1263 "default-tile-height",
1264 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME
,
1265 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION
,
1267 MULTI_VALUE_TYPE(kDefaultTileHeightChoices
)
1269 #if defined(OS_ANDROID)
1271 "disable-gesture-requirement-for-media-playback",
1272 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME
,
1273 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION
,
1275 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback
)
1278 #if defined(OS_CHROMEOS)
1280 "enable-virtual-keyboard",
1281 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME
,
1282 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION
,
1284 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard
)
1287 "enable-virtual-keyboard-overscroll",
1288 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME
,
1289 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION
,
1291 ENABLE_DISABLE_VALUE_TYPE(
1292 keyboard::switches::kEnableVirtualKeyboardOverscroll
,
1293 keyboard::switches::kDisableVirtualKeyboardOverscroll
)
1296 "enable-swipe-selection",
1297 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME
,
1298 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION
,
1300 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection
)
1303 "enable-input-view",
1304 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME
,
1305 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION
,
1307 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView
,
1308 keyboard::switches::kDisableInputView
)
1312 "enable-simple-cache-backend",
1313 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME
,
1314 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION
,
1315 kOsWin
| kOsMac
| kOsLinux
| kOsCrOS
,
1316 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices
)
1319 "enable-tcp-fast-open",
1320 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME
,
1321 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION
,
1322 kOsLinux
| kOsCrOS
| kOsAndroid
,
1323 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen
)
1326 "apps-use-native-frame",
1327 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME
,
1328 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION
,
1330 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame
)
1333 "enable-syncfs-directory-operation",
1334 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME
,
1335 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION
,
1337 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation
),
1339 #if defined(ENABLE_SERVICE_DISCOVERY)
1341 "disable-device-discovery",
1342 IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_NAME
,
1343 IDS_FLAGS_DISABLE_DEVICE_DISCOVERY_DESCRIPTION
,
1344 kOsWin
| kOsLinux
| kOsCrOS
,
1345 SINGLE_VALUE_TYPE(switches::kDisableDeviceDiscovery
)
1348 "device-discovery-notifications",
1349 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME
,
1350 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION
,
1351 kOsWin
| kOsLinux
| kOsCrOS
,
1352 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications
,
1353 switches::kDisableDeviceDiscoveryNotifications
)
1356 "enable-print-preview-register-promos",
1357 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME
,
1358 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION
,
1359 kOsWin
| kOsLinux
| kOsCrOS
,
1360 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos
)
1362 #endif // ENABLE_SERVICE_DISCOVERY
1365 "enable-cloud-print-xps",
1366 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME
,
1367 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION
,
1369 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps
)
1372 #if defined(OS_MACOSX)
1374 "disable-app-shims",
1375 IDS_FLAGS_DISABLE_APP_SHIMS_NAME
,
1376 IDS_FLAGS_DISABLE_APP_SHIMS_DESCRIPTION
,
1378 SINGLE_VALUE_TYPE(switches::kDisableAppShims
)
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
,
1430 SINGLE_VALUE_TYPE(switches::kNewProfileManagement
)
1433 "enable-fast-user-switching",
1434 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME
,
1435 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION
,
1436 kOsMac
| kOsWin
| kOsLinux
,
1437 SINGLE_VALUE_TYPE(switches::kFastUserSwitching
)
1440 "enable-new-avatar-menu",
1441 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME
,
1442 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION
,
1443 kOsMac
| kOsWin
| kOsLinux
,
1444 SINGLE_VALUE_TYPE(switches::kNewAvatarMenu
)
1447 "enable-web-based-signin",
1448 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_NAME
,
1449 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_DESCRIPTION
,
1450 kOsMac
| kOsWin
| kOsLinux
,
1451 SINGLE_VALUE_TYPE(switches::kEnableWebBasedSignin
)
1454 "enable-google-profile-info",
1455 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME
,
1456 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION
,
1457 kOsMac
| kOsWin
| kOsLinux
,
1458 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo
)
1461 "reset-app-list-install-state",
1462 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME
,
1463 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION
,
1464 kOsMac
| kOsWin
| kOsLinux
,
1465 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState
)
1467 #if defined(ENABLE_APP_LIST)
1468 #if defined(OS_LINUX)
1470 // This is compiled out on non-Linux platforms because otherwise it would be
1471 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1472 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1474 IDS_FLAGS_ENABLE_APP_LIST_NAME
,
1475 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION
,
1477 SINGLE_VALUE_TYPE(switches::kEnableAppList
)
1481 "disable-app-list-voice-search",
1482 IDS_FLAGS_DISABLE_APP_LIST_VOICE_SEARCH
,
1483 IDS_FLAGS_DISABLE_APP_LIST_VOICE_SEARCH_DESCRIPTION
,
1485 SINGLE_VALUE_TYPE(app_list::switches::kDisableVoiceSearch
)
1488 "enable-app-list-app-info",
1489 IDS_FLAGS_ENABLE_APP_INFO_IN_APP_LIST
,
1490 IDS_FLAGS_ENABLE_APP_INFO_IN_APP_LIST_DESCRIPTION
,
1491 kOsLinux
| kOsWin
| kOsCrOS
,
1492 SINGLE_VALUE_TYPE(app_list::switches::kEnableAppInfo
)
1495 #if defined(OS_ANDROID)
1497 "enable-accessibility-tab-switcher",
1498 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME
,
1499 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION
,
1501 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher
)
1504 // TODO(dmazzoni): remove this flag when native android accessibility
1505 // ships in the stable channel. http://crbug.com/356775
1506 "enable-accessibility-script-injection",
1507 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME
,
1508 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION
,
1510 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1511 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1516 IDS_FLAGS_ONE_COPY_NAME
,
1517 IDS_FLAGS_ONE_COPY_DESCRIPTION
,
1519 SINGLE_VALUE_TYPE(switches::kEnableOneCopy
)
1523 IDS_FLAGS_ZERO_COPY_NAME
,
1524 IDS_FLAGS_ZERO_COPY_DESCRIPTION
,
1526 MULTI_VALUE_TYPE(kZeroCopyChoices
)
1528 #if defined(OS_CHROMEOS)
1530 "disable-first-run-ui",
1531 IDS_FLAGS_DISABLE_FIRST_RUN_UI_NAME
,
1532 IDS_FLAGS_DISABLE_FIRST_RUN_UI_DESCRIPTION
,
1534 SINGLE_VALUE_TYPE(chromeos::switches::kDisableFirstRunUI
)
1537 "enable-first-run-ui-transitions",
1538 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME
,
1539 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION
,
1541 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions
)
1545 "disable-compositor-touch-hit-testing",
1546 IDS_FLAGS_DISABLE_COMPOSITOR_TOUCH_HIT_TESTING_NAME
,
1547 IDS_FLAGS_DISABLE_COMPOSITOR_TOUCH_HIT_TESTING_DESCRIPTION
,
1549 SINGLE_VALUE_TYPE(cc::switches::kDisableCompositorTouchHitTesting
),
1552 "enable-streamlined-hosted-apps",
1553 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME
,
1554 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION
,
1555 kOsWin
| kOsCrOS
| kOsLinux
,
1556 SINGLE_VALUE_TYPE(switches::kEnableStreamlinedHostedApps
)
1559 "enable-ephemeral-apps",
1560 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_NAME
,
1561 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_DESCRIPTION
,
1562 kOsWin
| kOsLinux
| kOsCrOS
,
1563 SINGLE_VALUE_TYPE(switches::kEnableEphemeralApps
)
1566 "enable-linkable-ephemeral-apps",
1567 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME
,
1568 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION
,
1569 kOsWin
| kOsLinux
| kOsCrOS
,
1570 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps
)
1573 "enable-service-worker",
1574 IDS_FLAGS_ENABLE_SERVICE_WORKER_NAME
,
1575 IDS_FLAGS_ENABLE_SERVICE_WORKER_DESCRIPTION
,
1577 SINGLE_VALUE_TYPE(switches::kEnableServiceWorker
)
1580 "enable-service-worker-sync",
1581 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME
,
1582 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION
,
1584 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync
)
1586 #if defined(OS_ANDROID)
1588 "disable-click-delay",
1589 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME
,
1590 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION
,
1592 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1593 SINGLE_VALUE_TYPE("disable-click-delay")
1596 #if defined(OS_MACOSX)
1598 "enable-translate-new-ux",
1599 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME
,
1600 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION
,
1602 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX
)
1605 #if defined(TOOLKIT_VIEWS)
1607 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1608 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME
,
1609 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION
,
1611 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting
)
1615 "enable-apps-show-on-first-paint",
1616 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME
,
1617 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION
,
1619 SINGLE_VALUE_TYPE(switches::kEnableAppsShowOnFirstPaint
)
1622 "enhanced-bookmarks-experiment",
1623 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1624 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1626 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1627 switches::kEnhancedBookmarksExperiment
, "1",
1628 switches::kEnhancedBookmarksExperiment
, "0")
1631 "manual-enhanced-bookmarks",
1632 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1633 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1635 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks
)
1638 "manual-enhanced-bookmarks-optout",
1639 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1640 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1642 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout
)
1644 #if defined(OS_ANDROID)
1646 "enable-zero-suggest-experiment",
1647 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME
,
1648 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION
,
1650 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices
)
1654 "num-raster-threads",
1655 IDS_FLAGS_NUM_RASTER_THREADS_NAME
,
1656 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION
,
1658 MULTI_VALUE_TYPE(kNumRasterThreadsChoices
)
1662 IDS_FLAGS_ORIGIN_CHIP_NAME
,
1663 IDS_FLAGS_ORIGIN_CHIP_DESCRIPTION
,
1664 kOsCrOS
| kOsWin
| kOsLinux
,
1665 MULTI_VALUE_TYPE(kOriginChipChoices
)
1668 "origin-chip-in-omnibox",
1669 IDS_FLAGS_ORIGIN_CHIP_V2_NAME
,
1670 IDS_FLAGS_ORIGIN_CHIP_V2_DESCRIPTION
,
1671 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
,
1672 MULTI_VALUE_TYPE(kOriginChipV2Choices
)
1675 "search-button-in-omnibox",
1676 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_NAME
,
1677 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_DESCRIPTION
,
1678 kOsCrOS
| kOsMac
| kOsWin
,
1679 MULTI_VALUE_TYPE(kSearchButtonInOmniboxChoices
)
1682 "disable-ignore-autocomplete-off",
1683 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_NAME
,
1684 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_DESCRIPTION
,
1686 SINGLE_VALUE_TYPE(autofill::switches::kDisableIgnoreAutocompleteOff
)
1689 "enable-permissions-bubbles",
1690 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME
,
1691 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION
,
1692 kOsCrOS
| kOsMac
| kOsWin
,
1693 SINGLE_VALUE_TYPE(switches::kEnablePermissionsBubbles
)
1696 "enable-session-crashed-bubble",
1697 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME
,
1698 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION
,
1700 SINGLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble
)
1703 "out-of-process-pdf",
1704 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME
,
1705 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION
,
1707 SINGLE_VALUE_TYPE(switches::kOutOfProcessPdf
)
1709 #if defined(OS_ANDROID)
1711 "enable-fast-text-autosizing",
1712 IDS_FLAGS_ENABLE_FAST_TEXT_AUTOSIZING_NAME
,
1713 IDS_FLAGS_ENABLE_FAST_TEXT_AUTOSIZING_DESCRIPTION
,
1715 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableFastTextAutosizing
,
1716 switches::kDisableFastTextAutosizing
)
1720 IDS_FLAGS_DISABLE_CAST_NAME
,
1721 IDS_FLAGS_DISABLE_CAST_DESCRIPTION
,
1723 SINGLE_VALUE_TYPE(switches::kDisableCast
)
1727 "prefetch-search-results",
1728 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME
,
1729 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION
,
1731 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults
)
1733 #if defined(ENABLE_APP_LIST)
1735 "enable-experimental-app-list",
1736 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME
,
1737 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION
,
1738 kOsWin
| kOsLinux
| kOsCrOS
,
1739 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList
)
1742 "enable-centered-app-list",
1743 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME
,
1744 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION
,
1745 kOsWin
| kOsLinux
| kOsCrOS
,
1746 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList
)
1750 "touch-scrolling-mode",
1751 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME
,
1752 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION
,
1753 kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
,
1754 MULTI_VALUE_TYPE(kTouchScrollingModeChoices
)
1757 "bleeding-edge-renderer-mode",
1758 IDS_FLAGS_BLEEDING_RENDERER_NAME
,
1759 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION
,
1761 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths
)
1764 "enable-settings-window",
1765 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME
,
1766 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION
,
1768 SINGLE_VALUE_TYPE(switches::kEnableSettingsWindow
)
1770 #if defined(OS_ANDROID)
1772 "enable-instant-search-clicks",
1773 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME
,
1774 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION
,
1776 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks
)
1780 "enable-save-password-bubble",
1781 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME
,
1782 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION
,
1783 kOsWin
| kOsLinux
| kOsCrOS
,
1784 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble
,
1785 switches::kDisableSavePasswordBubble
)
1787 #if defined(GOOGLE_CHROME_BUILD)
1789 "enable-easy-unlock",
1790 IDS_FLAGS_ENABLE_EASY_UNLOCK_NAME
,
1791 IDS_FLAGS_ENABLE_EASY_UNLOCK_DESCRIPTION
,
1793 SINGLE_VALUE_TYPE(switches::kEnableEasyUnlock
)
1797 "disable-embedded-shared-worker",
1798 IDS_FLAGS_DISABLE_EMBEDDED_SHARED_WORKER_NAME
,
1799 IDS_FLAGS_DISABLE_EMBEDDED_SHARED_WORKER_DESCRIPTION
,
1801 SINGLE_VALUE_TYPE(switches::kDisableEmbeddedSharedWorker
)
1803 #if defined(OS_CHROMEOS)
1805 "enable-filemanager-mtp",
1806 IDS_FLAGS_ENABLE_FILE_MANAGER_MTP_NAME
,
1807 IDS_FLAGS_ENABLE_FILE_MANAGER_MTP_DESCRIPTION
,
1809 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFileManagerMTP
)
1812 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1813 // crbug.com/366483 for the target milestone.
1815 "allow-insecure-websocket-from-https-origin",
1816 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME
,
1817 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION
,
1819 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin
)
1821 #if defined(OS_MACOSX)
1823 "apps-keep-chrome-alive",
1824 IDS_FLAGS_APPS_KEEP_CHROME_ALIVE_NAME
,
1825 IDS_FLAGS_APPS_KEEP_CHROME_ALIVE_DESCRIPTION
,
1827 SINGLE_VALUE_TYPE(switches::kAppsKeepChromeAlive
)
1831 "enable-apps-file-associations",
1832 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME
,
1833 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION
,
1835 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations
)
1837 #if defined(OS_ANDROID)
1839 "enable-embeddedsearch-api",
1840 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME
,
1841 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION
,
1843 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI
)
1846 "enable-app-install-alerts",
1847 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME
,
1848 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION
,
1850 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts
)
1855 const Experiment
* experiments
= kExperiments
;
1856 size_t num_experiments
= arraysize(kExperiments
);
1858 // Stores and encapsulates the little state that about:flags has.
1861 FlagsState() : needs_restart_(false) {}
1862 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
1863 CommandLine
* command_line
,
1864 SentinelsMode sentinels
);
1865 bool IsRestartNeededToCommitChanges();
1866 void SetExperimentEnabled(
1867 FlagsStorage
* flags_storage
,
1868 const std::string
& internal_name
,
1870 void RemoveFlagsSwitches(
1871 std::map
<std::string
, CommandLine::StringType
>* switch_list
);
1872 void ResetAllFlags(FlagsStorage
* flags_storage
);
1875 // Returns the singleton instance of this class
1876 static FlagsState
* GetInstance() {
1877 return Singleton
<FlagsState
>::get();
1881 bool needs_restart_
;
1882 std::map
<std::string
, std::string
> flags_switches_
;
1884 DISALLOW_COPY_AND_ASSIGN(FlagsState
);
1887 // Adds the internal names for the specified experiment to |names|.
1888 void AddInternalName(const Experiment
& e
, std::set
<std::string
>* names
) {
1889 if (e
.type
== Experiment::SINGLE_VALUE
) {
1890 names
->insert(e
.internal_name
);
1892 DCHECK(e
.type
== Experiment::MULTI_VALUE
||
1893 e
.type
== Experiment::ENABLE_DISABLE_VALUE
);
1894 for (int i
= 0; i
< e
.num_choices
; ++i
)
1895 names
->insert(e
.NameForChoice(i
));
1899 // Confirms that an experiment is valid, used in a DCHECK in
1900 // SanitizeList below.
1901 bool ValidateExperiment(const Experiment
& e
) {
1903 case Experiment::SINGLE_VALUE
:
1904 DCHECK_EQ(0, e
.num_choices
);
1907 case Experiment::MULTI_VALUE
:
1908 DCHECK_GT(e
.num_choices
, 0);
1910 DCHECK(e
.choices
[0].command_line_switch
);
1911 DCHECK_EQ('\0', e
.choices
[0].command_line_switch
[0]);
1913 case Experiment::ENABLE_DISABLE_VALUE
:
1914 DCHECK_EQ(3, e
.num_choices
);
1916 DCHECK(e
.command_line_switch
);
1917 DCHECK(e
.command_line_value
);
1918 DCHECK(e
.disable_command_line_switch
);
1919 DCHECK(e
.disable_command_line_value
);
1927 // Removes all experiments from prefs::kEnabledLabsExperiments that are
1928 // unknown, to prevent this list to become very long as experiments are added
1930 void SanitizeList(FlagsStorage
* flags_storage
) {
1931 std::set
<std::string
> known_experiments
;
1932 for (size_t i
= 0; i
< num_experiments
; ++i
) {
1933 DCHECK(ValidateExperiment(experiments
[i
]));
1934 AddInternalName(experiments
[i
], &known_experiments
);
1937 std::set
<std::string
> enabled_experiments
= flags_storage
->GetFlags();
1939 std::set
<std::string
> new_enabled_experiments
;
1940 std::set_intersection(
1941 known_experiments
.begin(), known_experiments
.end(),
1942 enabled_experiments
.begin(), enabled_experiments
.end(),
1943 std::inserter(new_enabled_experiments
, new_enabled_experiments
.begin()));
1945 if (new_enabled_experiments
!= enabled_experiments
)
1946 flags_storage
->SetFlags(new_enabled_experiments
);
1949 void GetSanitizedEnabledFlags(
1950 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
1951 SanitizeList(flags_storage
);
1952 *result
= flags_storage
->GetFlags();
1955 bool SkipConditionalExperiment(const Experiment
& experiment
) {
1956 if (experiment
.internal_name
==
1957 std::string("enhanced-bookmarks-experiment")) {
1958 CommandLine
* command_line
= CommandLine::ForCurrentProcess();
1959 // Dont't skip experiment if it has non default value.
1960 // It means user selected it.
1961 if (command_line
->HasSwitch(switches::kEnhancedBookmarksExperiment
))
1964 return !IsEnhancedBookmarksExperimentEnabled();
1966 if ((experiment
.internal_name
== std::string("manual-enhanced-bookmarks")) ||
1967 (experiment
.internal_name
==
1968 std::string("manual-enhanced-bookmarks-optout"))) {
1976 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1977 // enabled on the current platform.
1978 void GetSanitizedEnabledFlagsForCurrentPlatform(
1979 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
1980 GetSanitizedEnabledFlags(flags_storage
, result
);
1982 // Filter out any experiments that aren't enabled on the current platform. We
1983 // don't remove these from prefs else syncing to a platform with a different
1984 // set of experiments would be lossy.
1985 std::set
<std::string
> platform_experiments
;
1986 int current_platform
= GetCurrentPlatform();
1987 for (size_t i
= 0; i
< num_experiments
; ++i
) {
1988 if (experiments
[i
].supported_platforms
& current_platform
)
1989 AddInternalName(experiments
[i
], &platform_experiments
);
1990 #if defined(OS_CHROMEOS)
1991 if (experiments
[i
].supported_platforms
& kOsCrOSOwnerOnly
)
1992 AddInternalName(experiments
[i
], &platform_experiments
);
1996 std::set
<std::string
> new_enabled_experiments
;
1997 std::set_intersection(
1998 platform_experiments
.begin(), platform_experiments
.end(),
1999 result
->begin(), result
->end(),
2000 std::inserter(new_enabled_experiments
, new_enabled_experiments
.begin()));
2002 result
->swap(new_enabled_experiments
);
2005 // Returns the Value representing the choice data in the specified experiment.
2006 base::Value
* CreateChoiceData(
2007 const Experiment
& experiment
,
2008 const std::set
<std::string
>& enabled_experiments
) {
2009 DCHECK(experiment
.type
== Experiment::MULTI_VALUE
||
2010 experiment
.type
== Experiment::ENABLE_DISABLE_VALUE
);
2011 base::ListValue
* result
= new base::ListValue
;
2012 for (int i
= 0; i
< experiment
.num_choices
; ++i
) {
2013 base::DictionaryValue
* value
= new base::DictionaryValue
;
2014 const std::string name
= experiment
.NameForChoice(i
);
2015 value
->SetString("internal_name", name
);
2016 value
->SetString("description", experiment
.DescriptionForChoice(i
));
2017 value
->SetBoolean("selected", enabled_experiments
.count(name
) > 0);
2018 result
->Append(value
);
2025 std::string
Experiment::NameForChoice(int index
) const {
2026 DCHECK(type
== Experiment::MULTI_VALUE
||
2027 type
== Experiment::ENABLE_DISABLE_VALUE
);
2028 DCHECK_LT(index
, num_choices
);
2029 return std::string(internal_name
) + testing::kMultiSeparator
+
2030 base::IntToString(index
);
2033 base::string16
Experiment::DescriptionForChoice(int index
) const {
2034 DCHECK(type
== Experiment::MULTI_VALUE
||
2035 type
== Experiment::ENABLE_DISABLE_VALUE
);
2036 DCHECK_LT(index
, num_choices
);
2038 if (type
== Experiment::ENABLE_DISABLE_VALUE
) {
2039 const int kEnableDisableDescriptionIds
[] = {
2040 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
,
2041 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
2042 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
2044 description_id
= kEnableDisableDescriptionIds
[index
];
2046 description_id
= choices
[index
].description_id
;
2048 return l10n_util::GetStringUTF16(description_id
);
2051 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2052 CommandLine
* command_line
,
2053 SentinelsMode sentinels
) {
2054 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage
,
2059 bool AreSwitchesIdenticalToCurrentCommandLine(
2060 const CommandLine
& new_cmdline
, const CommandLine
& active_cmdline
) {
2061 std::set
<CommandLine::StringType
> new_flags
=
2062 ExtractFlagsFromCommandLine(new_cmdline
);
2063 std::set
<CommandLine::StringType
> active_flags
=
2064 ExtractFlagsFromCommandLine(active_cmdline
);
2066 // Needed because std::equal doesn't check if the 2nd set is empty.
2067 if (new_flags
.size() != active_flags
.size())
2070 return std::equal(new_flags
.begin(), new_flags
.end(), active_flags
.begin());
2073 void GetFlagsExperimentsData(FlagsStorage
* flags_storage
,
2075 base::ListValue
* supported_experiments
,
2076 base::ListValue
* unsupported_experiments
) {
2077 std::set
<std::string
> enabled_experiments
;
2078 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2080 int current_platform
= GetCurrentPlatform();
2082 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2083 const Experiment
& experiment
= experiments
[i
];
2084 if (SkipConditionalExperiment(experiment
))
2087 base::DictionaryValue
* data
= new base::DictionaryValue();
2088 data
->SetString("internal_name", experiment
.internal_name
);
2089 data
->SetString("name",
2090 l10n_util::GetStringUTF16(experiment
.visible_name_id
));
2091 data
->SetString("description",
2092 l10n_util::GetStringUTF16(
2093 experiment
.visible_description_id
));
2095 base::ListValue
* supported_platforms
= new base::ListValue();
2096 AddOsStrings(experiment
.supported_platforms
, supported_platforms
);
2097 data
->Set("supported_platforms", supported_platforms
);
2099 switch (experiment
.type
) {
2100 case Experiment::SINGLE_VALUE
:
2103 enabled_experiments
.count(experiment
.internal_name
) > 0);
2105 case Experiment::MULTI_VALUE
:
2106 case Experiment::ENABLE_DISABLE_VALUE
:
2107 data
->Set("choices", CreateChoiceData(experiment
, enabled_experiments
));
2113 bool supported
= (experiment
.supported_platforms
& current_platform
) != 0;
2114 #if defined(OS_CHROMEOS)
2115 if (access
== kOwnerAccessToFlags
&&
2116 (experiment
.supported_platforms
& kOsCrOSOwnerOnly
) != 0) {
2121 supported_experiments
->Append(data
);
2123 unsupported_experiments
->Append(data
);
2127 bool IsRestartNeededToCommitChanges() {
2128 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2131 void SetExperimentEnabled(FlagsStorage
* flags_storage
,
2132 const std::string
& internal_name
,
2134 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage
,
2135 internal_name
, enable
);
2138 void RemoveFlagsSwitches(
2139 std::map
<std::string
, CommandLine::StringType
>* switch_list
) {
2140 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list
);
2143 void ResetAllFlags(FlagsStorage
* flags_storage
) {
2144 FlagsState::GetInstance()->ResetAllFlags(flags_storage
);
2147 int GetCurrentPlatform() {
2148 #if defined(OS_MACOSX)
2150 #elif defined(OS_WIN)
2152 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2154 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2156 #elif defined(OS_ANDROID)
2159 #error Unknown platform
2163 void RecordUMAStatistics(FlagsStorage
* flags_storage
) {
2164 std::set
<std::string
> flags
= flags_storage
->GetFlags();
2165 for (std::set
<std::string
>::iterator it
= flags
.begin(); it
!= flags
.end();
2167 std::string
action("AboutFlags_");
2169 content::RecordComputedAction(action
);
2171 // Since flag metrics are recorded every startup, add a tick so that the
2172 // stats can be made meaningful.
2174 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
2175 content::RecordAction(UserMetricsAction("StartupTick"));
2178 //////////////////////////////////////////////////////////////////////////////
2179 // FlagsState implementation.
2183 typedef std::map
<std::string
, std::pair
<std::string
, std::string
> >
2184 NameToSwitchAndValueMap
;
2186 void SetFlagToSwitchMapping(const std::string
& key
,
2187 const std::string
& switch_name
,
2188 const std::string
& switch_value
,
2189 NameToSwitchAndValueMap
* name_to_switch_map
) {
2190 DCHECK(name_to_switch_map
->end() == name_to_switch_map
->find(key
));
2191 (*name_to_switch_map
)[key
] = std::make_pair(switch_name
, switch_value
);
2194 void FlagsState::ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2195 CommandLine
* command_line
,
2196 SentinelsMode sentinels
) {
2197 if (command_line
->HasSwitch(switches::kNoExperiments
))
2200 std::set
<std::string
> enabled_experiments
;
2202 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage
,
2203 &enabled_experiments
);
2205 NameToSwitchAndValueMap name_to_switch_map
;
2206 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2207 const Experiment
& e
= experiments
[i
];
2208 if (e
.type
== Experiment::SINGLE_VALUE
) {
2209 SetFlagToSwitchMapping(e
.internal_name
, e
.command_line_switch
,
2210 e
.command_line_value
, &name_to_switch_map
);
2211 } else if (e
.type
== Experiment::MULTI_VALUE
) {
2212 for (int j
= 0; j
< e
.num_choices
; ++j
) {
2213 SetFlagToSwitchMapping(e
.NameForChoice(j
),
2214 e
.choices
[j
].command_line_switch
,
2215 e
.choices
[j
].command_line_value
,
2216 &name_to_switch_map
);
2219 DCHECK_EQ(e
.type
, Experiment::ENABLE_DISABLE_VALUE
);
2220 SetFlagToSwitchMapping(e
.NameForChoice(0), std::string(), std::string(),
2221 &name_to_switch_map
);
2222 SetFlagToSwitchMapping(e
.NameForChoice(1), e
.command_line_switch
,
2223 e
.command_line_value
, &name_to_switch_map
);
2224 SetFlagToSwitchMapping(e
.NameForChoice(2), e
.disable_command_line_switch
,
2225 e
.disable_command_line_value
, &name_to_switch_map
);
2229 if (sentinels
== kAddSentinels
) {
2230 command_line
->AppendSwitch(switches::kFlagSwitchesBegin
);
2231 flags_switches_
.insert(
2232 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesBegin
,
2235 for (std::set
<std::string
>::iterator it
= enabled_experiments
.begin();
2236 it
!= enabled_experiments
.end();
2238 const std::string
& experiment_name
= *it
;
2239 NameToSwitchAndValueMap::const_iterator name_to_switch_it
=
2240 name_to_switch_map
.find(experiment_name
);
2241 if (name_to_switch_it
== name_to_switch_map
.end()) {
2246 const std::pair
<std::string
, std::string
>&
2247 switch_and_value_pair
= name_to_switch_it
->second
;
2249 CHECK(!switch_and_value_pair
.first
.empty());
2250 command_line
->AppendSwitchASCII(switch_and_value_pair
.first
,
2251 switch_and_value_pair
.second
);
2252 flags_switches_
[switch_and_value_pair
.first
] = switch_and_value_pair
.second
;
2254 if (sentinels
== kAddSentinels
) {
2255 command_line
->AppendSwitch(switches::kFlagSwitchesEnd
);
2256 flags_switches_
.insert(
2257 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesEnd
,
2262 bool FlagsState::IsRestartNeededToCommitChanges() {
2263 return needs_restart_
;
2266 void FlagsState::SetExperimentEnabled(FlagsStorage
* flags_storage
,
2267 const std::string
& internal_name
,
2269 size_t at_index
= internal_name
.find(testing::kMultiSeparator
);
2270 if (at_index
!= std::string::npos
) {
2272 // We're being asked to enable a multi-choice experiment. Disable the
2273 // currently selected choice.
2274 DCHECK_NE(at_index
, 0u);
2275 const std::string experiment_name
= internal_name
.substr(0, at_index
);
2276 SetExperimentEnabled(flags_storage
, experiment_name
, false);
2278 // And enable the new choice, if it is not the default first choice.
2279 if (internal_name
!= experiment_name
+ "@0") {
2280 std::set
<std::string
> enabled_experiments
;
2281 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2282 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2283 flags_storage
->SetFlags(enabled_experiments
);
2288 std::set
<std::string
> enabled_experiments
;
2289 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2291 const Experiment
* e
= NULL
;
2292 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2293 if (experiments
[i
].internal_name
== internal_name
) {
2294 e
= experiments
+ i
;
2300 if (e
->type
== Experiment::SINGLE_VALUE
) {
2302 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2304 needs_restart_
|= (enabled_experiments
.erase(internal_name
) > 0);
2307 // Enable the first choice.
2308 needs_restart_
|= enabled_experiments
.insert(e
->NameForChoice(0)).second
;
2310 // Find the currently enabled choice and disable it.
2311 for (int i
= 0; i
< e
->num_choices
; ++i
) {
2312 std::string choice_name
= e
->NameForChoice(i
);
2313 if (enabled_experiments
.find(choice_name
) !=
2314 enabled_experiments
.end()) {
2315 needs_restart_
= true;
2316 enabled_experiments
.erase(choice_name
);
2317 // Continue on just in case there's a bug and more than one
2318 // experiment for this choice was enabled.
2324 flags_storage
->SetFlags(enabled_experiments
);
2327 void FlagsState::RemoveFlagsSwitches(
2328 std::map
<std::string
, CommandLine::StringType
>* switch_list
) {
2329 for (std::map
<std::string
, std::string
>::const_iterator
2330 it
= flags_switches_
.begin(); it
!= flags_switches_
.end(); ++it
) {
2331 switch_list
->erase(it
->first
);
2335 void FlagsState::ResetAllFlags(FlagsStorage
* flags_storage
) {
2336 needs_restart_
= true;
2338 std::set
<std::string
> no_experiments
;
2339 flags_storage
->SetFlags(no_experiments
);
2342 void FlagsState::reset() {
2343 needs_restart_
= false;
2344 flags_switches_
.clear();
2351 // WARNING: '@' is also used in the html file. If you update this constant you
2352 // also need to update the html file.
2353 const char kMultiSeparator
[] = "@";
2356 FlagsState::GetInstance()->reset();
2359 void SetExperiments(const Experiment
* e
, size_t count
) {
2361 experiments
= kExperiments
;
2362 num_experiments
= arraysize(kExperiments
);
2365 num_experiments
= count
;
2369 const Experiment
* GetExperiments(size_t* count
) {
2370 *count
= num_experiments
;
2374 } // namespace testing
2376 } // namespace about_flags