[Android] Allow multiple --install in bb_device_steps.py.
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blobd38a6095976b214964e91eff3c26bb093b8a761c
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"
7 #include <iterator>
8 #include <map>
9 #include <set>
10 #include <utility>
12 #include "base/command_line.h"
13 #include "base/memory/singleton.h"
14 #include "base/metrics/sparse_histogram.h"
15 #include "base/stl_util.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h"
19 #include "base/values.h"
20 #include "cc/base/switches.h"
21 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
22 #include "chrome/browser/flags_storage.h"
23 #include "chrome/common/chrome_content_client.h"
24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/grit/generated_resources.h"
26 #include "components/autofill/core/common/autofill_switches.h"
27 #include "components/cloud_devices/common/cloud_devices_switches.h"
28 #include "components/metrics/metrics_hashes.h"
29 #include "components/nacl/common/nacl_switches.h"
30 #include "components/proximity_auth/switches.h"
31 #include "components/search/search_switches.h"
32 #include "content/public/browser/user_metrics.h"
33 #include "media/base/media_switches.h"
34 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/base/ui_base_switches.h"
36 #include "ui/display/display_switches.h"
37 #include "ui/events/event_switches.h"
38 #include "ui/gfx/switches.h"
39 #include "ui/gl/gl_switches.h"
40 #include "ui/keyboard/keyboard_switches.h"
41 #include "ui/native_theme/native_theme_switches.h"
42 #include "ui/views/views_switches.h"
44 #if defined(OS_ANDROID)
45 #include "chrome/common/chrome_version_info.h"
46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
47 #include "components/omnibox/omnibox_switches.h"
48 #else
49 #include "ui/message_center/message_center_switches.h"
50 #endif
52 #if defined(USE_ASH)
53 #include "ash/ash_switches.h"
54 #endif
56 #if defined(OS_CHROMEOS)
57 #include "chromeos/chromeos_switches.h"
58 #include "third_party/cros_system_api/switches/chrome_switches.h"
59 #endif
61 #if defined(ENABLE_APP_LIST)
62 #include "ui/app_list/app_list_switches.h"
63 #endif
65 #if defined(ENABLE_EXTENSIONS)
66 #include "extensions/common/switches.h"
67 #endif
69 namespace about_flags {
71 // Macros to simplify specifying the type.
72 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
73 Experiment::SINGLE_VALUE, \
74 command_line_switch, switch_value, NULL, NULL, NULL, 0
75 #define SINGLE_VALUE_TYPE(command_line_switch) \
76 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
77 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
78 disable_switch, disable_value) \
79 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
80 disable_switch, disable_value, NULL, 3
81 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
82 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
83 #define MULTI_VALUE_TYPE(choices) \
84 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
86 namespace {
88 // Enumeration of OSs.
89 enum {
90 kOsMac = 1 << 0,
91 kOsWin = 1 << 1,
92 kOsLinux = 1 << 2,
93 kOsCrOS = 1 << 3,
94 kOsAndroid = 1 << 4,
95 kOsCrOSOwnerOnly = 1 << 5
98 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
99 const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
101 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
102 // whether the experiment is available on that platform.
103 void AddOsStrings(unsigned bitmask, base::ListValue* list) {
104 struct {
105 unsigned bit;
106 const char* const name;
107 } kBitsToOs[] = {
108 {kOsMac, "Mac"},
109 {kOsWin, "Windows"},
110 {kOsLinux, "Linux"},
111 {kOsCrOS, "Chrome OS"},
112 {kOsAndroid, "Android"},
113 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
115 for (size_t i = 0; i < arraysize(kBitsToOs); ++i) {
116 if (bitmask & kBitsToOs[i].bit)
117 list->Append(new base::StringValue(kBitsToOs[i].name));
121 // Convert switch constants to proper CommandLine::StringType strings.
122 CommandLine::StringType GetSwitchString(const std::string& flag) {
123 CommandLine cmd_line(CommandLine::NO_PROGRAM);
124 cmd_line.AppendSwitch(flag);
125 DCHECK_EQ(2U, cmd_line.argv().size());
126 return cmd_line.argv()[1];
129 // Scoops flags from a command line.
130 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine(
131 const CommandLine& cmdline) {
132 std::set<CommandLine::StringType> flags;
133 // First do the ones between --flag-switches-begin and --flag-switches-end.
134 CommandLine::StringVector::const_iterator first =
135 std::find(cmdline.argv().begin(), cmdline.argv().end(),
136 GetSwitchString(switches::kFlagSwitchesBegin));
137 CommandLine::StringVector::const_iterator last =
138 std::find(cmdline.argv().begin(), cmdline.argv().end(),
139 GetSwitchString(switches::kFlagSwitchesEnd));
140 if (first != cmdline.argv().end() && last != cmdline.argv().end())
141 flags.insert(first + 1, last);
142 #if defined(OS_CHROMEOS)
143 // Then add those between --policy-switches-begin and --policy-switches-end.
144 first = std::find(cmdline.argv().begin(), cmdline.argv().end(),
145 GetSwitchString(chromeos::switches::kPolicySwitchesBegin));
146 last = std::find(cmdline.argv().begin(), cmdline.argv().end(),
147 GetSwitchString(chromeos::switches::kPolicySwitchesEnd));
148 if (first != cmdline.argv().end() && last != cmdline.argv().end())
149 flags.insert(first + 1, last);
150 #endif
151 return flags;
154 const Experiment::Choice kTouchEventsChoices[] = {
155 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
156 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
157 switches::kTouchEvents,
158 switches::kTouchEventsEnabled },
159 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
160 switches::kTouchEvents,
161 switches::kTouchEventsDisabled }
164 #if defined(USE_AURA)
165 const Experiment::Choice kOverscrollHistoryNavigationChoices[] = {
166 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, "", "" },
167 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
168 switches::kOverscrollHistoryNavigation,
169 "0" },
170 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI,
171 switches::kOverscrollHistoryNavigation,
172 "2" }
174 #endif
176 #if !defined(DISABLE_NACL)
177 const Experiment::Choice kNaClDebugMaskChoices[] = {
178 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
179 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
180 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
181 // so by default we want to avoid debugging that.
182 // NOTE: As the default value must be the empty string, the mask excluding
183 // the PNaCl translator and secure shell is substituted elsewhere.
184 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
185 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
186 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
187 switches::kNaClDebugMask, "*://*/*debug.nmf" }
189 #endif
191 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
192 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
193 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
194 cc::switches::kMaxTilesForInterestArea, "64"},
195 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
196 cc::switches::kMaxTilesForInterestArea, "128"},
197 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
198 cc::switches::kMaxTilesForInterestArea, "256"},
199 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
200 cc::switches::kMaxTilesForInterestArea, "512"}
203 const Experiment::Choice kDefaultTileWidthChoices[] = {
204 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
205 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
206 switches::kDefaultTileWidth, "128"},
207 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
208 switches::kDefaultTileWidth, "256"},
209 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
210 switches::kDefaultTileWidth, "512"},
211 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
212 switches::kDefaultTileWidth, "1024"}
215 const Experiment::Choice kDefaultTileHeightChoices[] = {
216 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
217 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
218 switches::kDefaultTileHeight, "128"},
219 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
220 switches::kDefaultTileHeight, "256"},
221 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
222 switches::kDefaultTileHeight, "512"},
223 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
224 switches::kDefaultTileHeight, "1024"}
227 const Experiment::Choice kSimpleCacheBackendChoices[] = {
228 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
229 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
230 switches::kUseSimpleCacheBackend, "off" },
231 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
232 switches::kUseSimpleCacheBackend, "on"}
235 #if defined(USE_AURA)
236 const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
237 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
238 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
239 switches::kTabCaptureUpscaleQuality, "fast" },
240 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
241 switches::kTabCaptureUpscaleQuality, "good" },
242 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
243 switches::kTabCaptureUpscaleQuality, "best" },
246 const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
247 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
248 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
249 switches::kTabCaptureDownscaleQuality, "fast" },
250 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
251 switches::kTabCaptureDownscaleQuality, "good" },
252 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
253 switches::kTabCaptureDownscaleQuality, "best" },
255 #endif
257 #if defined(OS_ANDROID)
258 const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
259 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
260 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
261 switches::kEnableZeroSuggestMostVisited, ""},
262 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED_WITHOUT_SERP,
263 switches::kEnableZeroSuggestMostVisitedWithoutSerp, ""},
264 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
265 switches::kDisableZeroSuggest, ""}
267 #endif
269 const Experiment::Choice kNumRasterThreadsChoices[] = {
270 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
271 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
272 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
273 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
274 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
277 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
278 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
279 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
280 switches::kEnableGpuRasterization, "" },
281 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
282 switches::kDisableGpuRasterization, "" },
283 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
284 switches::kForceGpuRasterization, "" },
287 // We're using independent flags here (as opposed to a common flag with
288 // different values) to be able to enable/disable the entire experience
289 // associated with this feature server-side from the FieldTrial (the complete
290 // experience includes other flag changes as well). It is not currently possible
291 // to do that with "flag=value" flags.
292 const Experiment::Choice kSearchButtonInOmniboxChoices[] = {
293 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
294 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
295 switches::kDisableSearchButtonInOmnibox, ""},
296 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR,
297 switches::kEnableSearchButtonInOmniboxForStr, ""},
298 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR_OR_IIP,
299 switches::kEnableSearchButtonInOmniboxForStrOrIip, ""},
300 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLED,
301 switches::kEnableSearchButtonInOmniboxAlways, ""}
304 // See comment above for kSearchButtonInOmniboxChoices. The same reasoning
305 // applies here.
306 const Experiment::Choice kOriginChipChoices[] = {
307 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
308 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kDisableOriginChip, ""},
309 { IDS_FLAGS_ORIGIN_CHIP_ALWAYS, switches::kEnableOriginChipAlways, ""},
310 { IDS_FLAGS_ORIGIN_CHIP_ON_SRP, switches::kEnableOriginChipOnSrp, ""}
313 const Experiment::Choice kTouchScrollingModeChoices[] = {
314 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
315 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL,
316 switches::kTouchScrollingMode,
317 switches::kTouchScrollingModeTouchcancel },
318 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE,
319 switches::kTouchScrollingMode,
320 switches::kTouchScrollingModeAsyncTouchmove },
321 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE,
322 switches::kTouchScrollingMode,
323 switches::kTouchScrollingModeSyncTouchmove },
326 const Experiment::Choice kExtensionContentVerificationChoices[] = {
327 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
328 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
329 switches::kExtensionContentVerification,
330 switches::kExtensionContentVerificationBootstrap },
331 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
332 switches::kExtensionContentVerification,
333 switches::kExtensionContentVerificationEnforce },
334 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
335 switches::kExtensionContentVerification,
336 switches::kExtensionContentVerificationEnforceStrict },
339 // Note that the value is specified in seconds (where 0 is equivalent to
340 // disabled).
341 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
342 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
343 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
344 switches::kRememberCertErrorDecisions,
345 "-1" },
346 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
347 switches::kRememberCertErrorDecisions,
348 "86400" },
349 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
350 switches::kRememberCertErrorDecisions,
351 "259200" },
352 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
353 switches::kRememberCertErrorDecisions,
354 "604800" },
355 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
356 switches::kRememberCertErrorDecisions,
357 "2592000" },
358 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
359 switches::kRememberCertErrorDecisions,
360 "7776000" },
363 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
364 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
365 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
366 password_manager::switches::kAllowAutofillSyncCredential, ""},
367 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
368 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
369 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
370 password_manager::switches::kDisallowAutofillSyncCredential, ""},
373 const Experiment::Choice kSSLVersionMinChoices[] = {
374 { IDS_FLAGS_SSL_VERSION_DEFAULT, "", "" },
375 { IDS_FLAGS_SSL_VERSION_SSLV3, switches::kSSLVersionMin,
376 switches::kSSLVersionSSLv3 },
377 { IDS_FLAGS_SSL_VERSION_TLSV1, switches::kSSLVersionMin,
378 switches::kSSLVersionTLSv1 },
379 { IDS_FLAGS_SSL_VERSION_TLSV11, switches::kSSLVersionMin,
380 switches::kSSLVersionTLSv11 },
381 { IDS_FLAGS_SSL_VERSION_TLSV12, switches::kSSLVersionMin,
382 switches::kSSLVersionTLSv12 },
385 // RECORDING USER METRICS FOR FLAGS:
386 // -----------------------------------------------------------------------------
387 // The first line of the experiment is the internal name. If you'd like to
388 // gather statistics about the usage of your flag, you should append a marker
389 // comment to the end of the feature name, like so:
390 // "my-special-feature", // FLAGS:RECORD_UMA
392 // After doing that, run
393 // tools/metrics/actions/extract_actions.py
394 // to add the metric to actions.xml (which will enable UMA to record your
395 // feature flag), then update the <owner>s and <description> sections. Make sure
396 // to include the actions.xml file when you upload your code for review!
398 // After your feature has shipped under a flag, you can locate the metrics under
399 // the action name AboutFlags_internal-action-name. Actions are recorded once
400 // per startup, so you should divide this number by AboutFlags_StartupTick to
401 // get a sense of usage. Note that this will not be the same as number of users
402 // with a given feature enabled because users can quit and relaunch the
403 // application multiple times over a given time interval. The dashboard also
404 // shows you how many (metrics reporting) users have enabled the flag over the
405 // last seven days. However, note that this is not the same as the number of
406 // users who have the flag enabled, since enabling the flag happens once,
407 // whereas running with the flag enabled happens until the user flips the flag
408 // again.
410 // To add a new experiment add to the end of kExperiments. There are two
411 // distinct types of experiments:
412 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
413 // macro for this type supplying the command line to the macro.
414 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
415 // deactivated state for this lab (i.e. no command line option). To specify
416 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
417 // array of choices.
418 // See the documentation of Experiment for details on the fields.
420 // Command-line switches must have entries in enum "LoginCustomFlags" in
421 // histograms.xml. See note in histograms.xml and don't forget to run
422 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
424 // When adding a new choice, add it to the end of the list.
425 const Experiment kExperiments[] = {
427 "ignore-gpu-blacklist",
428 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
429 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
430 kOsAll,
431 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
434 "disable_layer_squashing",
435 IDS_FLAGS_DISABLE_LAYER_SQUASHING_NAME,
436 IDS_FLAGS_DISABLE_LAYER_SQUASHING_DESCRIPTION,
437 kOsAll,
438 SINGLE_VALUE_TYPE(switches::kDisableLayerSquashing)
440 #if defined(OS_WIN)
442 "disable-direct-write",
443 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
444 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
445 kOsWin,
446 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
448 #endif
450 "enable-experimental-canvas-features",
451 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
452 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
453 kOsAll,
454 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
457 "disable-accelerated-2d-canvas",
458 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
459 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
460 kOsAll,
461 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
464 "enable-display-list-2d-canvas",
465 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
466 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
467 kOsAll,
468 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas,
469 switches::kDisableDisplayList2dCanvas)
472 "composited-layer-borders",
473 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
474 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
475 kOsAll,
476 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
479 "show-fps-counter",
480 IDS_FLAGS_SHOW_FPS_COUNTER,
481 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
482 kOsAll,
483 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
486 "disable-webgl",
487 IDS_FLAGS_DISABLE_WEBGL_NAME,
488 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
489 kOsAll,
490 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
493 "disable-webrtc",
494 IDS_FLAGS_DISABLE_WEBRTC_NAME,
495 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
496 kOsAndroid,
497 #if defined(OS_ANDROID)
498 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
499 #else
500 SINGLE_VALUE_TYPE("")
501 #endif
503 #if defined(ENABLE_WEBRTC)
505 "disable-webrtc-hw-decoding",
506 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
507 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
508 kOsAndroid | kOsCrOS,
509 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
512 "disable-webrtc-hw-encoding",
513 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
514 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
515 kOsAndroid | kOsCrOS,
516 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
518 #endif
519 #if defined(OS_ANDROID)
521 "disable-webaudio",
522 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
523 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
524 kOsAndroid,
525 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
527 #endif
529 "enable-compositing-for-transition",
530 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME,
531 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION,
532 kOsAll,
533 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableCompositingForTransition,
534 switches::kDisableCompositingForTransition)
536 // Native client is compiled out when DISABLE_NACL is defined.
537 #if !defined(DISABLE_NACL)
539 "enable-nacl", // FLAGS:RECORD_UMA
540 IDS_FLAGS_ENABLE_NACL_NAME,
541 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
542 kOsAll,
543 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
546 "enable-nacl-debug", // FLAGS:RECORD_UMA
547 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
548 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
549 kOsDesktop,
550 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
553 "nacl-debug-mask", // FLAGS:RECORD_UMA
554 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
555 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
556 kOsDesktop,
557 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
559 #endif
560 #if defined(ENABLE_EXTENSIONS)
562 "extension-apis", // FLAGS:RECORD_UMA
563 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
564 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
565 kOsDesktop,
566 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
569 "extensions-on-chrome-urls",
570 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
571 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
572 kOsAll,
573 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
575 #endif
577 "enable-fast-unload",
578 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
579 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
580 kOsAll,
581 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
583 #if defined(ENABLE_EXTENSIONS)
585 "enable-app-window-controls",
586 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
587 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
588 kOsDesktop,
589 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
591 #endif
593 "disable-hyperlink-auditing",
594 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
595 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
596 kOsAll,
597 SINGLE_VALUE_TYPE(switches::kNoPings)
599 #if defined(OS_ANDROID)
601 "contextual-search",
602 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
603 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
604 kOsAndroid,
605 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
606 switches::kDisableContextualSearch)
608 #endif
610 "show-autofill-type-predictions",
611 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
612 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
613 kOsAll,
614 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
617 "disambiguate-autofill-server-name-types",
618 IDS_FLAGS_DISAMBIGUATE_SERVER_NAME_TYPES_NAME,
619 IDS_FLAGS_DISAMBIGUATE_SERVER_NAME_TYPES_DESCRIPTION,
620 kOsAll,
621 ENABLE_DISABLE_VALUE_TYPE(
622 autofill::switches::kDisambiguateAutofillServerNameTypes,
623 autofill::switches::kTrustAutofillServerNameTypes)
626 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
627 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
628 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
629 // Can't expose the switch unless the code is compiled in.
630 // On by default for the Mac (different implementation in WebKit).
631 kOsLinux,
632 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
634 #if defined(USE_AURA) || defined(OS_LINUX)
636 "overlay-scrollbars",
637 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
638 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
639 // Uses the system preference on Mac (a different implementation).
640 // On Android, this is always enabled.
641 kOsLinux | kOsCrOS | kOsWin,
642 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar,
643 switches::kDisableOverlayScrollbar)
645 #endif
647 "enable-panels",
648 IDS_FLAGS_ENABLE_PANELS_NAME,
649 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
650 kOsDesktop,
651 SINGLE_VALUE_TYPE(switches::kEnablePanels)
654 // See http://crbug.com/120416 for how to remove this flag.
655 "save-page-as-mhtml", // FLAGS:RECORD_UMA
656 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
657 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
658 kOsMac | kOsWin | kOsLinux,
659 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
662 "enable-quic",
663 IDS_FLAGS_ENABLE_QUIC_NAME,
664 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
665 kOsAll,
666 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
667 switches::kDisableQuic)
670 "enable-spdy4",
671 IDS_FLAGS_ENABLE_SPDY4_NAME,
672 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
673 kOsAll,
674 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
677 "enable-async-dns",
678 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
679 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
680 kOsWin | kOsMac | kOsLinux | kOsCrOS,
681 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
682 switches::kDisableAsyncDns)
685 "disable-media-source",
686 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
687 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
688 kOsAll,
689 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
692 "enable-encrypted-media",
693 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
694 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
695 kOsAll,
696 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
699 "disable-prefixed-encrypted-media",
700 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
701 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
702 kOsAll,
703 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
705 #if defined(OS_ANDROID)
707 "disable-infobar-for-protected-media-identifier",
708 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
709 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
710 kOsAndroid,
711 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
714 "mediadrm-enable-non-compositing",
715 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME,
716 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION,
717 kOsAndroid,
718 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing)
720 #endif // defined(OS_ANDROID)
722 "enable-javascript-harmony",
723 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
724 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
725 kOsAll,
726 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
729 "disable-software-rasterizer",
730 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
731 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
732 #if defined(ENABLE_SWIFTSHADER)
733 kOsAll,
734 #else
736 #endif
737 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
740 "enable-gpu-rasterization",
741 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
742 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
743 kOsAndroid,
744 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
747 "enable-experimental-web-platform-features",
748 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
749 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
750 kOsAll,
751 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
754 "disable-ntp-other-sessions-menu",
755 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
756 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
757 kOsDesktop,
758 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
761 "enable-material-design-ntp",
762 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_NAME,
763 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_DESCRIPTION,
764 kOsDesktop,
765 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMaterialDesignNTP,
766 switches::kDisableMaterialDesignNTP)
769 "enable-devtools-experiments",
770 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
771 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
772 kOsDesktop,
773 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
776 "silent-debugger-extension-api",
777 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
778 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
779 kOsDesktop,
780 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
782 #if defined(ENABLE_SPELLCHECK)
784 "spellcheck-autocorrect",
785 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
786 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
787 kOsWin | kOsLinux | kOsCrOS,
788 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
790 #endif
792 "enable-scroll-prediction",
793 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
794 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
795 kOsDesktop,
796 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
799 "touch-events",
800 IDS_TOUCH_EVENTS_NAME,
801 IDS_TOUCH_EVENTS_DESCRIPTION,
802 kOsDesktop,
803 MULTI_VALUE_TYPE(kTouchEventsChoices)
806 "disable-touch-adjustment",
807 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
808 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
809 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
810 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
812 #if defined(OS_CHROMEOS)
814 "network-portal-notification",
815 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
816 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
817 kOsCrOS,
818 ENABLE_DISABLE_VALUE_TYPE(
819 chromeos::switches::kEnableNetworkPortalNotification,
820 chromeos::switches::kDisableNetworkPortalNotification)
822 #endif
824 "enable-download-resumption",
825 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
826 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
827 kOsDesktop,
828 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
830 #if defined(ENABLE_PLUGINS)
832 "allow-nacl-socket-api",
833 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
834 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
835 kOsDesktop,
836 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
838 #endif
839 #if defined(OS_CHROMEOS)
841 "allow-touchpad-three-finger-click",
842 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
843 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
844 kOsCrOS,
845 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
848 "easy-unlock",
849 IDS_FLAGS_EASY_UNLOCK_NAME,
850 IDS_FLAGS_EASY_UNLOCK_DESCRIPTION,
851 kOsCrOS,
852 ENABLE_DISABLE_VALUE_TYPE(proximity_auth::switches::kEnableEasyUnlock,
853 proximity_auth::switches::kDisableEasyUnlock)
856 "easy-signin",
857 IDS_FLAGS_EASY_SIGNIN_NAME,
858 IDS_FLAGS_EASY_SIGNIN_DESCRIPTION,
859 kOsCrOSOwnerOnly,
860 ENABLE_DISABLE_VALUE_TYPE(proximity_auth::switches::kEnableEasySignin,
861 proximity_auth::switches::kDisableEasySignin)
864 "enable-easy-unlock-proximity-detection",
865 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
866 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
867 kOsCrOS,
868 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)
870 #endif
871 #if defined(USE_ASH)
873 "disable-minimize-on-second-launcher-item-click",
874 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
875 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
876 kOsAll,
877 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
880 "show-touch-hud",
881 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
882 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
883 kOsAll,
884 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
887 "enable-pinch",
888 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
889 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
890 kOsLinux | kOsWin | kOsCrOS,
891 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
893 #endif // defined(USE_ASH)
895 "enable-pinch-virtual-viewport",
896 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
897 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
898 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
899 ENABLE_DISABLE_VALUE_TYPE(
900 cc::switches::kEnablePinchVirtualViewport,
901 cc::switches::kDisablePinchVirtualViewport),
904 "enable-viewport-meta",
905 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
906 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
907 kOsLinux | kOsWin | kOsCrOS | kOsMac,
908 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
910 #if defined(OS_CHROMEOS)
912 "disable-boot-animation",
913 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
914 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
915 kOsCrOSOwnerOnly,
916 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
919 "enable-video-player-chromecast-support",
920 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
921 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
922 kOsCrOS,
923 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
926 "disable-office-editing-component-app",
927 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
928 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
929 kOsCrOS,
930 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
933 "disable-display-color-calibration",
934 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
935 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
936 kOsCrOS,
937 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
939 #endif // defined(OS_CHROMEOS)
940 { "disable-accelerated-video-decode",
941 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
942 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
943 kOsWin | kOsCrOS,
944 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
946 #if defined(USE_ASH)
948 "ash-debug-shortcuts",
949 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
950 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
951 kOsAll,
952 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
954 { "ash-enable-touch-view-testing",
955 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
956 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
957 kOsCrOS,
958 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
961 "disable-touch-feedback",
962 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
963 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
964 kOsCrOS,
965 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
967 { "ash-disable-text-filtering-in-overview-mode",
968 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_NAME,
969 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_DESCRIPTION,
970 kOsCrOS,
971 SINGLE_VALUE_TYPE(ash::switches::kAshDisableTextFilteringInOverviewMode),
973 { "ash-enable-mirrored-screen",
974 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
975 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
976 kOsCrOS,
977 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
979 #endif // defined(USE_ASH)
980 #if defined(OS_CHROMEOS)
982 "enable-carrier-switching",
983 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
984 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
985 kOsCrOS,
986 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
989 "enable-cloud-backup",
990 IDS_FLAGS_ENABLE_CLOUD_BACKUP,
991 IDS_FLAGS_ENABLE_CLOUD_BACKUP_DESCRIPTION,
992 kOsCrOS,
993 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCloudBackup)
996 "enable-request-tablet-site",
997 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
998 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
999 kOsCrOS,
1000 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
1002 #endif
1004 "debug-packed-apps",
1005 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1006 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1007 kOsDesktop,
1008 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1011 "enable-password-generation",
1012 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1013 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1014 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1015 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1016 autofill::switches::kDisablePasswordGeneration)
1019 "enable-automatic-password-saving",
1020 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1021 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1022 kOsDesktop,
1023 SINGLE_VALUE_TYPE(
1024 password_manager::switches::kEnableAutomaticPasswordSaving)
1027 "password-manager-reauthentication",
1028 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1029 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1030 kOsMac | kOsWin,
1031 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
1034 "enable-password-link",
1035 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1036 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1037 kOsAndroid | kOsDesktop,
1038 ENABLE_DISABLE_VALUE_TYPE(
1039 password_manager::switches::kEnablePasswordLink,
1040 password_manager::switches::kDisablePasswordLink)
1043 "enable-deferred-image-decoding",
1044 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1045 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1046 kOsMac | kOsLinux | kOsCrOS,
1047 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1050 "wallet-service-use-sandbox",
1051 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1052 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1053 kOsAndroid | kOsDesktop,
1054 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1055 autofill::switches::kWalletServiceUseSandbox, "1",
1056 autofill::switches::kWalletServiceUseSandbox, "0")
1058 #if defined(USE_AURA)
1060 "overscroll-history-navigation",
1061 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1062 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1063 kOsAll,
1064 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
1066 #endif
1068 "scroll-end-effect",
1069 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1070 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1071 kOsCrOS,
1072 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1073 switches::kScrollEndEffect, "1",
1074 switches::kScrollEndEffect, "0")
1077 "enable-renderer-mojo-channel",
1078 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_NAME,
1079 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_DESCRIPTION,
1080 kOsAll,
1081 SINGLE_VALUE_TYPE(switches::kEnableRendererMojoChannel)
1084 "enable-touch-drag-drop",
1085 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1086 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1087 kOsWin | kOsCrOS,
1088 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1089 switches::kDisableTouchDragDrop)
1092 "enable-touch-editing",
1093 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1094 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1095 kOsCrOS | kOsWin | kOsLinux,
1096 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1097 switches::kDisableTouchEditing)
1100 "enable-stale-while-revalidate",
1101 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME,
1102 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION,
1103 kOsAll,
1104 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate)
1107 "enable-suggestions-service",
1108 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1109 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1110 kOsAndroid | kOsCrOS,
1111 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1112 switches::kDisableSuggestionsService)
1115 "enable-supervised-user-blacklist",
1116 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1117 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1118 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1119 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist,
1120 switches::kDisableSupervisedUserBlacklist)
1123 "enable-supervised-user-safesites",
1124 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME,
1125 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1126 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1127 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites,
1128 switches::kDisableSupervisedUserSafeSites)
1131 "enable-sync-synced-notifications",
1132 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1133 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
1134 kOsDesktop,
1135 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1136 switches::kDisableSyncSyncedNotifications)
1138 #if defined(ENABLE_APP_LIST)
1140 "enable-sync-app-list",
1141 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1142 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1143 kOsDesktop,
1144 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1145 app_list::switches::kDisableSyncAppList)
1147 #endif
1148 #if defined(OS_MACOSX)
1150 "enable-avfoundation",
1151 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1152 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1153 kOsMac,
1154 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1155 switches::kForceQTKit)
1157 #endif
1159 "impl-side-painting",
1160 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1161 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
1162 kOsAll,
1163 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableImplSidePainting,
1164 switches::kDisableImplSidePainting)
1167 "lcd-text-aa",
1168 IDS_FLAGS_LCD_TEXT_NAME,
1169 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1170 kOsDesktop,
1171 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1172 switches::kDisableLCDText)
1174 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1176 "delegated-renderer",
1177 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1178 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1179 kOsAndroid, // TODO(ccameron) Add mac support soon.
1180 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1181 switches::kDisableDelegatedRenderer)
1183 #endif
1185 "max-tiles-for-interest-area",
1186 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1187 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1188 kOsAll,
1189 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1192 "enable-offline-auto-reload",
1193 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1194 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1195 kOsAll,
1196 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1197 switches::kDisableOfflineAutoReload)
1200 "enable-offline-auto-reload-visible-only",
1201 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1202 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1203 kOsAll,
1204 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1205 switches::kDisableOfflineAutoReloadVisibleOnly)
1208 "enable-offline-load-stale-cache",
1209 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME,
1210 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION,
1211 kOsAll,
1212 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache,
1213 switches::kDisableOfflineLoadStaleCache)
1216 "default-tile-width",
1217 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1218 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1219 kOsAll,
1220 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1223 "default-tile-height",
1224 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1225 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1226 kOsAll,
1227 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1229 #if defined(OS_ANDROID)
1231 "disable-gesture-requirement-for-media-playback",
1232 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1233 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1234 kOsAndroid,
1235 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1237 #endif
1238 #if defined(ENABLE_EXTENSIONS)
1240 "disable-extension-info-dialog",
1241 IDS_FLAGS_DISABLE_EXTENSION_INFO_DIALOG_NAME,
1242 IDS_FLAGS_DISABLE_EXTENSION_INFO_DIALOG_DESCRIPTION,
1243 kOsWin | kOsLinux | kOsCrOS,
1244 SINGLE_VALUE_TYPE(extensions::switches::kDisableExtensionInfoDialog)
1246 #endif
1247 #if defined(OS_CHROMEOS)
1249 "enable-virtual-keyboard",
1250 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1251 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1252 kOsCrOS,
1253 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1256 "enable-virtual-keyboard-overscroll",
1257 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1258 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1259 kOsCrOS,
1260 ENABLE_DISABLE_VALUE_TYPE(
1261 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1262 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1265 "enable-swipe-selection",
1266 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1267 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1268 kOsCrOS,
1269 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1272 "enable-input-view",
1273 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1274 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1275 kOsCrOS,
1276 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1277 keyboard::switches::kDisableInputView)
1280 "enable-new-korean-ime",
1281 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_NAME,
1282 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_DESCRIPTION,
1283 kOsCrOS,
1284 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewKoreanIme)
1287 "enable-physical-keyboard-autocorrect",
1288 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1289 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1290 kOsCrOS,
1291 SINGLE_VALUE_TYPE(chromeos::switches::kEnablePhysicalKeyboardAutocorrect)
1294 "enable-experimental-input-view-features",
1295 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1296 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1297 kOsCrOS,
1298 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1301 "auto-virtual-keyboard",
1302 IDS_FLAGS_AUTO_VIRTUAL_KEYBOARD_NAME,
1303 IDS_FLAGS_AUTO_VIRTUAL_KEYBOARD_DESCRIPTION,
1304 kOsCrOS,
1305 SINGLE_VALUE_TYPE(keyboard::switches::kAutoVirtualKeyboard)
1307 #endif
1309 "enable-simple-cache-backend",
1310 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1311 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1312 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1313 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1316 "enable-tcp-fast-open",
1317 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1318 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1319 kOsLinux | kOsCrOS | kOsAndroid,
1320 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1322 #if defined(ENABLE_SERVICE_DISCOVERY)
1324 "device-discovery-notifications",
1325 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1326 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1327 kOsDesktop,
1328 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1329 switches::kDisableDeviceDiscoveryNotifications)
1332 "enable-cloud-devices",
1333 IDS_FLAGS_ENABLE_CLOUD_DEVICES_NAME,
1334 IDS_FLAGS_ENABLE_CLOUD_DEVICES_DESCRIPTION,
1335 kOsDesktop,
1336 SINGLE_VALUE_TYPE(switches::kEnableCloudDevices)
1339 "enable-print-preview-register-promos",
1340 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1341 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1342 kOsDesktop,
1343 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1345 #endif // ENABLE_SERVICE_DISCOVERY
1346 #if defined(OS_WIN)
1348 "enable-cloud-print-xps",
1349 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1350 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1351 kOsWin,
1352 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1354 #endif
1355 #if defined(USE_AURA)
1357 "tab-capture-upscale-quality",
1358 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1359 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1360 kOsAll,
1361 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1364 "tab-capture-downscale-quality",
1365 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1366 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1367 kOsAll,
1368 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1370 #endif
1371 #if defined(ENABLE_SPELLCHECK)
1373 "enable-spelling-feedback-field-trial",
1374 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1375 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1376 kOsAll,
1377 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)
1379 #endif
1381 "enable-webgl-draft-extensions",
1382 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1383 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1384 kOsAll,
1385 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1388 "enable-web-midi",
1389 IDS_FLAGS_ENABLE_WEB_MIDI_NAME,
1390 IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION,
1391 kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1392 SINGLE_VALUE_TYPE(switches::kEnableWebMIDI)
1395 "enable-new-profile-management",
1396 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1397 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1398 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1399 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1400 switches::kDisableNewProfileManagement)
1403 "enable-account-consistency",
1404 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1405 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1406 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1407 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1408 switches::kDisableAccountConsistency)
1411 "enable-fast-user-switching",
1412 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1413 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1414 kOsMac | kOsWin | kOsLinux,
1415 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1418 "enable-new-avatar-menu",
1419 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1420 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1421 kOsMac | kOsWin | kOsLinux,
1422 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1423 switches::kDisableNewAvatarMenu)
1426 "enable-web-based-signin",
1427 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_NAME,
1428 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_DESCRIPTION,
1429 kOsMac | kOsWin | kOsLinux,
1430 SINGLE_VALUE_TYPE(switches::kEnableWebBasedSignin)
1433 "enable-webview-based-signin",
1434 IDS_FLAGS_ENABLE_WEBVIEW_BASED_SIGNIN_NAME,
1435 IDS_FLAGS_ENABLE_WEBVIEW_BASED_SIGNIN_DESCRIPTION,
1436 kOsMac | kOsWin | kOsLinux,
1437 SINGLE_VALUE_TYPE(switches::kEnableWebviewBasedSignin)
1440 "enable-google-profile-info",
1441 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1442 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1443 kOsMac | kOsWin | kOsLinux,
1444 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
1447 "reset-app-list-install-state",
1448 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1449 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1450 kOsMac | kOsWin | kOsLinux,
1451 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
1453 #if defined(ENABLE_APP_LIST)
1454 #if defined(OS_LINUX)
1456 // This is compiled out on non-Linux platforms because otherwise it would be
1457 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1458 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1459 "enable-app-list",
1460 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1461 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1462 kOsLinux,
1463 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1465 #endif
1467 "disable-app-list-app-info",
1468 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST,
1469 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST_DESCRIPTION,
1470 kOsLinux | kOsWin | kOsCrOS,
1471 SINGLE_VALUE_TYPE(app_list::switches::kDisableAppInfo)
1474 "disable-drive-apps-in-app-list",
1475 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1476 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1477 kOsCrOS,
1478 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
1480 #endif
1481 #if defined(OS_ANDROID)
1483 "enable-accessibility-tab-switcher",
1484 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1485 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1486 kOsAndroid,
1487 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
1490 // TODO(dmazzoni): remove this flag when native android accessibility
1491 // ships in the stable channel. http://crbug.com/356775
1492 "enable-accessibility-script-injection",
1493 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1494 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1495 kOsAndroid,
1496 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1497 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1499 #endif
1501 "enable-one-copy",
1502 IDS_FLAGS_ONE_COPY_NAME,
1503 IDS_FLAGS_ONE_COPY_DESCRIPTION,
1504 kOsAll,
1505 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy,
1506 switches::kDisableOneCopy)
1509 "enable-zero-copy",
1510 IDS_FLAGS_ZERO_COPY_NAME,
1511 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1512 kOsAll,
1513 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)
1515 #if defined(OS_CHROMEOS)
1517 "enable-first-run-ui-transitions",
1518 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1519 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1520 kOsCrOS,
1521 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1523 #endif
1525 "enable-streamlined-hosted-apps",
1526 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME,
1527 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION,
1528 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1529 SINGLE_VALUE_TYPE(switches::kEnableStreamlinedHostedApps)
1532 "enable-ephemeral-apps",
1533 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_NAME,
1534 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_DESCRIPTION,
1535 kOsAll,
1536 SINGLE_VALUE_TYPE(switches::kEnableEphemeralApps)
1539 "enable-linkable-ephemeral-apps",
1540 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1541 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1542 kOsAll,
1543 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1546 "enable-service-worker-sync",
1547 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1548 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1549 kOsAll,
1550 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1552 #if defined(OS_ANDROID)
1554 "disable-click-delay",
1555 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1556 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1557 kOsAndroid,
1558 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1559 SINGLE_VALUE_TYPE("disable-click-delay")
1562 "disable-pull-to-refresh-effect",
1563 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1564 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1565 kOsAndroid,
1566 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)
1568 #endif
1569 #if defined(OS_MACOSX)
1571 "enable-translate-new-ux",
1572 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1573 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1574 kOsMac,
1575 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1577 #endif
1578 #if defined(TOOLKIT_VIEWS)
1580 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1581 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1582 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1583 kOsCrOS | kOsWin | kOsLinux,
1584 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
1587 "enable-link-disambiguation-popup",
1588 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1589 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1590 kOsCrOS | kOsWin,
1591 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)
1593 #endif
1594 #if defined(ENABLE_EXTENSIONS)
1596 "enable-apps-show-on-first-paint",
1597 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1598 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1599 kOsDesktop,
1600 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1602 #endif
1604 "enhanced-bookmarks-experiment",
1605 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1606 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1607 kOsDesktop | kOsAndroid,
1608 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1609 switches::kEnhancedBookmarksExperiment, "1",
1610 switches::kEnhancedBookmarksExperiment, "0")
1613 "manual-enhanced-bookmarks",
1614 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1615 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1616 kOsDesktop | kOsAndroid,
1617 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1620 "manual-enhanced-bookmarks-optout",
1621 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1622 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1623 kOsDesktop | kOsAndroid,
1624 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1626 #if defined(OS_ANDROID)
1628 "enable-zero-suggest-experiment",
1629 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1630 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1631 kOsAndroid,
1632 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1635 "enable-reader-mode-toolbar-icon",
1636 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1637 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1638 kOsAndroid,
1639 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1641 #endif
1643 "num-raster-threads",
1644 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1645 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1646 kOsAll,
1647 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
1650 "origin-chip-in-omnibox",
1651 IDS_FLAGS_ORIGIN_CHIP_NAME,
1652 IDS_FLAGS_ORIGIN_CHIP_DESCRIPTION,
1653 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1654 MULTI_VALUE_TYPE(kOriginChipChoices)
1657 "search-button-in-omnibox",
1658 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_NAME,
1659 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_DESCRIPTION,
1660 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1661 MULTI_VALUE_TYPE(kSearchButtonInOmniboxChoices)
1664 "ignore-autocomplete-off-autofill",
1665 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_NAME,
1666 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_DESCRIPTION,
1667 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1668 ENABLE_DISABLE_VALUE_TYPE(
1669 autofill::switches::kIgnoreAutocompleteOffForAutofill,
1670 autofill::switches::kRespectAutocompleteOffForAutofill)
1673 "enable-single-click-autofill",
1674 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1675 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1676 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1677 ENABLE_DISABLE_VALUE_TYPE(
1678 autofill::switches::kEnableSingleClickAutofill,
1679 autofill::switches::kDisableSingleClickAutofill)
1682 "enable-permissions-bubbles",
1683 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1684 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1685 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1686 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1687 switches::kDisablePermissionsBubbles)
1690 "enable-session-crashed-bubble",
1691 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1692 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1693 kOsWin | kOsLinux,
1694 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1695 switches::kDisableSessionCrashedBubble)
1698 "enable-out-of-process-pdf",
1699 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1700 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1701 kOsDesktop,
1702 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf,
1703 switches::kDisableOutOfProcessPdf)
1706 "disable-cast-streaming-hw-encoding",
1707 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1708 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1709 kOsAll,
1710 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)
1712 #if defined(OS_ANDROID)
1714 "disable-cast",
1715 IDS_FLAGS_DISABLE_CAST_NAME,
1716 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1717 kOsAndroid,
1718 SINGLE_VALUE_TYPE(switches::kDisableCast)
1721 "prefetch-search-results",
1722 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1723 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1724 kOsAndroid,
1725 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1727 #endif
1728 #if defined(ENABLE_APP_LIST)
1730 "enable-experimental-app-list",
1731 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1732 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1733 kOsWin | kOsLinux | kOsCrOS,
1734 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList,
1735 app_list::switches::kDisableExperimentalAppList)
1738 "enable-centered-app-list",
1739 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1740 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1741 kOsWin | kOsLinux | kOsCrOS,
1742 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
1744 #endif
1746 "touch-scrolling-mode",
1747 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME,
1748 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION,
1749 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1750 MULTI_VALUE_TYPE(kTouchScrollingModeChoices)
1753 "disable-threaded-scrolling",
1754 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1755 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1756 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1757 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)
1760 "bleeding-edge-renderer-mode",
1761 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1762 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1763 kOsAndroid,
1764 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1767 "enable-settings-window",
1768 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1769 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1770 kOsDesktop,
1771 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1772 switches::kDisableSettingsWindow)
1774 #if defined(OS_ANDROID)
1776 "enable-instant-search-clicks",
1777 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1778 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1779 kOsAndroid,
1780 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1782 #endif
1784 "enable-save-password-bubble",
1785 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1786 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1787 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1788 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1789 switches::kDisableSavePasswordBubble)
1791 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1792 // crbug.com/366483 for the target milestone.
1794 "allow-insecure-websocket-from-https-origin",
1795 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME,
1796 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION,
1797 kOsAll,
1798 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin)
1801 "enable-apps-file-associations",
1802 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1803 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1804 kOsMac,
1805 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1807 #if defined(OS_ANDROID)
1809 "enable-embeddedsearch-api",
1810 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1811 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1812 kOsAndroid,
1813 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1816 "enable-app-install-alerts",
1817 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1818 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1819 kOsAndroid,
1820 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1822 #endif
1824 "distance-field-text",
1825 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1826 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1827 kOsAll,
1828 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1829 switches::kDisableDistanceFieldText)
1832 "extension-content-verification",
1833 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1834 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1835 kOsDesktop,
1836 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1838 #if defined(USE_AURA)
1840 "text-input-focus-manager",
1841 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1842 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1843 kOsCrOS | kOsLinux | kOsWin,
1844 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1845 switches::kDisableTextInputFocusManager)
1847 #endif
1848 #if defined(ENABLE_EXTENSIONS)
1850 "extension-active-script-permission",
1851 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1852 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1853 kOsAll,
1854 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1856 #endif
1858 "harfbuzz-rendertext",
1859 IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME,
1860 IDS_FLAGS_HARFBUZZ_RENDERTEXT_DESCRIPTION,
1861 kOsDesktop,
1862 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText,
1863 switches::kDisableHarfBuzzRenderText)
1865 #if defined(OS_ANDROID)
1867 "answers-in-suggest",
1868 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1869 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1870 kOsAndroid,
1871 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest,
1872 switches::kDisableAnswersInSuggest)
1874 #endif
1875 #if defined(OS_ANDROID)
1877 "enable-data-reduction-proxy-dev",
1878 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1879 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1880 kOsAndroid,
1881 ENABLE_DISABLE_VALUE_TYPE(
1882 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1883 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1886 "enable-data-reduction-proxy-alt",
1887 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1888 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1889 kOsAndroid,
1890 SINGLE_VALUE_TYPE(
1891 data_reduction_proxy::switches::kEnableDataReductionProxyAlt)
1893 #endif
1895 "enable-experimental-hotwording",
1896 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_NAME,
1897 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION,
1898 kOsDesktop,
1899 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwording)
1902 "enable-hotword-hardware",
1903 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1904 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1905 kOsCrOS,
1906 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)
1908 #if defined(ENABLE_EXTENSIONS)
1910 "enable-embedded-extension-options",
1911 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1912 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1913 kOsDesktop,
1914 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1916 #endif
1918 "enable-website-settings-manager",
1919 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1920 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1921 kOsDesktop,
1922 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1925 "remember-cert-error-decisions",
1926 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1927 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1928 kOsAll,
1929 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1932 "enable-drop-sync-credential",
1933 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1934 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1935 kOsAll,
1936 ENABLE_DISABLE_VALUE_TYPE(
1937 password_manager::switches::kEnableDropSyncCredential,
1938 password_manager::switches::kDisableDropSyncCredential)
1940 #if defined(ENABLE_EXTENSIONS)
1942 "enable-extension-action-redesign",
1943 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1944 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1945 kOsWin | kOsLinux | kOsCrOS,
1946 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
1948 #endif
1950 "autofill-sync-credential",
1951 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1952 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1953 kOsAll,
1954 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
1956 #if !defined(OS_ANDROID)
1958 "enable-message-center-always-scroll-up-upon-notification-removal",
1959 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1960 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1961 kOsDesktop,
1962 SINGLE_VALUE_TYPE(
1963 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
1965 #endif
1966 #if defined(OS_CHROMEOS)
1968 "wake-on-packets",
1969 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1970 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1971 kOsCrOSOwnerOnly,
1972 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
1974 #endif // OS_CHROMEOS
1976 "enable-tab-audio-muting",
1977 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
1978 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
1979 kOsDesktop,
1980 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)
1983 "enable-credential-manager-api",
1984 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
1985 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
1986 kOsAll,
1987 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)
1990 "reduced-referrer-granularity",
1991 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
1992 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
1993 kOsAll,
1994 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)
1996 #if defined(ENABLE_PLUGINS)
1998 "enable-plugin-power-saver",
1999 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
2000 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
2001 kOsDesktop,
2002 SINGLE_VALUE_TYPE(switches::kEnablePluginPowerSaver)
2004 #endif
2005 #if defined(OS_CHROMEOS)
2007 "enable-remote-assistance",
2008 IDS_FLAGS_ENABLE_REMOTE_ASSISTANCE_NAME,
2009 IDS_FLAGS_ENABLE_REMOTE_ASSISTANCE_DESCRIPTION,
2010 kOsCrOS,
2011 SINGLE_VALUE_TYPE(extensions::switches::kEnableRemoteAssistance)
2014 "disable-new-zip-unpacker",
2015 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
2016 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
2017 kOsCrOS,
2018 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)
2020 #endif // defined(OS_CHROMEOS)
2022 "ssl-version-min",
2023 IDS_FLAGS_SSL_VERSION_MIN_NAME,
2024 IDS_FLAGS_SSL_VERSION_MIN_DESCRIPTION,
2025 kOsAll,
2026 MULTI_VALUE_TYPE(kSSLVersionMinChoices)
2029 "enable-credit-card-scan",
2030 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
2031 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
2032 kOsAndroid,
2033 SINGLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan)
2035 #if defined(OS_CHROMEOS)
2037 "enable-captive-portal-bypass-proxy",
2038 IDS_FLAGS_ENABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
2039 IDS_FLAGS_ENABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
2040 kOsCrOS,
2041 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCaptivePortalBypassProxy)
2043 #endif // defined(OS_CHROMEOS)
2044 #if defined(OS_ANDROID)
2046 "enable-seccomp-filter-sandbox",
2047 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
2048 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
2049 kOsAndroid,
2050 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)
2052 #endif
2054 // NOTE: Adding new command-line switches requires adding corresponding
2055 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2056 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2059 const Experiment* experiments = kExperiments;
2060 size_t num_experiments = arraysize(kExperiments);
2062 // Stores and encapsulates the little state that about:flags has.
2063 class FlagsState {
2064 public:
2065 FlagsState() : needs_restart_(false) {}
2066 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2067 CommandLine* command_line,
2068 SentinelsMode sentinels);
2069 bool IsRestartNeededToCommitChanges();
2070 void SetExperimentEnabled(
2071 FlagsStorage* flags_storage,
2072 const std::string& internal_name,
2073 bool enable);
2074 void RemoveFlagsSwitches(
2075 std::map<std::string, CommandLine::StringType>* switch_list);
2076 void ResetAllFlags(FlagsStorage* flags_storage);
2077 void reset();
2079 // Returns the singleton instance of this class
2080 static FlagsState* GetInstance() {
2081 return Singleton<FlagsState>::get();
2084 private:
2085 bool needs_restart_;
2086 std::map<std::string, std::string> flags_switches_;
2088 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2091 // Adds the internal names for the specified experiment to |names|.
2092 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2093 if (e.type == Experiment::SINGLE_VALUE) {
2094 names->insert(e.internal_name);
2095 } else {
2096 DCHECK(e.type == Experiment::MULTI_VALUE ||
2097 e.type == Experiment::ENABLE_DISABLE_VALUE);
2098 for (int i = 0; i < e.num_choices; ++i)
2099 names->insert(e.NameForChoice(i));
2103 // Confirms that an experiment is valid, used in a DCHECK in
2104 // SanitizeList below.
2105 bool ValidateExperiment(const Experiment& e) {
2106 switch (e.type) {
2107 case Experiment::SINGLE_VALUE:
2108 DCHECK_EQ(0, e.num_choices);
2109 DCHECK(!e.choices);
2110 break;
2111 case Experiment::MULTI_VALUE:
2112 DCHECK_GT(e.num_choices, 0);
2113 DCHECK(e.choices);
2114 DCHECK(e.choices[0].command_line_switch);
2115 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2116 break;
2117 case Experiment::ENABLE_DISABLE_VALUE:
2118 DCHECK_EQ(3, e.num_choices);
2119 DCHECK(!e.choices);
2120 DCHECK(e.command_line_switch);
2121 DCHECK(e.command_line_value);
2122 DCHECK(e.disable_command_line_switch);
2123 DCHECK(e.disable_command_line_value);
2124 break;
2125 default:
2126 NOTREACHED();
2128 return true;
2131 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2132 // unknown, to prevent this list to become very long as experiments are added
2133 // and removed.
2134 void SanitizeList(FlagsStorage* flags_storage) {
2135 std::set<std::string> known_experiments;
2136 for (size_t i = 0; i < num_experiments; ++i) {
2137 DCHECK(ValidateExperiment(experiments[i]));
2138 AddInternalName(experiments[i], &known_experiments);
2141 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2143 std::set<std::string> new_enabled_experiments =
2144 base::STLSetIntersection<std::set<std::string> >(
2145 known_experiments, enabled_experiments);
2147 if (new_enabled_experiments != enabled_experiments)
2148 flags_storage->SetFlags(new_enabled_experiments);
2151 void GetSanitizedEnabledFlags(
2152 FlagsStorage* flags_storage, std::set<std::string>* result) {
2153 SanitizeList(flags_storage);
2154 *result = flags_storage->GetFlags();
2157 bool SkipConditionalExperiment(const Experiment& experiment,
2158 FlagsStorage* flags_storage) {
2159 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2160 (experiment.internal_name ==
2161 std::string("manual-enhanced-bookmarks-optout"))) {
2162 return true;
2165 #if defined(OS_ANDROID)
2166 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2167 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2168 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA &&
2169 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2170 return true;
2172 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2173 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2174 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2175 return true;
2177 #endif
2179 return false;
2183 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2184 // enabled on the current platform.
2185 void GetSanitizedEnabledFlagsForCurrentPlatform(
2186 FlagsStorage* flags_storage, std::set<std::string>* result) {
2187 GetSanitizedEnabledFlags(flags_storage, result);
2189 // Filter out any experiments that aren't enabled on the current platform. We
2190 // don't remove these from prefs else syncing to a platform with a different
2191 // set of experiments would be lossy.
2192 std::set<std::string> platform_experiments;
2193 int current_platform = GetCurrentPlatform();
2194 for (size_t i = 0; i < num_experiments; ++i) {
2195 if (experiments[i].supported_platforms & current_platform)
2196 AddInternalName(experiments[i], &platform_experiments);
2197 #if defined(OS_CHROMEOS)
2198 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2199 AddInternalName(experiments[i], &platform_experiments);
2200 #endif
2203 std::set<std::string> new_enabled_experiments =
2204 base::STLSetIntersection<std::set<std::string> >(
2205 platform_experiments, *result);
2207 result->swap(new_enabled_experiments);
2210 // Returns the Value representing the choice data in the specified experiment.
2211 base::Value* CreateChoiceData(
2212 const Experiment& experiment,
2213 const std::set<std::string>& enabled_experiments) {
2214 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2215 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2216 base::ListValue* result = new base::ListValue;
2217 for (int i = 0; i < experiment.num_choices; ++i) {
2218 base::DictionaryValue* value = new base::DictionaryValue;
2219 const std::string name = experiment.NameForChoice(i);
2220 value->SetString("internal_name", name);
2221 value->SetString("description", experiment.DescriptionForChoice(i));
2222 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2223 result->Append(value);
2225 return result;
2228 } // namespace
2230 std::string Experiment::NameForChoice(int index) const {
2231 DCHECK(type == Experiment::MULTI_VALUE ||
2232 type == Experiment::ENABLE_DISABLE_VALUE);
2233 DCHECK_LT(index, num_choices);
2234 return std::string(internal_name) + testing::kMultiSeparator +
2235 base::IntToString(index);
2238 base::string16 Experiment::DescriptionForChoice(int index) const {
2239 DCHECK(type == Experiment::MULTI_VALUE ||
2240 type == Experiment::ENABLE_DISABLE_VALUE);
2241 DCHECK_LT(index, num_choices);
2242 int description_id;
2243 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2244 const int kEnableDisableDescriptionIds[] = {
2245 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2246 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2247 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2249 description_id = kEnableDisableDescriptionIds[index];
2250 } else {
2251 description_id = choices[index].description_id;
2253 return l10n_util::GetStringUTF16(description_id);
2256 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2257 CommandLine* command_line,
2258 SentinelsMode sentinels) {
2259 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2260 command_line,
2261 sentinels);
2264 bool AreSwitchesIdenticalToCurrentCommandLine(
2265 const CommandLine& new_cmdline,
2266 const CommandLine& active_cmdline,
2267 std::set<CommandLine::StringType>* out_difference) {
2268 std::set<CommandLine::StringType> new_flags =
2269 ExtractFlagsFromCommandLine(new_cmdline);
2270 std::set<CommandLine::StringType> active_flags =
2271 ExtractFlagsFromCommandLine(active_cmdline);
2273 bool result = false;
2274 // Needed because std::equal doesn't check if the 2nd set is empty.
2275 if (new_flags.size() == active_flags.size()) {
2276 result =
2277 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2280 if (out_difference && !result) {
2281 std::set_symmetric_difference(
2282 new_flags.begin(),
2283 new_flags.end(),
2284 active_flags.begin(),
2285 active_flags.end(),
2286 std::inserter(*out_difference, out_difference->begin()));
2289 return result;
2292 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2293 FlagAccess access,
2294 base::ListValue* supported_experiments,
2295 base::ListValue* unsupported_experiments) {
2296 std::set<std::string> enabled_experiments;
2297 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2299 int current_platform = GetCurrentPlatform();
2301 for (size_t i = 0; i < num_experiments; ++i) {
2302 const Experiment& experiment = experiments[i];
2303 if (SkipConditionalExperiment(experiment, flags_storage))
2304 continue;
2306 base::DictionaryValue* data = new base::DictionaryValue();
2307 data->SetString("internal_name", experiment.internal_name);
2308 data->SetString("name",
2309 l10n_util::GetStringUTF16(experiment.visible_name_id));
2310 data->SetString("description",
2311 l10n_util::GetStringUTF16(
2312 experiment.visible_description_id));
2314 base::ListValue* supported_platforms = new base::ListValue();
2315 AddOsStrings(experiment.supported_platforms, supported_platforms);
2316 data->Set("supported_platforms", supported_platforms);
2318 switch (experiment.type) {
2319 case Experiment::SINGLE_VALUE:
2320 data->SetBoolean(
2321 "enabled",
2322 enabled_experiments.count(experiment.internal_name) > 0);
2323 break;
2324 case Experiment::MULTI_VALUE:
2325 case Experiment::ENABLE_DISABLE_VALUE:
2326 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2327 break;
2328 default:
2329 NOTREACHED();
2332 bool supported = (experiment.supported_platforms & current_platform) != 0;
2333 #if defined(OS_CHROMEOS)
2334 if (access == kOwnerAccessToFlags &&
2335 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2336 supported = true;
2338 #endif
2339 if (supported)
2340 supported_experiments->Append(data);
2341 else
2342 unsupported_experiments->Append(data);
2346 bool IsRestartNeededToCommitChanges() {
2347 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2350 void SetExperimentEnabled(FlagsStorage* flags_storage,
2351 const std::string& internal_name,
2352 bool enable) {
2353 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2354 internal_name, enable);
2357 void RemoveFlagsSwitches(
2358 std::map<std::string, CommandLine::StringType>* switch_list) {
2359 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2362 void ResetAllFlags(FlagsStorage* flags_storage) {
2363 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2366 int GetCurrentPlatform() {
2367 #if defined(OS_MACOSX)
2368 return kOsMac;
2369 #elif defined(OS_WIN)
2370 return kOsWin;
2371 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2372 return kOsCrOS;
2373 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2374 return kOsLinux;
2375 #elif defined(OS_ANDROID)
2376 return kOsAndroid;
2377 #else
2378 #error Unknown platform
2379 #endif
2382 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2383 std::set<std::string> flags = flags_storage->GetFlags();
2384 for (const std::string& flag : flags) {
2385 std::string action("AboutFlags_");
2386 action += flag;
2387 content::RecordComputedAction(action);
2389 // Since flag metrics are recorded every startup, add a tick so that the
2390 // stats can be made meaningful.
2391 if (flags.size())
2392 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2393 content::RecordAction(base::UserMetricsAction("StartupTick"));
2396 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2397 return static_cast<base::HistogramBase::Sample>(
2398 metrics::HashMetricName(switch_name));
2401 void ReportCustomFlags(const std::string& uma_histogram_hame,
2402 const std::set<std::string>& command_line_difference) {
2403 for (const std::string& flag : command_line_difference) {
2404 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2405 if (StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2406 // Skip '--' before switch name.
2407 std::string switch_name(flag.substr(2));
2409 // Kill value, if any.
2410 const size_t value_pos = switch_name.find('=');
2411 if (value_pos != std::string::npos)
2412 switch_name.resize(value_pos);
2414 uma_id = GetSwitchUMAId(switch_name);
2415 } else {
2416 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2417 << "' has incorrect format.";
2419 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2420 << "' '" << flag << "', uma_id=" << uma_id;
2422 // Sparse histogram macro does not cache the histogram, so it's safe
2423 // to use macro with non-static histogram name here.
2424 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2428 //////////////////////////////////////////////////////////////////////////////
2429 // FlagsState implementation.
2431 namespace {
2433 typedef std::map<std::string, std::pair<std::string, std::string> >
2434 NameToSwitchAndValueMap;
2436 void SetFlagToSwitchMapping(const std::string& key,
2437 const std::string& switch_name,
2438 const std::string& switch_value,
2439 NameToSwitchAndValueMap* name_to_switch_map) {
2440 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2441 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2444 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2445 CommandLine* command_line,
2446 SentinelsMode sentinels) {
2447 if (command_line->HasSwitch(switches::kNoExperiments))
2448 return;
2450 std::set<std::string> enabled_experiments;
2452 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2453 &enabled_experiments);
2455 NameToSwitchAndValueMap name_to_switch_map;
2456 for (size_t i = 0; i < num_experiments; ++i) {
2457 const Experiment& e = experiments[i];
2458 if (e.type == Experiment::SINGLE_VALUE) {
2459 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2460 e.command_line_value, &name_to_switch_map);
2461 } else if (e.type == Experiment::MULTI_VALUE) {
2462 for (int j = 0; j < e.num_choices; ++j) {
2463 SetFlagToSwitchMapping(e.NameForChoice(j),
2464 e.choices[j].command_line_switch,
2465 e.choices[j].command_line_value,
2466 &name_to_switch_map);
2468 } else {
2469 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2470 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2471 &name_to_switch_map);
2472 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2473 e.command_line_value, &name_to_switch_map);
2474 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2475 e.disable_command_line_value, &name_to_switch_map);
2479 if (sentinels == kAddSentinels) {
2480 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2481 flags_switches_.insert(
2482 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2483 std::string()));
2485 for (const std::string& experiment_name : enabled_experiments) {
2486 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2487 name_to_switch_map.find(experiment_name);
2488 if (name_to_switch_it == name_to_switch_map.end()) {
2489 NOTREACHED();
2490 continue;
2493 #if defined(OS_CHROMEOS)
2494 // On Chrome OS setting command line flag may make browser to restart on
2495 // user login. As this flag eventually will be set to a significant number
2496 // of users skip manual-enhanced-bookmarks to avoid restart.
2497 if (experiment_name == "manual-enhanced-bookmarks")
2498 continue;
2499 #endif
2501 const std::pair<std::string, std::string>&
2502 switch_and_value_pair = name_to_switch_it->second;
2504 CHECK(!switch_and_value_pair.first.empty());
2505 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2506 switch_and_value_pair.second);
2507 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2509 if (sentinels == kAddSentinels) {
2510 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2511 flags_switches_.insert(
2512 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2513 std::string()));
2517 bool FlagsState::IsRestartNeededToCommitChanges() {
2518 return needs_restart_;
2521 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2522 const std::string& internal_name,
2523 bool enable) {
2524 size_t at_index = internal_name.find(testing::kMultiSeparator);
2525 if (at_index != std::string::npos) {
2526 DCHECK(enable);
2527 // We're being asked to enable a multi-choice experiment. Disable the
2528 // currently selected choice.
2529 DCHECK_NE(at_index, 0u);
2530 const std::string experiment_name = internal_name.substr(0, at_index);
2531 SetExperimentEnabled(flags_storage, experiment_name, false);
2533 // And enable the new choice, if it is not the default first choice.
2534 if (internal_name != experiment_name + "@0") {
2535 std::set<std::string> enabled_experiments;
2536 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2537 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2538 flags_storage->SetFlags(enabled_experiments);
2540 return;
2543 std::set<std::string> enabled_experiments;
2544 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2546 const Experiment* e = NULL;
2547 for (size_t i = 0; i < num_experiments; ++i) {
2548 if (experiments[i].internal_name == internal_name) {
2549 e = experiments + i;
2550 break;
2553 DCHECK(e);
2555 if (e->type == Experiment::SINGLE_VALUE) {
2556 if (enable)
2557 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2558 else
2559 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2560 } else {
2561 if (enable) {
2562 // Enable the first choice.
2563 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2564 } else {
2565 // Find the currently enabled choice and disable it.
2566 for (int i = 0; i < e->num_choices; ++i) {
2567 std::string choice_name = e->NameForChoice(i);
2568 if (enabled_experiments.find(choice_name) !=
2569 enabled_experiments.end()) {
2570 needs_restart_ = true;
2571 enabled_experiments.erase(choice_name);
2572 // Continue on just in case there's a bug and more than one
2573 // experiment for this choice was enabled.
2579 flags_storage->SetFlags(enabled_experiments);
2582 void FlagsState::RemoveFlagsSwitches(
2583 std::map<std::string, CommandLine::StringType>* switch_list) {
2584 for (const auto& entry : flags_switches_)
2585 switch_list->erase(entry.first);
2588 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2589 needs_restart_ = true;
2591 std::set<std::string> no_experiments;
2592 flags_storage->SetFlags(no_experiments);
2595 void FlagsState::reset() {
2596 needs_restart_ = false;
2597 flags_switches_.clear();
2600 } // namespace
2602 namespace testing {
2604 // WARNING: '@' is also used in the html file. If you update this constant you
2605 // also need to update the html file.
2606 const char kMultiSeparator[] = "@";
2608 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2610 void ClearState() {
2611 FlagsState::GetInstance()->reset();
2614 void SetExperiments(const Experiment* e, size_t count) {
2615 if (!e) {
2616 experiments = kExperiments;
2617 num_experiments = arraysize(kExperiments);
2618 } else {
2619 experiments = e;
2620 num_experiments = count;
2624 const Experiment* GetExperiments(size_t* count) {
2625 *count = num_experiments;
2626 return experiments;
2629 } // namespace testing
2631 } // namespace about_flags