ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blob7f41b7f2bcae79c6519c8e376d453503e43fae94
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/omnibox/omnibox_switches.h"
31 #include "components/proximity_auth/switches.h"
32 #include "components/search/search_switches.h"
33 #include "content/public/browser/user_metrics.h"
34 #include "media/base/media_switches.h"
35 #include "ui/base/l10n/l10n_util.h"
36 #include "ui/base/ui_base_switches.h"
37 #include "ui/display/display_switches.h"
38 #include "ui/events/event_switches.h"
39 #include "ui/gfx/switches.h"
40 #include "ui/gl/gl_switches.h"
41 #include "ui/keyboard/keyboard_switches.h"
42 #include "ui/native_theme/native_theme_switches.h"
43 #include "ui/views/views_switches.h"
45 #if defined(OS_ANDROID)
46 #include "chrome/common/chrome_version_info.h"
47 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_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 base::CommandLine::StringType GetSwitchString(const std::string& flag) {
123 base::CommandLine cmd_line(base::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<base::CommandLine::StringType> ExtractFlagsFromCommandLine(
131 const base::CommandLine& cmdline) {
132 std::set<base::CommandLine::StringType> flags;
133 // First do the ones between --flag-switches-begin and --flag-switches-end.
134 base::CommandLine::StringVector::const_iterator first =
135 std::find(cmdline.argv().begin(), cmdline.argv().end(),
136 GetSwitchString(switches::kFlagSwitchesBegin));
137 base::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 kMarkNonSecureAsChoices[] = {
192 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
193 { IDS_MARK_NON_SECURE_AS_NEUTRAL,
194 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNeutral},
195 { IDS_MARK_NON_SECURE_AS_NON_SECURE,
196 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNonSecure},
197 { IDS_MARK_NON_SECURE_AS_DUBIOUS,
198 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious}
201 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
202 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
203 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
204 cc::switches::kMaxTilesForInterestArea, "64"},
205 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
206 cc::switches::kMaxTilesForInterestArea, "128"},
207 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
208 cc::switches::kMaxTilesForInterestArea, "256"},
209 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
210 cc::switches::kMaxTilesForInterestArea, "512"}
213 const Experiment::Choice kDefaultTileWidthChoices[] = {
214 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
215 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
216 switches::kDefaultTileWidth, "128"},
217 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
218 switches::kDefaultTileWidth, "256"},
219 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
220 switches::kDefaultTileWidth, "512"},
221 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
222 switches::kDefaultTileWidth, "1024"}
225 const Experiment::Choice kDefaultTileHeightChoices[] = {
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
227 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
228 switches::kDefaultTileHeight, "128"},
229 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
230 switches::kDefaultTileHeight, "256"},
231 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
232 switches::kDefaultTileHeight, "512"},
233 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
234 switches::kDefaultTileHeight, "1024"}
237 const Experiment::Choice kSimpleCacheBackendChoices[] = {
238 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
239 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
240 switches::kUseSimpleCacheBackend, "off" },
241 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
242 switches::kUseSimpleCacheBackend, "on"}
245 #if defined(USE_AURA)
246 const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
247 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
248 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
249 switches::kTabCaptureUpscaleQuality, "fast" },
250 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
251 switches::kTabCaptureUpscaleQuality, "good" },
252 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
253 switches::kTabCaptureUpscaleQuality, "best" },
256 const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
257 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
258 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
259 switches::kTabCaptureDownscaleQuality, "fast" },
260 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
261 switches::kTabCaptureDownscaleQuality, "good" },
262 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
263 switches::kTabCaptureDownscaleQuality, "best" },
265 #endif
267 #if defined(TOOLKIT_VIEWS)
268 const Experiment::Choice kTabCloseButtonsHiddenWithTouchChoices[] = {
269 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
270 { IDS_FLAGS_TAB_CLOSE_BUTTONS_HIDDEN_WITH_TOUCH_ALWAYS,
271 switches::kTabCloseButtonsHiddenWithTouch, "always" },
272 { IDS_FLAGS_TAB_CLOSE_BUTTONS_HIDDEN_WITH_TOUCH_NARROW,
273 switches::kTabCloseButtonsHiddenWithTouch, "narrow" },
274 { IDS_FLAGS_TAB_CLOSE_BUTTONS_HIDDEN_WITH_TOUCH_STACKED,
275 switches::kTabCloseButtonsHiddenWithTouch, "stacked" },
277 #endif
279 #if defined(OS_ANDROID)
280 const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
281 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
282 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
283 switches::kEnableZeroSuggestMostVisited, ""},
284 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED_WITHOUT_SERP,
285 switches::kEnableZeroSuggestMostVisitedWithoutSerp, ""},
286 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
287 switches::kDisableZeroSuggest, ""}
289 #endif
291 const Experiment::Choice kNumRasterThreadsChoices[] = {
292 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
293 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
294 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
295 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
296 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
299 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
300 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
301 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
302 switches::kEnableGpuRasterization, "" },
303 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
304 switches::kDisableGpuRasterization, "" },
305 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
306 switches::kForceGpuRasterization, "" },
309 #if defined(OS_CHROMEOS)
310 const Experiment::Choice kMemoryPressureThresholdChoices[] = {
311 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
312 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS,
313 chromeos::switches::kMemoryPressureThresholds,
314 chromeos::switches::kConservativeThreshold },
315 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS,
316 chromeos::switches::kMemoryPressureThresholds,
317 chromeos::switches::kAggressiveCacheDiscardThreshold },
318 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS,
319 chromeos::switches::kMemoryPressureThresholds,
320 chromeos::switches::kAggressiveTabDiscardThreshold },
321 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS,
322 chromeos::switches::kMemoryPressureThresholds,
323 chromeos::switches::kAggressiveThreshold },
325 #endif
327 const Experiment::Choice kExtensionContentVerificationChoices[] = {
328 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
329 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
330 switches::kExtensionContentVerification,
331 switches::kExtensionContentVerificationBootstrap },
332 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
333 switches::kExtensionContentVerification,
334 switches::kExtensionContentVerificationEnforce },
335 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
336 switches::kExtensionContentVerification,
337 switches::kExtensionContentVerificationEnforceStrict },
340 // Note that the value is specified in seconds (where 0 is equivalent to
341 // disabled).
342 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
343 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
344 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
345 switches::kRememberCertErrorDecisions,
346 "-1" },
347 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
348 switches::kRememberCertErrorDecisions,
349 "86400" },
350 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
351 switches::kRememberCertErrorDecisions,
352 "259200" },
353 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
354 switches::kRememberCertErrorDecisions,
355 "604800" },
356 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
357 switches::kRememberCertErrorDecisions,
358 "2592000" },
359 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
360 switches::kRememberCertErrorDecisions,
361 "7776000" },
364 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
365 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
366 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
367 password_manager::switches::kAllowAutofillSyncCredential, ""},
368 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
369 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
370 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
371 password_manager::switches::kDisallowAutofillSyncCredential, ""},
374 const Experiment::Choice kSSLVersionMinChoices[] = {
375 { IDS_FLAGS_SSL_VERSION_DEFAULT, "", "" },
376 { IDS_FLAGS_SSL_VERSION_SSLV3, switches::kSSLVersionMin,
377 switches::kSSLVersionSSLv3 },
378 { IDS_FLAGS_SSL_VERSION_TLSV1, switches::kSSLVersionMin,
379 switches::kSSLVersionTLSv1 },
380 { IDS_FLAGS_SSL_VERSION_TLSV11, switches::kSSLVersionMin,
381 switches::kSSLVersionTLSv11 },
382 { IDS_FLAGS_SSL_VERSION_TLSV12, switches::kSSLVersionMin,
383 switches::kSSLVersionTLSv12 },
386 const Experiment::Choice kFillOnAccountSelectChoices[] = {
387 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
388 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
389 autofill::switches::kDisableFillOnAccountSelect, "" },
390 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING,
391 autofill::switches::kEnableFillOnAccountSelect, "" },
392 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING,
393 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" },
396 // RECORDING USER METRICS FOR FLAGS:
397 // -----------------------------------------------------------------------------
398 // The first line of the experiment is the internal name. If you'd like to
399 // gather statistics about the usage of your flag, you should append a marker
400 // comment to the end of the feature name, like so:
401 // "my-special-feature", // FLAGS:RECORD_UMA
403 // After doing that, run
404 // tools/metrics/actions/extract_actions.py
405 // to add the metric to actions.xml (which will enable UMA to record your
406 // feature flag), then update the <owner>s and <description> sections. Make sure
407 // to include the actions.xml file when you upload your code for review!
409 // After your feature has shipped under a flag, you can locate the metrics under
410 // the action name AboutFlags_internal-action-name. Actions are recorded once
411 // per startup, so you should divide this number by AboutFlags_StartupTick to
412 // get a sense of usage. Note that this will not be the same as number of users
413 // with a given feature enabled because users can quit and relaunch the
414 // application multiple times over a given time interval. The dashboard also
415 // shows you how many (metrics reporting) users have enabled the flag over the
416 // last seven days. However, note that this is not the same as the number of
417 // users who have the flag enabled, since enabling the flag happens once,
418 // whereas running with the flag enabled happens until the user flips the flag
419 // again.
421 // To add a new experiment add to the end of kExperiments. There are two
422 // distinct types of experiments:
423 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
424 // macro for this type supplying the command line to the macro.
425 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
426 // deactivated state for this lab (i.e. no command line option). To specify
427 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
428 // array of choices.
429 // See the documentation of Experiment for details on the fields.
431 // Command-line switches must have entries in enum "LoginCustomFlags" in
432 // histograms.xml. See note in histograms.xml and don't forget to run
433 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
435 // When adding a new choice, add it to the end of the list.
436 const Experiment kExperiments[] = {
438 "ignore-gpu-blacklist",
439 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
440 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
441 kOsAll,
442 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
444 #if defined(OS_WIN)
446 "disable-direct-write",
447 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
448 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
449 kOsWin,
450 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
453 "enable-win32k-renderer-lockdown",
454 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_NAME,
455 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_DESCRIPTION,
456 kOsWin,
457 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableWin32kRendererLockDown,
458 switches::kDisableWin32kRendererLockDown)
460 #endif
462 "enable-experimental-canvas-features",
463 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
464 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
465 kOsAll,
466 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
469 "disable-accelerated-2d-canvas",
470 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
471 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
472 kOsAll,
473 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
476 "enable-display-list-2d-canvas",
477 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
478 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
479 kOsAll,
480 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas,
481 switches::kDisableDisplayList2dCanvas)
484 "composited-layer-borders",
485 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
486 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
487 kOsAll,
488 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
491 "show-fps-counter",
492 IDS_FLAGS_SHOW_FPS_COUNTER,
493 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
494 kOsAll,
495 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
498 "disable-webgl",
499 IDS_FLAGS_DISABLE_WEBGL_NAME,
500 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
501 kOsAll,
502 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
504 #if defined(OS_WIN) || defined(OS_MACOSX)
506 "enable-npapi",
507 IDS_FLAGS_ENABLE_NPAPI_NAME,
508 IDS_FLAGS_ENABLE_NPAPI_DESCRIPTION,
509 kOsWin | kOsMac,
510 SINGLE_VALUE_TYPE(switches::kEnableNpapi)
512 #endif
514 "disable-webrtc",
515 IDS_FLAGS_DISABLE_WEBRTC_NAME,
516 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
517 kOsAndroid,
518 #if defined(OS_ANDROID)
519 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
520 #else
521 SINGLE_VALUE_TYPE("")
522 #endif
524 #if defined(ENABLE_WEBRTC)
526 "disable-webrtc-hw-decoding",
527 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
528 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
529 kOsAndroid | kOsCrOS,
530 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
533 "disable-webrtc-hw-encoding",
534 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
535 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
536 kOsAndroid | kOsCrOS,
537 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
539 #endif
540 #if defined(OS_ANDROID)
542 "disable-webaudio",
543 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
544 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
545 kOsAndroid,
546 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
548 #endif
549 // Native client is compiled out when DISABLE_NACL is defined.
550 #if !defined(DISABLE_NACL)
552 "enable-nacl", // FLAGS:RECORD_UMA
553 IDS_FLAGS_ENABLE_NACL_NAME,
554 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
555 kOsAll,
556 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
559 "enable-nacl-debug", // FLAGS:RECORD_UMA
560 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
561 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
562 kOsDesktop,
563 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
566 "nacl-debug-mask", // FLAGS:RECORD_UMA
567 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
568 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
569 kOsDesktop,
570 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
572 #endif
573 #if defined(ENABLE_EXTENSIONS)
575 "extension-apis", // FLAGS:RECORD_UMA
576 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
577 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
578 kOsDesktop,
579 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
582 "extensions-on-chrome-urls",
583 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
584 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
585 kOsAll,
586 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
588 #endif
590 "enable-fast-unload",
591 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
592 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
593 kOsAll,
594 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
596 #if defined(ENABLE_EXTENSIONS)
598 "enable-app-window-controls",
599 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
600 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
601 kOsDesktop,
602 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
604 #endif
606 "disable-hyperlink-auditing",
607 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
608 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
609 kOsAll,
610 SINGLE_VALUE_TYPE(switches::kNoPings)
612 #if defined(OS_ANDROID)
614 "contextual-search",
615 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
616 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
617 kOsAndroid,
618 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
619 switches::kDisableContextualSearch)
621 #endif
623 "show-autofill-type-predictions",
624 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
625 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
626 kOsAll,
627 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
630 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
631 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
632 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
633 // Can't expose the switch unless the code is compiled in.
634 // On by default for the Mac (different implementation in WebKit).
635 kOsLinux,
636 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
638 #if defined(USE_AURA) || defined(OS_LINUX)
640 "overlay-scrollbars",
641 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
642 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
643 // Uses the system preference on Mac (a different implementation).
644 // On Android, this is always enabled.
645 kOsLinux | kOsCrOS | kOsWin,
646 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar,
647 switches::kDisableOverlayScrollbar)
649 #endif
651 "enable-panels",
652 IDS_FLAGS_ENABLE_PANELS_NAME,
653 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
654 kOsDesktop,
655 SINGLE_VALUE_TYPE(switches::kEnablePanels)
658 // See http://crbug.com/120416 for how to remove this flag.
659 "save-page-as-mhtml", // FLAGS:RECORD_UMA
660 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
661 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
662 kOsMac | kOsWin | kOsLinux,
663 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
666 "enable-quic",
667 IDS_FLAGS_ENABLE_QUIC_NAME,
668 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
669 kOsAll,
670 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
671 switches::kDisableQuic)
674 "enable-spdy4",
675 IDS_FLAGS_ENABLE_SPDY4_NAME,
676 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
677 kOsAll,
678 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
681 "disable-media-source",
682 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
683 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
684 kOsAll,
685 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
688 "disable-encrypted-media",
689 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
690 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
691 kOsAll,
692 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
695 "disable-prefixed-encrypted-media",
696 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
697 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
698 kOsAll,
699 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
701 #if defined(OS_ANDROID)
703 "disable-infobar-for-protected-media-identifier",
704 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
705 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
706 kOsAndroid,
707 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
710 "mediadrm-enable-non-compositing",
711 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME,
712 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION,
713 kOsAndroid,
714 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing)
716 #endif // defined(OS_ANDROID)
718 "disable-javascript-harmony-shipping",
719 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_NAME,
720 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_DESCRIPTION,
721 kOsAll,
722 SINGLE_VALUE_TYPE(switches::kDisableJavaScriptHarmonyShipping)
725 "enable-javascript-harmony",
726 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
727 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
728 kOsAll,
729 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
732 "disable-software-rasterizer",
733 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
734 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
735 #if defined(ENABLE_SWIFTSHADER)
736 kOsAll,
737 #else
739 #endif
740 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
743 "enable-gpu-rasterization",
744 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
745 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
746 kOsAll,
747 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
750 "enable-threaded-gpu-rasterization",
751 IDS_FLAGS_ENABLE_THREADED_GPU_RASTERIZATION_NAME,
752 IDS_FLAGS_ENABLE_THREADED_GPU_RASTERIZATION_DESCRIPTION,
753 kOsAll,
754 ENABLE_DISABLE_VALUE_TYPE(
755 switches::kEnableThreadedGpuRasterization,
756 switches::kDisableThreadedGpuRasterization)
759 "enable-experimental-web-platform-features",
760 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
761 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
762 kOsAll,
763 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
766 "disable-ntp-other-sessions-menu",
767 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
768 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
769 kOsDesktop,
770 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
773 "enable-devtools-experiments",
774 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
775 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
776 kOsDesktop,
777 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
780 "silent-debugger-extension-api",
781 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
782 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
783 kOsDesktop,
784 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
786 #if defined(ENABLE_SPELLCHECK)
788 "spellcheck-autocorrect",
789 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
790 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
791 kOsWin | kOsLinux | kOsCrOS,
792 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
794 #endif
796 "enable-scroll-prediction",
797 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
798 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
799 kOsDesktop,
800 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
803 "touch-events",
804 IDS_TOUCH_EVENTS_NAME,
805 IDS_TOUCH_EVENTS_DESCRIPTION,
806 kOsDesktop,
807 MULTI_VALUE_TYPE(kTouchEventsChoices)
810 "disable-touch-adjustment",
811 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
812 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
813 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
814 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
816 #if defined(OS_CHROMEOS)
818 "network-portal-notification",
819 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
820 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
821 kOsCrOS,
822 ENABLE_DISABLE_VALUE_TYPE(
823 chromeos::switches::kEnableNetworkPortalNotification,
824 chromeos::switches::kDisableNetworkPortalNotification)
826 #endif
828 "enable-download-resumption",
829 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
830 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
831 kOsDesktop,
832 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
834 #if defined(ENABLE_PLUGINS)
836 "allow-nacl-socket-api",
837 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
838 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
839 kOsDesktop,
840 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
842 #endif
843 #if defined(OS_CHROMEOS)
845 "allow-touchpad-three-finger-click",
846 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
847 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
848 kOsCrOS,
849 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
852 "disable-easy-unlock",
853 IDS_FLAGS_DISABLE_EASY_UNLOCK_NAME,
854 IDS_FLAGS_DISABLE_EASY_UNLOCK_DESCRIPTION,
855 kOsCrOS,
856 SINGLE_VALUE_TYPE(proximity_auth::switches::kDisableEasyUnlock)
859 "enable-easy-unlock-proximity-detection",
860 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
861 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
862 kOsCrOS,
863 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)
865 #endif
866 #if defined(USE_ASH)
868 "disable-minimize-on-second-launcher-item-click",
869 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
870 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
871 kOsAll,
872 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
875 "show-touch-hud",
876 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
877 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
878 kOsAll,
879 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
882 "enable-pinch",
883 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
884 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
885 kOsLinux | kOsWin | kOsCrOS,
886 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
888 #endif // defined(USE_ASH)
890 "enable-pinch-virtual-viewport",
891 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
892 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
893 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
894 ENABLE_DISABLE_VALUE_TYPE(
895 cc::switches::kEnablePinchVirtualViewport,
896 cc::switches::kDisablePinchVirtualViewport),
899 "enable-viewport-meta",
900 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
901 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
902 kOsLinux | kOsWin | kOsCrOS | kOsMac,
903 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
905 #if defined(OS_CHROMEOS)
907 "disable-boot-animation",
908 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
909 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
910 kOsCrOSOwnerOnly,
911 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
914 "enable-video-player-chromecast-support",
915 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
916 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
917 kOsCrOS,
918 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
921 "disable-office-editing-component-app",
922 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
923 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
924 kOsCrOS,
925 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
928 "disable-display-color-calibration",
929 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
930 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
931 kOsCrOS,
932 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
935 "ash-disable-screen-orientation-lock",
936 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
937 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
938 kOsCrOS,
939 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
941 #endif // defined(OS_CHROMEOS)
942 { "disable-accelerated-video-decode",
943 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
944 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
945 kOsMac | kOsWin | kOsCrOS,
946 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
948 #if defined(USE_ASH)
950 "ash-debug-shortcuts",
951 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
952 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
953 kOsAll,
954 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
956 { "ash-enable-touch-view-testing",
957 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
958 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
959 kOsCrOS,
960 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
963 "disable-touch-feedback",
964 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
965 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
966 kOsCrOS,
967 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
969 { "ash-enable-mirrored-screen",
970 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
971 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
972 kOsCrOS,
973 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
975 #endif // defined(USE_ASH)
976 #if defined(OS_CHROMEOS)
978 "enable-carrier-switching",
979 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
980 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
981 kOsCrOS,
982 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
985 "disable-cloud-import",
986 IDS_FLAGS_DISABLE_CLOUD_IMPORT,
987 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION,
988 kOsCrOS,
989 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport)
992 "enable-request-tablet-site",
993 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
994 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
995 kOsCrOS,
996 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
998 #endif
1000 "debug-packed-apps",
1001 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1002 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1003 kOsDesktop,
1004 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1007 "enable-password-generation",
1008 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1009 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1010 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1011 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1012 autofill::switches::kDisablePasswordGeneration)
1015 "enable-automatic-password-saving",
1016 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1017 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1018 kOsDesktop,
1019 SINGLE_VALUE_TYPE(
1020 password_manager::switches::kEnableAutomaticPasswordSaving)
1023 "password-manager-reauthentication",
1024 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1025 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1026 kOsMac | kOsWin,
1027 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
1030 "enable-password-link",
1031 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1032 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1033 kOsAndroid | kOsDesktop,
1034 ENABLE_DISABLE_VALUE_TYPE(
1035 password_manager::switches::kEnablePasswordLink,
1036 password_manager::switches::kDisablePasswordLink)
1039 "enable-password-save-in-page-navigation",
1040 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_NAME,
1041 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_DESCRIPTION,
1042 kOsAll,
1043 SINGLE_VALUE_TYPE(
1044 autofill::switches::kEnablePasswordSaveOnInPageNavigation)
1047 "enable-affiliation-based-matching",
1048 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME,
1049 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION,
1050 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1051 ENABLE_DISABLE_VALUE_TYPE(
1052 password_manager::switches::kEnableAffiliationBasedMatching,
1053 password_manager::switches::kDisableAffiliationBasedMatching)
1056 "enable-deferred-image-decoding",
1057 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1058 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1059 kOsMac | kOsLinux | kOsCrOS,
1060 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1063 "wallet-service-use-sandbox",
1064 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1065 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1066 kOsAndroid | kOsDesktop,
1067 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1068 autofill::switches::kWalletServiceUseSandbox, "1",
1069 autofill::switches::kWalletServiceUseSandbox, "0")
1071 #if defined(USE_AURA)
1073 "overscroll-history-navigation",
1074 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1075 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1076 kOsAll,
1077 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
1079 #endif
1081 "scroll-end-effect",
1082 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1083 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1084 kOsCrOS,
1085 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1086 switches::kScrollEndEffect, "1",
1087 switches::kScrollEndEffect, "0")
1090 "enable-touch-drag-drop",
1091 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1092 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1093 kOsWin | kOsCrOS,
1094 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1095 switches::kDisableTouchDragDrop)
1098 "enable-touch-editing",
1099 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1100 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1101 kOsCrOS | kOsWin | kOsLinux,
1102 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1103 switches::kDisableTouchEditing)
1106 "enable-stale-while-revalidate",
1107 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME,
1108 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION,
1109 kOsAll,
1110 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate)
1113 "enable-suggestions-service",
1114 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1115 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1116 kOsAndroid | kOsCrOS,
1117 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1118 switches::kDisableSuggestionsService)
1121 "enable-supervised-user-blacklist",
1122 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1123 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1124 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1125 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist,
1126 switches::kDisableSupervisedUserBlacklist)
1129 "enable-supervised-user-managed-bookmarks-folder",
1130 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME,
1131 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION,
1132 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1133 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder)
1136 "enable-supervised-user-safesites",
1137 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME,
1138 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1139 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1140 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites,
1141 switches::kDisableSupervisedUserSafeSites)
1143 #if defined(ENABLE_APP_LIST)
1145 "enable-sync-app-list",
1146 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1147 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1148 kOsDesktop,
1149 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1150 app_list::switches::kDisableSyncAppList)
1152 #endif
1153 #if defined(OS_MACOSX)
1155 "enable-avfoundation",
1156 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1157 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1158 kOsMac,
1159 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1160 switches::kForceQTKit)
1162 #endif
1164 "lcd-text-aa",
1165 IDS_FLAGS_LCD_TEXT_NAME,
1166 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1167 kOsDesktop,
1168 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1169 switches::kDisableLCDText)
1171 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1173 "delegated-renderer",
1174 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1175 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1176 kOsAndroid, // TODO(ccameron) Add mac support soon.
1177 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1178 switches::kDisableDelegatedRenderer)
1180 #endif
1182 "max-tiles-for-interest-area",
1183 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1184 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1185 kOsAll,
1186 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1189 "enable-offline-auto-reload",
1190 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1191 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1192 kOsAll,
1193 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1194 switches::kDisableOfflineAutoReload)
1197 "enable-offline-auto-reload-visible-only",
1198 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1199 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1200 kOsAll,
1201 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1202 switches::kDisableOfflineAutoReloadVisibleOnly)
1205 "enable-offline-load-stale-cache",
1206 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME,
1207 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION,
1208 kOsAll,
1209 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache,
1210 switches::kDisableOfflineLoadStaleCache)
1213 "default-tile-width",
1214 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1215 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1216 kOsAll,
1217 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1220 "default-tile-height",
1221 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1222 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1223 kOsAll,
1224 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1226 #if defined(OS_ANDROID)
1228 "disable-gesture-requirement-for-media-playback",
1229 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1230 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1231 kOsAndroid,
1232 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1234 #endif
1235 #if defined(OS_CHROMEOS)
1237 "enable-virtual-keyboard",
1238 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1239 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1240 kOsCrOS,
1241 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1244 "enable-virtual-keyboard-overscroll",
1245 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1246 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1247 kOsCrOS,
1248 ENABLE_DISABLE_VALUE_TYPE(
1249 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1250 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1253 "enable-swipe-selection",
1254 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1255 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1256 kOsCrOS,
1257 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1260 "enable-input-view",
1261 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1262 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1263 kOsCrOS,
1264 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1265 keyboard::switches::kDisableInputView)
1268 "enable-new-korean-ime",
1269 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_NAME,
1270 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_DESCRIPTION,
1271 kOsCrOS,
1272 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewKoreanIme)
1275 "enable-new-md-input-view",
1276 IDS_FLAGS_ENABLE_NEW_MD_INPUT_VIEW_NAME,
1277 IDS_FLAGS_ENABLE_NEW_MD_INPUT_VIEW_DESCRIPTION,
1278 kOsCrOS,
1279 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewMDInputView)
1282 "enable-physical-keyboard-autocorrect",
1283 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1284 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1285 kOsCrOS,
1286 ENABLE_DISABLE_VALUE_TYPE(
1287 chromeos::switches::kEnablePhysicalKeyboardAutocorrect,
1288 chromeos::switches::kDisablePhysicalKeyboardAutocorrect)
1291 "disable-voice-input",
1292 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME,
1293 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION,
1294 kOsCrOS,
1295 SINGLE_VALUE_TYPE(chromeos::switches::kDisableVoiceInput)
1298 "enable-experimental-input-view-features",
1299 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1300 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1301 kOsCrOS,
1302 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1305 "enable-gesture-typing",
1306 IDS_FLAGS_ENABLE_GESTURE_TYPING_NAME,
1307 IDS_FLAGS_ENABLE_GESTURE_TYPING_DESCRIPTION,
1308 kOsCrOS,
1309 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureTyping)
1312 "disable-smart-virtual-keyboard",
1313 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_NAME,
1314 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_DESCRIPTION,
1315 kOsCrOS,
1316 SINGLE_VALUE_TYPE(keyboard::switches::kDisableSmartVirtualKeyboard)
1318 #endif
1320 "enable-simple-cache-backend",
1321 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1322 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1323 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1324 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1327 "enable-tcp-fast-open",
1328 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1329 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1330 kOsLinux | kOsCrOS | kOsAndroid,
1331 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1333 #if defined(ENABLE_SERVICE_DISCOVERY)
1335 "device-discovery-notifications",
1336 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1337 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1338 kOsDesktop,
1339 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1340 switches::kDisableDeviceDiscoveryNotifications)
1343 "enable-print-preview-register-promos",
1344 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1345 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1346 kOsDesktop,
1347 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1349 #endif // ENABLE_SERVICE_DISCOVERY
1350 #if defined(OS_WIN)
1352 "enable-cloud-print-xps",
1353 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1354 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1355 kOsWin,
1356 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1358 #endif
1359 #if defined(USE_AURA)
1361 "tab-capture-upscale-quality",
1362 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1363 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1364 kOsAll,
1365 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1368 "tab-capture-downscale-quality",
1369 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1370 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1371 kOsAll,
1372 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1374 #endif
1375 #if defined(TOOLKIT_VIEWS)
1377 "tab-close-buttons-hidden-with-touch",
1378 IDS_FLAGS_TAB_CLOSE_BUTTONS_HIDDEN_WITH_TOUCH_NAME,
1379 IDS_FLAGS_TAB_CLOSE_BUTTONS_HIDDEN_WITH_TOUCH_DESCRIPTION,
1380 kOsCrOS | kOsWin | kOsLinux,
1381 MULTI_VALUE_TYPE(kTabCloseButtonsHiddenWithTouchChoices)
1383 #endif
1385 "enable-webgl-draft-extensions",
1386 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1387 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1388 kOsAll,
1389 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1392 "enable-web-midi",
1393 IDS_FLAGS_ENABLE_WEB_MIDI_NAME,
1394 IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION,
1395 kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1396 SINGLE_VALUE_TYPE(switches::kEnableWebMIDI)
1399 "enable-new-profile-management",
1400 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1401 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1402 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1403 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1404 switches::kDisableNewProfileManagement)
1407 "enable-account-consistency",
1408 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1409 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1410 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1411 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1412 switches::kDisableAccountConsistency)
1415 "enable-fast-user-switching",
1416 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1417 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1418 kOsMac | kOsWin | kOsLinux,
1419 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1422 "enable-new-avatar-menu",
1423 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1424 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1425 kOsMac | kOsWin | kOsLinux,
1426 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1427 switches::kDisableNewAvatarMenu)
1430 "enable-iframe-based-signin",
1431 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME,
1432 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION,
1433 kOsMac | kOsWin | kOsLinux,
1434 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin)
1437 "enable-google-profile-info",
1438 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1439 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1440 kOsMac | kOsWin | kOsLinux,
1441 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
1444 "reset-app-list-install-state",
1445 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1446 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1447 kOsMac | kOsWin | kOsLinux,
1448 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
1450 #if defined(ENABLE_APP_LIST)
1451 #if defined(OS_LINUX)
1453 // This is compiled out on non-Linux platforms because otherwise it would be
1454 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1455 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1456 "enable-app-list",
1457 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1458 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1459 kOsLinux,
1460 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1462 #endif
1463 #if defined(ENABLE_EXTENSIONS)
1465 "enable-surface-worker",
1466 IDS_FLAGS_ENABLE_SURFACE_WORKER_NAME,
1467 IDS_FLAGS_ENABLE_SURFACE_WORKER_DESCRIPTION,
1468 kOsDesktop,
1469 SINGLE_VALUE_TYPE(extensions::switches::kEnableSurfaceWorker)
1471 #endif
1473 "disable-drive-apps-in-app-list",
1474 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1475 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1476 kOsCrOS,
1477 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
1479 #endif
1480 #if defined(OS_ANDROID)
1482 "enable-accessibility-tab-switcher",
1483 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1484 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1485 kOsAndroid,
1486 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
1489 // TODO(dmazzoni): remove this flag when native android accessibility
1490 // ships in the stable channel. http://crbug.com/356775
1491 "enable-accessibility-script-injection",
1492 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1493 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1494 kOsAndroid,
1495 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1496 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1498 #endif
1500 "enable-one-copy",
1501 IDS_FLAGS_ONE_COPY_NAME,
1502 IDS_FLAGS_ONE_COPY_DESCRIPTION,
1503 kOsAll,
1504 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy,
1505 switches::kDisableOneCopy)
1508 "enable-zero-copy",
1509 IDS_FLAGS_ZERO_COPY_NAME,
1510 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1511 kOsAll,
1512 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)
1514 #if defined(OS_CHROMEOS)
1516 "enable-first-run-ui-transitions",
1517 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1518 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1519 kOsCrOS,
1520 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1522 #endif
1524 "disable-new-bookmark-apps",
1525 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME,
1526 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION,
1527 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1528 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps,
1529 switches::kDisableNewBookmarkApps)
1531 #if defined(OS_MACOSX)
1533 "disable-hosted-app-shim-creation",
1534 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME,
1535 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION,
1536 kOsMac,
1537 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation)
1540 "enable-hosted-app-quit-notification",
1541 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME,
1542 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION,
1543 kOsMac,
1544 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)
1546 #endif
1548 "enable-ephemeral-apps-in-webstore",
1549 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
1550 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
1551 kOsAll,
1552 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)
1555 "enable-linkable-ephemeral-apps",
1556 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1557 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1558 kOsAll,
1559 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1562 "enable-service-worker-sync",
1563 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1564 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1565 kOsAll,
1566 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1568 #if defined(OS_ANDROID)
1570 "disable-click-delay",
1571 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1572 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1573 kOsAndroid,
1574 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1575 SINGLE_VALUE_TYPE("disable-click-delay")
1578 "disable-pull-to-refresh-effect",
1579 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1580 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1581 kOsAndroid,
1582 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)
1584 #endif
1585 #if defined(OS_MACOSX)
1587 "enable-translate-new-ux",
1588 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1589 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1590 kOsMac,
1591 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1593 #endif
1594 #if defined(TOOLKIT_VIEWS)
1596 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1597 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1598 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1599 kOsCrOS | kOsWin | kOsLinux,
1600 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
1603 "enable-link-disambiguation-popup",
1604 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1605 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1606 kOsCrOS | kOsWin,
1607 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)
1609 #endif
1610 #if defined(ENABLE_EXTENSIONS)
1612 "enable-apps-show-on-first-paint",
1613 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1614 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1615 kOsDesktop,
1616 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1618 #endif
1620 "enhanced-bookmarks-experiment",
1621 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1622 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1623 kOsDesktop | kOsAndroid,
1624 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1625 switches::kEnhancedBookmarksExperiment, "1",
1626 switches::kEnhancedBookmarksExperiment, "0")
1629 "manual-enhanced-bookmarks",
1630 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1631 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1632 kOsDesktop | kOsAndroid,
1633 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1636 "manual-enhanced-bookmarks-optout",
1637 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1638 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1639 kOsDesktop | kOsAndroid,
1640 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1642 #if defined(OS_ANDROID)
1644 "enable-zero-suggest-experiment",
1645 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1646 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1647 kOsAndroid,
1648 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1651 "enable-reader-mode-toolbar-icon",
1652 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1653 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1654 kOsAndroid,
1655 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1657 #endif
1659 "num-raster-threads",
1660 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1661 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1662 kOsAll,
1663 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
1666 "ignore-autocomplete-off-autofill",
1667 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_NAME,
1668 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_DESCRIPTION,
1669 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1670 ENABLE_DISABLE_VALUE_TYPE(
1671 autofill::switches::kIgnoreAutocompleteOffForAutofill,
1672 autofill::switches::kRespectAutocompleteOffForAutofill)
1675 "enable-single-click-autofill",
1676 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1677 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1678 kOsCrOS | kOsMac | kOsWin | kOsLinux | kOsAndroid,
1679 ENABLE_DISABLE_VALUE_TYPE(
1680 autofill::switches::kEnableSingleClickAutofill,
1681 autofill::switches::kDisableSingleClickAutofill)
1684 "enable-permissions-bubbles",
1685 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1686 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1687 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1688 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1689 switches::kDisablePermissionsBubbles)
1692 "enable-session-crashed-bubble",
1693 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1694 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1695 kOsWin | kOsLinux,
1696 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1697 switches::kDisableSessionCrashedBubble)
1700 "enable-out-of-process-pdf",
1701 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1702 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1703 kOsDesktop,
1704 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf,
1705 switches::kDisableOutOfProcessPdf)
1708 "enable-pdf-material-ui",
1709 IDS_FLAGS_PDF_MATERIAL_UI_NAME,
1710 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
1711 kOsDesktop,
1712 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI,
1713 switches::kDisablePdfMaterialUI)
1716 "disable-cast-streaming-hw-encoding",
1717 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1718 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1719 kOsAll,
1720 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)
1722 #if defined(OS_ANDROID)
1724 "disable-cast",
1725 IDS_FLAGS_DISABLE_CAST_NAME,
1726 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1727 kOsAndroid,
1728 SINGLE_VALUE_TYPE(switches::kDisableCast)
1731 "prefetch-search-results",
1732 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1733 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1734 kOsAndroid,
1735 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1737 #endif
1738 #if defined(ENABLE_APP_LIST)
1740 "enable-experimental-app-list",
1741 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1742 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1743 kOsWin | kOsLinux | kOsCrOS,
1744 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList,
1745 app_list::switches::kDisableExperimentalAppList)
1748 "enable-centered-app-list",
1749 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1750 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1751 kOsWin | kOsLinux | kOsCrOS,
1752 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
1754 #endif
1756 "disable-threaded-scrolling",
1757 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1758 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1759 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1760 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)
1763 "bleeding-edge-renderer-mode",
1764 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1765 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1766 kOsAndroid,
1767 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1770 "enable-settings-window",
1771 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1772 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1773 kOsDesktop,
1774 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1775 switches::kDisableSettingsWindow)
1777 #if defined(OS_ANDROID)
1779 "enable-instant-search-clicks",
1780 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1781 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1782 kOsAndroid,
1783 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1785 #endif
1787 "enable-save-password-bubble",
1788 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1789 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1790 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1791 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1792 switches::kDisableSavePasswordBubble)
1794 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1795 // crbug.com/366483 for the target milestone.
1797 "allow-insecure-websocket-from-https-origin",
1798 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME,
1799 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION,
1800 kOsAll,
1801 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin)
1804 "enable-apps-file-associations",
1805 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1806 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1807 kOsMac,
1808 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1810 #if defined(OS_ANDROID)
1812 "enable-embeddedsearch-api",
1813 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1814 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1815 kOsAndroid,
1816 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1819 "enable-app-install-alerts",
1820 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1821 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1822 kOsAndroid,
1823 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1825 #endif
1827 "distance-field-text",
1828 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1829 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1830 kOsAll,
1831 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1832 switches::kDisableDistanceFieldText)
1835 "extension-content-verification",
1836 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1837 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1838 kOsDesktop,
1839 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1841 #if defined(USE_AURA)
1843 "text-input-focus-manager",
1844 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1845 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1846 kOsCrOS | kOsLinux | kOsWin,
1847 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1848 switches::kDisableTextInputFocusManager)
1850 #endif
1851 #if defined(ENABLE_EXTENSIONS)
1853 "extension-active-script-permission",
1854 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1855 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1856 kOsAll,
1857 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1859 #endif
1861 "answers-in-suggest",
1862 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1863 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1864 kOsAndroid | kOsWin | kOsLinux | kOsCrOS,
1865 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest,
1866 switches::kDisableAnswersInSuggest)
1868 #if defined(OS_ANDROID)
1870 "enable-data-reduction-proxy-dev",
1871 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1872 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1873 kOsAndroid,
1874 ENABLE_DISABLE_VALUE_TYPE(
1875 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1876 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1879 "enable-data-reduction-proxy-alt",
1880 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1881 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1882 kOsAndroid,
1883 SINGLE_VALUE_TYPE(
1884 data_reduction_proxy::switches::kEnableDataReductionProxyAlt)
1886 #endif
1888 "disable-experimental-hotwording",
1889 IDS_FLAGS_DISABLE_EXPERIMENTAL_HOTWORDING_NAME,
1890 IDS_FLAGS_DISABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION,
1891 kOsDesktop,
1892 SINGLE_VALUE_TYPE(switches::kDisableExperimentalHotwording)
1895 "enable-hotword-hardware",
1896 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1897 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1898 kOsCrOS,
1899 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)
1901 #if defined(ENABLE_EXTENSIONS)
1903 "enable-embedded-extension-options",
1904 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1905 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1906 kOsDesktop,
1907 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1909 #endif
1910 #if defined(USE_ASH)
1912 "enable-web-app-frame",
1913 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME,
1914 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION,
1915 kOsWin | kOsCrOS,
1916 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)
1918 #endif
1920 "enable-website-settings-manager",
1921 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1922 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1923 kOsDesktop,
1924 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1927 "remember-cert-error-decisions",
1928 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1929 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1930 kOsAll,
1931 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1934 "enable-drop-sync-credential",
1935 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1936 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1937 kOsAll,
1938 ENABLE_DISABLE_VALUE_TYPE(
1939 password_manager::switches::kEnableDropSyncCredential,
1940 password_manager::switches::kDisableDropSyncCredential)
1942 #if defined(ENABLE_EXTENSIONS)
1944 "enable-extension-action-redesign",
1945 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1946 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1947 kOsDesktop,
1948 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
1950 #endif
1952 "autofill-sync-credential",
1953 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1954 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1955 kOsAll,
1956 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
1958 #if !defined(OS_ANDROID)
1960 "enable-message-center-always-scroll-up-upon-notification-removal",
1961 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1962 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1963 kOsDesktop,
1964 SINGLE_VALUE_TYPE(
1965 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
1968 "enable-md-settings",
1969 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME,
1970 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION,
1971 kOsDesktop,
1972 SINGLE_VALUE_TYPE(
1973 switches::kEnableMaterialDesignSettings)
1975 #endif
1976 #if defined(OS_CHROMEOS)
1978 "disable-memory-pressure-chromeos",
1979 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_NAME,
1980 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_DESCRIPTION,
1981 kOsCrOS,
1982 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMemoryPressureSystemChromeOS)
1985 "memory-pressure-thresholds",
1986 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME,
1987 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION,
1988 kOsCrOS,
1989 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices)
1992 "wake-on-packets",
1993 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1994 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1995 kOsCrOSOwnerOnly,
1996 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
1998 #endif // OS_CHROMEOS
2000 "enable-tab-audio-muting",
2001 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
2002 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
2003 kOsDesktop,
2004 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)
2007 "enable-credential-manager-api",
2008 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
2009 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
2010 kOsAll,
2011 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)
2014 "reduced-referrer-granularity",
2015 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
2016 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
2017 kOsAll,
2018 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)
2020 #if defined(ENABLE_PLUGINS)
2022 "enable-plugin-power-saver",
2023 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
2024 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
2025 kOsDesktop,
2026 SINGLE_VALUE_TYPE(switches::kEnablePluginPowerSaver)
2028 #endif
2029 #if defined(OS_CHROMEOS)
2031 "disable-new-zip-unpacker",
2032 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
2033 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
2034 kOsCrOS,
2035 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)
2037 #endif // defined(OS_CHROMEOS)
2039 "ssl-version-min",
2040 IDS_FLAGS_SSL_VERSION_MIN_NAME,
2041 IDS_FLAGS_SSL_VERSION_MIN_DESCRIPTION,
2042 kOsAll,
2043 MULTI_VALUE_TYPE(kSSLVersionMinChoices)
2046 "enable-credit-card-scan",
2047 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
2048 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
2049 kOsAndroid,
2050 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan,
2051 autofill::switches::kDisableCreditCardScan)
2053 #if defined(OS_CHROMEOS)
2055 "enable-captive-portal-bypass-proxy",
2056 IDS_FLAGS_ENABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
2057 IDS_FLAGS_ENABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
2058 kOsCrOS,
2059 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCaptivePortalBypassProxy)
2062 "disable-roboto-font-ui",
2063 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_NAME,
2064 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_DESCRIPTION,
2065 kOsCrOS,
2066 SINGLE_VALUE_TYPE(switches::kDisableRobotoFontUI)
2068 #endif // defined(OS_CHROMEOS)
2069 #if defined(OS_ANDROID)
2071 "enable-seccomp-filter-sandbox",
2072 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
2073 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
2074 kOsAndroid,
2075 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)
2077 #endif
2079 "enable-touch-hover",
2080 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME,
2081 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION,
2082 kOsAndroid,
2083 SINGLE_VALUE_TYPE("enable-touch-hover")
2086 "enable-fill-on-account-select",
2087 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
2088 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
2089 kOsAll,
2090 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices)
2092 #if defined(OS_CHROMEOS)
2094 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA
2095 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
2096 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
2097 kOsCrOS,
2098 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)
2101 "enable-potentially-annoying-security-features",
2102 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME,
2103 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION,
2104 kOsAll,
2105 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)
2107 #endif
2109 "enable-delay-agnostic-aec",
2110 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
2111 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
2112 kOsDesktop,
2113 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)
2116 "mark-non-secure-as", // FLAGS:RECORD_UMA
2117 IDS_MARK_NON_SECURE_AS_NAME,
2118 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
2119 kOsAll,
2120 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)
2123 "enable-site-per-process",
2124 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
2125 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
2126 kOsAll,
2127 SINGLE_VALUE_TYPE(switches::kSitePerProcess)
2129 #if defined(OS_MACOSX)
2131 "enable-harfbuzz-rendertext",
2132 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
2133 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
2134 kOsMac,
2135 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)
2137 #endif // defined(OS_MACOSX)
2138 #if defined(OS_CHROMEOS)
2140 "disable-timezone-tracking",
2141 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
2142 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
2143 kOsCrOS,
2144 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption)
2146 #endif // defined(OS_CHROMEOS)
2148 "enable-data-reduction-proxy-lo-fi",
2149 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME,
2150 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION,
2151 kOsAll,
2152 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2153 kEnableDataReductionProxyLoFi)
2155 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2157 "enable-data-reduction-proxy-bypass-warnings",
2158 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2159 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2160 kOsAndroid,
2161 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2162 kEnableDataReductionProxyBypassWarning)
2164 #endif
2166 "allow-insecure-localhost",
2167 IDS_ALLOW_INSECURE_LOCALHOST,
2168 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION,
2169 kOsAll,
2170 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)
2173 "bypass-app-banner-engagement-checks",
2174 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME,
2175 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION,
2176 kOsAndroid,
2177 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks)
2180 "use-sync-sandbox",
2181 IDS_FLAGS_SYNC_SANDBOX_NAME,
2182 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
2183 kOsAll,
2184 SINGLE_VALUE_TYPE_AND_VALUE(
2185 switches::kSyncServiceURL,
2186 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
2189 // NOTE: Adding new command-line switches requires adding corresponding
2190 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2191 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2194 const Experiment* experiments = kExperiments;
2195 size_t num_experiments = arraysize(kExperiments);
2197 // Stores and encapsulates the little state that about:flags has.
2198 class FlagsState {
2199 public:
2200 FlagsState() : needs_restart_(false) {}
2201 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2202 base::CommandLine* command_line,
2203 SentinelsMode sentinels);
2204 bool IsRestartNeededToCommitChanges();
2205 void SetExperimentEnabled(
2206 FlagsStorage* flags_storage,
2207 const std::string& internal_name,
2208 bool enable);
2209 void RemoveFlagsSwitches(
2210 std::map<std::string, base::CommandLine::StringType>* switch_list);
2211 void ResetAllFlags(FlagsStorage* flags_storage);
2212 void reset();
2214 // Returns the singleton instance of this class
2215 static FlagsState* GetInstance() {
2216 return Singleton<FlagsState>::get();
2219 private:
2220 bool needs_restart_;
2221 std::map<std::string, std::string> flags_switches_;
2223 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2226 // Adds the internal names for the specified experiment to |names|.
2227 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2228 if (e.type == Experiment::SINGLE_VALUE) {
2229 names->insert(e.internal_name);
2230 } else {
2231 DCHECK(e.type == Experiment::MULTI_VALUE ||
2232 e.type == Experiment::ENABLE_DISABLE_VALUE);
2233 for (int i = 0; i < e.num_choices; ++i)
2234 names->insert(e.NameForChoice(i));
2238 // Confirms that an experiment is valid, used in a DCHECK in
2239 // SanitizeList below.
2240 bool ValidateExperiment(const Experiment& e) {
2241 switch (e.type) {
2242 case Experiment::SINGLE_VALUE:
2243 DCHECK_EQ(0, e.num_choices);
2244 DCHECK(!e.choices);
2245 break;
2246 case Experiment::MULTI_VALUE:
2247 DCHECK_GT(e.num_choices, 0);
2248 DCHECK(e.choices);
2249 DCHECK(e.choices[0].command_line_switch);
2250 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2251 break;
2252 case Experiment::ENABLE_DISABLE_VALUE:
2253 DCHECK_EQ(3, e.num_choices);
2254 DCHECK(!e.choices);
2255 DCHECK(e.command_line_switch);
2256 DCHECK(e.command_line_value);
2257 DCHECK(e.disable_command_line_switch);
2258 DCHECK(e.disable_command_line_value);
2259 break;
2260 default:
2261 NOTREACHED();
2263 return true;
2266 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2267 // unknown, to prevent this list to become very long as experiments are added
2268 // and removed.
2269 void SanitizeList(FlagsStorage* flags_storage) {
2270 std::set<std::string> known_experiments;
2271 for (size_t i = 0; i < num_experiments; ++i) {
2272 DCHECK(ValidateExperiment(experiments[i]));
2273 AddInternalName(experiments[i], &known_experiments);
2276 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2278 std::set<std::string> new_enabled_experiments =
2279 base::STLSetIntersection<std::set<std::string> >(
2280 known_experiments, enabled_experiments);
2282 if (new_enabled_experiments != enabled_experiments)
2283 flags_storage->SetFlags(new_enabled_experiments);
2286 void GetSanitizedEnabledFlags(
2287 FlagsStorage* flags_storage, std::set<std::string>* result) {
2288 SanitizeList(flags_storage);
2289 *result = flags_storage->GetFlags();
2292 bool SkipConditionalExperiment(const Experiment& experiment,
2293 FlagsStorage* flags_storage) {
2294 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2295 (experiment.internal_name ==
2296 std::string("manual-enhanced-bookmarks-optout"))) {
2297 return true;
2300 #if defined(OS_ANDROID) || defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2301 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2302 #endif
2304 #if defined(OS_ANDROID)
2305 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2306 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2307 channel != chrome::VersionInfo::CHANNEL_BETA &&
2308 channel != chrome::VersionInfo::CHANNEL_DEV) {
2309 return true;
2311 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2312 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2313 channel != chrome::VersionInfo::CHANNEL_DEV) {
2314 return true;
2316 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and
2317 // the Canary/Dev channel.
2318 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) &&
2319 channel != chrome::VersionInfo::CHANNEL_DEV &&
2320 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2321 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2322 return true;
2324 #endif
2326 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2327 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2328 // builds and Canary/Dev channel.
2329 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2330 experiment.internal_name) &&
2331 channel != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2332 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2333 channel != chrome::VersionInfo::CHANNEL_DEV) {
2334 return true;
2336 #endif
2338 return false;
2342 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2343 // enabled on the current platform.
2344 void GetSanitizedEnabledFlagsForCurrentPlatform(
2345 FlagsStorage* flags_storage, std::set<std::string>* result) {
2346 GetSanitizedEnabledFlags(flags_storage, result);
2348 // Filter out any experiments that aren't enabled on the current platform. We
2349 // don't remove these from prefs else syncing to a platform with a different
2350 // set of experiments would be lossy.
2351 std::set<std::string> platform_experiments;
2352 int current_platform = GetCurrentPlatform();
2353 for (size_t i = 0; i < num_experiments; ++i) {
2354 if (experiments[i].supported_platforms & current_platform)
2355 AddInternalName(experiments[i], &platform_experiments);
2356 #if defined(OS_CHROMEOS)
2357 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2358 AddInternalName(experiments[i], &platform_experiments);
2359 #endif
2362 std::set<std::string> new_enabled_experiments =
2363 base::STLSetIntersection<std::set<std::string> >(
2364 platform_experiments, *result);
2366 result->swap(new_enabled_experiments);
2369 // Returns the Value representing the choice data in the specified experiment.
2370 base::Value* CreateChoiceData(
2371 const Experiment& experiment,
2372 const std::set<std::string>& enabled_experiments) {
2373 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2374 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2375 base::ListValue* result = new base::ListValue;
2376 for (int i = 0; i < experiment.num_choices; ++i) {
2377 base::DictionaryValue* value = new base::DictionaryValue;
2378 const std::string name = experiment.NameForChoice(i);
2379 value->SetString("internal_name", name);
2380 value->SetString("description", experiment.DescriptionForChoice(i));
2381 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2382 result->Append(value);
2384 return result;
2387 } // namespace
2389 std::string Experiment::NameForChoice(int index) const {
2390 DCHECK(type == Experiment::MULTI_VALUE ||
2391 type == Experiment::ENABLE_DISABLE_VALUE);
2392 DCHECK_LT(index, num_choices);
2393 return std::string(internal_name) + testing::kMultiSeparator +
2394 base::IntToString(index);
2397 base::string16 Experiment::DescriptionForChoice(int index) const {
2398 DCHECK(type == Experiment::MULTI_VALUE ||
2399 type == Experiment::ENABLE_DISABLE_VALUE);
2400 DCHECK_LT(index, num_choices);
2401 int description_id;
2402 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2403 const int kEnableDisableDescriptionIds[] = {
2404 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2405 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2406 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2408 description_id = kEnableDisableDescriptionIds[index];
2409 } else {
2410 description_id = choices[index].description_id;
2412 return l10n_util::GetStringUTF16(description_id);
2415 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2416 base::CommandLine* command_line,
2417 SentinelsMode sentinels) {
2418 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2419 command_line,
2420 sentinels);
2423 bool AreSwitchesIdenticalToCurrentCommandLine(
2424 const base::CommandLine& new_cmdline,
2425 const base::CommandLine& active_cmdline,
2426 std::set<base::CommandLine::StringType>* out_difference) {
2427 std::set<base::CommandLine::StringType> new_flags =
2428 ExtractFlagsFromCommandLine(new_cmdline);
2429 std::set<base::CommandLine::StringType> active_flags =
2430 ExtractFlagsFromCommandLine(active_cmdline);
2432 bool result = false;
2433 // Needed because std::equal doesn't check if the 2nd set is empty.
2434 if (new_flags.size() == active_flags.size()) {
2435 result =
2436 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2439 if (out_difference && !result) {
2440 std::set_symmetric_difference(
2441 new_flags.begin(),
2442 new_flags.end(),
2443 active_flags.begin(),
2444 active_flags.end(),
2445 std::inserter(*out_difference, out_difference->begin()));
2448 return result;
2451 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2452 FlagAccess access,
2453 base::ListValue* supported_experiments,
2454 base::ListValue* unsupported_experiments) {
2455 std::set<std::string> enabled_experiments;
2456 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2458 int current_platform = GetCurrentPlatform();
2460 for (size_t i = 0; i < num_experiments; ++i) {
2461 const Experiment& experiment = experiments[i];
2462 if (SkipConditionalExperiment(experiment, flags_storage))
2463 continue;
2465 base::DictionaryValue* data = new base::DictionaryValue();
2466 data->SetString("internal_name", experiment.internal_name);
2467 data->SetString("name",
2468 l10n_util::GetStringUTF16(experiment.visible_name_id));
2469 data->SetString("description",
2470 l10n_util::GetStringUTF16(
2471 experiment.visible_description_id));
2473 base::ListValue* supported_platforms = new base::ListValue();
2474 AddOsStrings(experiment.supported_platforms, supported_platforms);
2475 data->Set("supported_platforms", supported_platforms);
2477 switch (experiment.type) {
2478 case Experiment::SINGLE_VALUE:
2479 data->SetBoolean(
2480 "enabled",
2481 enabled_experiments.count(experiment.internal_name) > 0);
2482 break;
2483 case Experiment::MULTI_VALUE:
2484 case Experiment::ENABLE_DISABLE_VALUE:
2485 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2486 break;
2487 default:
2488 NOTREACHED();
2491 bool supported = (experiment.supported_platforms & current_platform) != 0;
2492 #if defined(OS_CHROMEOS)
2493 if (access == kOwnerAccessToFlags &&
2494 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2495 supported = true;
2497 #endif
2498 if (supported)
2499 supported_experiments->Append(data);
2500 else
2501 unsupported_experiments->Append(data);
2505 bool IsRestartNeededToCommitChanges() {
2506 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2509 void SetExperimentEnabled(FlagsStorage* flags_storage,
2510 const std::string& internal_name,
2511 bool enable) {
2512 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2513 internal_name, enable);
2516 void RemoveFlagsSwitches(
2517 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2518 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2521 void ResetAllFlags(FlagsStorage* flags_storage) {
2522 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2525 int GetCurrentPlatform() {
2526 #if defined(OS_MACOSX)
2527 return kOsMac;
2528 #elif defined(OS_WIN)
2529 return kOsWin;
2530 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2531 return kOsCrOS;
2532 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2533 return kOsLinux;
2534 #elif defined(OS_ANDROID)
2535 return kOsAndroid;
2536 #else
2537 #error Unknown platform
2538 #endif
2541 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2542 std::set<std::string> flags = flags_storage->GetFlags();
2543 for (const std::string& flag : flags) {
2544 std::string action("AboutFlags_");
2545 action += flag;
2546 content::RecordComputedAction(action);
2548 // Since flag metrics are recorded every startup, add a tick so that the
2549 // stats can be made meaningful.
2550 if (flags.size())
2551 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2552 content::RecordAction(base::UserMetricsAction("StartupTick"));
2555 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2556 return static_cast<base::HistogramBase::Sample>(
2557 metrics::HashMetricName(switch_name));
2560 void ReportCustomFlags(const std::string& uma_histogram_hame,
2561 const std::set<std::string>& command_line_difference) {
2562 for (const std::string& flag : command_line_difference) {
2563 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2564 if (StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2565 // Skip '--' before switch name.
2566 std::string switch_name(flag.substr(2));
2568 // Kill value, if any.
2569 const size_t value_pos = switch_name.find('=');
2570 if (value_pos != std::string::npos)
2571 switch_name.resize(value_pos);
2573 uma_id = GetSwitchUMAId(switch_name);
2574 } else {
2575 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2576 << "' has incorrect format.";
2578 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2579 << "' '" << flag << "', uma_id=" << uma_id;
2581 // Sparse histogram macro does not cache the histogram, so it's safe
2582 // to use macro with non-static histogram name here.
2583 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2587 //////////////////////////////////////////////////////////////////////////////
2588 // FlagsState implementation.
2590 namespace {
2592 typedef std::map<std::string, std::pair<std::string, std::string> >
2593 NameToSwitchAndValueMap;
2595 void SetFlagToSwitchMapping(const std::string& key,
2596 const std::string& switch_name,
2597 const std::string& switch_value,
2598 NameToSwitchAndValueMap* name_to_switch_map) {
2599 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2600 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2603 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2604 base::CommandLine* command_line,
2605 SentinelsMode sentinels) {
2606 if (command_line->HasSwitch(switches::kNoExperiments))
2607 return;
2609 std::set<std::string> enabled_experiments;
2611 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2612 &enabled_experiments);
2614 NameToSwitchAndValueMap name_to_switch_map;
2615 for (size_t i = 0; i < num_experiments; ++i) {
2616 const Experiment& e = experiments[i];
2617 if (e.type == Experiment::SINGLE_VALUE) {
2618 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2619 e.command_line_value, &name_to_switch_map);
2620 } else if (e.type == Experiment::MULTI_VALUE) {
2621 for (int j = 0; j < e.num_choices; ++j) {
2622 SetFlagToSwitchMapping(e.NameForChoice(j),
2623 e.choices[j].command_line_switch,
2624 e.choices[j].command_line_value,
2625 &name_to_switch_map);
2627 } else {
2628 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2629 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2630 &name_to_switch_map);
2631 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2632 e.command_line_value, &name_to_switch_map);
2633 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2634 e.disable_command_line_value, &name_to_switch_map);
2638 if (sentinels == kAddSentinels) {
2639 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2640 flags_switches_.insert(
2641 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2642 std::string()));
2644 for (const std::string& experiment_name : enabled_experiments) {
2645 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2646 name_to_switch_map.find(experiment_name);
2647 if (name_to_switch_it == name_to_switch_map.end()) {
2648 NOTREACHED();
2649 continue;
2652 #if defined(OS_CHROMEOS)
2653 // On Chrome OS setting command line flag may make browser to restart on
2654 // user login. As this flag eventually will be set to a significant number
2655 // of users skip manual-enhanced-bookmarks to avoid restart.
2656 if (experiment_name == "manual-enhanced-bookmarks")
2657 continue;
2658 #endif
2660 const std::pair<std::string, std::string>&
2661 switch_and_value_pair = name_to_switch_it->second;
2663 CHECK(!switch_and_value_pair.first.empty());
2664 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2665 switch_and_value_pair.second);
2666 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2668 if (sentinels == kAddSentinels) {
2669 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2670 flags_switches_.insert(
2671 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2672 std::string()));
2676 bool FlagsState::IsRestartNeededToCommitChanges() {
2677 return needs_restart_;
2680 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2681 const std::string& internal_name,
2682 bool enable) {
2683 size_t at_index = internal_name.find(testing::kMultiSeparator);
2684 if (at_index != std::string::npos) {
2685 DCHECK(enable);
2686 // We're being asked to enable a multi-choice experiment. Disable the
2687 // currently selected choice.
2688 DCHECK_NE(at_index, 0u);
2689 const std::string experiment_name = internal_name.substr(0, at_index);
2690 SetExperimentEnabled(flags_storage, experiment_name, false);
2692 // And enable the new choice, if it is not the default first choice.
2693 if (internal_name != experiment_name + "@0") {
2694 std::set<std::string> enabled_experiments;
2695 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2696 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2697 flags_storage->SetFlags(enabled_experiments);
2699 return;
2702 std::set<std::string> enabled_experiments;
2703 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2705 const Experiment* e = NULL;
2706 for (size_t i = 0; i < num_experiments; ++i) {
2707 if (experiments[i].internal_name == internal_name) {
2708 e = experiments + i;
2709 break;
2712 DCHECK(e);
2714 if (e->type == Experiment::SINGLE_VALUE) {
2715 if (enable)
2716 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2717 else
2718 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2719 } else {
2720 if (enable) {
2721 // Enable the first choice.
2722 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2723 } else {
2724 // Find the currently enabled choice and disable it.
2725 for (int i = 0; i < e->num_choices; ++i) {
2726 std::string choice_name = e->NameForChoice(i);
2727 if (enabled_experiments.find(choice_name) !=
2728 enabled_experiments.end()) {
2729 needs_restart_ = true;
2730 enabled_experiments.erase(choice_name);
2731 // Continue on just in case there's a bug and more than one
2732 // experiment for this choice was enabled.
2738 flags_storage->SetFlags(enabled_experiments);
2741 void FlagsState::RemoveFlagsSwitches(
2742 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2743 for (const auto& entry : flags_switches_)
2744 switch_list->erase(entry.first);
2747 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2748 needs_restart_ = true;
2750 std::set<std::string> no_experiments;
2751 flags_storage->SetFlags(no_experiments);
2754 void FlagsState::reset() {
2755 needs_restart_ = false;
2756 flags_switches_.clear();
2759 } // namespace
2761 namespace testing {
2763 // WARNING: '@' is also used in the html file. If you update this constant you
2764 // also need to update the html file.
2765 const char kMultiSeparator[] = "@";
2767 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2769 void ClearState() {
2770 FlagsState::GetInstance()->reset();
2773 void SetExperiments(const Experiment* e, size_t count) {
2774 if (!e) {
2775 experiments = kExperiments;
2776 num_experiments = arraysize(kExperiments);
2777 } else {
2778 experiments = e;
2779 num_experiments = count;
2783 const Experiment* GetExperiments(size_t* count) {
2784 *count = num_experiments;
2785 return experiments;
2788 } // namespace testing
2790 } // namespace about_flags