Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blob75833e5d2013da08e9ffacd5859b94f44b3ab49e
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/flags_storage.h"
22 #include "chrome/common/chrome_content_client.h"
23 #include "chrome/common/chrome_switches.h"
24 #include "chrome/grit/generated_resources.h"
25 #include "components/autofill/core/common/autofill_switches.h"
26 #include "components/cloud_devices/common/cloud_devices_switches.h"
27 #include "components/metrics/metrics_hashes.h"
28 #include "components/nacl/common/nacl_switches.h"
29 #include "components/omnibox/omnibox_switches.h"
30 #include "components/proximity_auth/switches.h"
31 #include "components/search/search_switches.h"
32 #include "content/public/browser/user_metrics.h"
33 #include "media/base/media_switches.h"
34 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/base/ui_base_switches.h"
36 #include "ui/display/display_switches.h"
37 #include "ui/events/event_switches.h"
38 #include "ui/gfx/switches.h"
39 #include "ui/gl/gl_switches.h"
40 #include "ui/keyboard/keyboard_switches.h"
41 #include "ui/native_theme/native_theme_switches.h"
42 #include "ui/views/views_switches.h"
44 #if defined(OS_ANDROID)
45 #include "chrome/common/chrome_version_info.h"
46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
47 #else
48 #include "ui/message_center/message_center_switches.h"
49 #endif
51 #if defined(USE_ASH)
52 #include "ash/ash_switches.h"
53 #endif
55 #if defined(OS_CHROMEOS)
56 #include "chromeos/chromeos_switches.h"
57 #include "third_party/cros_system_api/switches/chrome_switches.h"
58 #endif
60 #if defined(ENABLE_APP_LIST)
61 #include "ui/app_list/app_list_switches.h"
62 #endif
64 #if defined(ENABLE_EXTENSIONS)
65 #include "extensions/common/switches.h"
66 #endif
68 #if defined(USE_OZONE)
69 #include "ui/ozone/public/ozone_switches.h"
70 #endif
72 namespace about_flags {
74 // Macros to simplify specifying the type.
75 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
76 Experiment::SINGLE_VALUE, \
77 command_line_switch, switch_value, NULL, NULL, NULL, 0
78 #define SINGLE_VALUE_TYPE(command_line_switch) \
79 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
80 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
81 disable_switch, disable_value) \
82 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
83 disable_switch, disable_value, NULL, 3
84 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
85 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
86 #define MULTI_VALUE_TYPE(choices) \
87 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
89 namespace {
91 // Enumeration of OSs.
92 enum {
93 kOsMac = 1 << 0,
94 kOsWin = 1 << 1,
95 kOsLinux = 1 << 2,
96 kOsCrOS = 1 << 3,
97 kOsAndroid = 1 << 4,
98 kOsCrOSOwnerOnly = 1 << 5
101 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
102 const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
104 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
105 // whether the experiment is available on that platform.
106 void AddOsStrings(unsigned bitmask, base::ListValue* list) {
107 struct {
108 unsigned bit;
109 const char* const name;
110 } kBitsToOs[] = {
111 {kOsMac, "Mac"},
112 {kOsWin, "Windows"},
113 {kOsLinux, "Linux"},
114 {kOsCrOS, "Chrome OS"},
115 {kOsAndroid, "Android"},
116 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
118 for (size_t i = 0; i < arraysize(kBitsToOs); ++i) {
119 if (bitmask & kBitsToOs[i].bit)
120 list->Append(new base::StringValue(kBitsToOs[i].name));
124 // Convert switch constants to proper CommandLine::StringType strings.
125 base::CommandLine::StringType GetSwitchString(const std::string& flag) {
126 base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM);
127 cmd_line.AppendSwitch(flag);
128 DCHECK_EQ(2U, cmd_line.argv().size());
129 return cmd_line.argv()[1];
132 // Scoops flags from a command line.
133 std::set<base::CommandLine::StringType> ExtractFlagsFromCommandLine(
134 const base::CommandLine& cmdline) {
135 std::set<base::CommandLine::StringType> flags;
136 // First do the ones between --flag-switches-begin and --flag-switches-end.
137 base::CommandLine::StringVector::const_iterator first =
138 std::find(cmdline.argv().begin(), cmdline.argv().end(),
139 GetSwitchString(switches::kFlagSwitchesBegin));
140 base::CommandLine::StringVector::const_iterator last =
141 std::find(cmdline.argv().begin(), cmdline.argv().end(),
142 GetSwitchString(switches::kFlagSwitchesEnd));
143 if (first != cmdline.argv().end() && last != cmdline.argv().end())
144 flags.insert(first + 1, last);
145 #if defined(OS_CHROMEOS)
146 // Then add those between --policy-switches-begin and --policy-switches-end.
147 first = std::find(cmdline.argv().begin(), cmdline.argv().end(),
148 GetSwitchString(chromeos::switches::kPolicySwitchesBegin));
149 last = std::find(cmdline.argv().begin(), cmdline.argv().end(),
150 GetSwitchString(chromeos::switches::kPolicySwitchesEnd));
151 if (first != cmdline.argv().end() && last != cmdline.argv().end())
152 flags.insert(first + 1, last);
153 #endif
154 return flags;
157 const Experiment::Choice kTouchEventsChoices[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
159 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
160 switches::kTouchEvents,
161 switches::kTouchEventsEnabled },
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
163 switches::kTouchEvents,
164 switches::kTouchEventsDisabled }
167 #if defined(USE_AURA)
168 const Experiment::Choice kOverscrollHistoryNavigationChoices[] = {
169 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, "", "" },
170 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
171 switches::kOverscrollHistoryNavigation,
172 "0" },
173 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI,
174 switches::kOverscrollHistoryNavigation,
175 "2" }
177 #endif
179 #if !defined(DISABLE_NACL)
180 const Experiment::Choice kNaClDebugMaskChoices[] = {
181 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
182 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
183 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
184 // so by default we want to avoid debugging that.
185 // NOTE: As the default value must be the empty string, the mask excluding
186 // the PNaCl translator and secure shell is substituted elsewhere.
187 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
188 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
189 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
190 switches::kNaClDebugMask, "*://*/*debug.nmf" }
192 #endif
194 const Experiment::Choice kMarkNonSecureAsChoices[] = {
195 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
196 { IDS_MARK_NON_SECURE_AS_NEUTRAL,
197 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNeutral},
198 { IDS_MARK_NON_SECURE_AS_NON_SECURE,
199 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNonSecure},
200 { IDS_MARK_NON_SECURE_AS_DUBIOUS,
201 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious}
204 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
205 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
206 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
207 cc::switches::kMaxTilesForInterestArea, "64"},
208 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
209 cc::switches::kMaxTilesForInterestArea, "128"},
210 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
211 cc::switches::kMaxTilesForInterestArea, "256"},
212 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
213 cc::switches::kMaxTilesForInterestArea, "512"}
216 const Experiment::Choice kShowSavedCopyChoices[] = {
217 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
218 { IDS_FLAGS_ENABLE_SHOW_SAVED_COPY_PRIMARY,
219 switches::kShowSavedCopy, switches::kEnableShowSavedCopyPrimary },
220 { IDS_FLAGS_ENABLE_SHOW_SAVED_COPY_SECONDARY,
221 switches::kShowSavedCopy, switches::kEnableShowSavedCopySecondary },
222 { IDS_FLAGS_DISABLE_SHOW_SAVED_COPY,
223 switches::kShowSavedCopy, switches::kDisableShowSavedCopy }
226 const Experiment::Choice kDefaultTileWidthChoices[] = {
227 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
228 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
229 switches::kDefaultTileWidth, "128"},
230 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
231 switches::kDefaultTileWidth, "256"},
232 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
233 switches::kDefaultTileWidth, "512"},
234 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
235 switches::kDefaultTileWidth, "1024"}
238 const Experiment::Choice kDefaultTileHeightChoices[] = {
239 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
240 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
241 switches::kDefaultTileHeight, "128"},
242 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
243 switches::kDefaultTileHeight, "256"},
244 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
245 switches::kDefaultTileHeight, "512"},
246 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
247 switches::kDefaultTileHeight, "1024"}
250 const Experiment::Choice kSimpleCacheBackendChoices[] = {
251 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
252 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
253 switches::kUseSimpleCacheBackend, "off" },
254 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
255 switches::kUseSimpleCacheBackend, "on"}
258 #if defined(USE_AURA)
259 const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
260 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
261 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
262 switches::kTabCaptureUpscaleQuality, "fast" },
263 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
264 switches::kTabCaptureUpscaleQuality, "good" },
265 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
266 switches::kTabCaptureUpscaleQuality, "best" },
269 const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
270 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
271 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
272 switches::kTabCaptureDownscaleQuality, "fast" },
273 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
274 switches::kTabCaptureDownscaleQuality, "good" },
275 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
276 switches::kTabCaptureDownscaleQuality, "best" },
278 #endif
280 #if defined(OS_ANDROID)
281 const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
282 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
283 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
284 switches::kEnableZeroSuggestMostVisited, ""},
285 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED_WITHOUT_SERP,
286 switches::kEnableZeroSuggestMostVisitedWithoutSerp, ""},
287 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
288 switches::kDisableZeroSuggest, ""}
290 #endif
292 const Experiment::Choice kNumRasterThreadsChoices[] = {
293 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
294 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
295 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
296 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
297 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
300 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
301 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
302 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
303 switches::kEnableGpuRasterization, "" },
304 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
305 switches::kDisableGpuRasterization, "" },
306 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
307 switches::kForceGpuRasterization, "" },
310 #if defined(OS_CHROMEOS)
311 const Experiment::Choice kMemoryPressureThresholdChoices[] = {
312 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
313 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS,
314 chromeos::switches::kMemoryPressureThresholds,
315 chromeos::switches::kConservativeThreshold },
316 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS,
317 chromeos::switches::kMemoryPressureThresholds,
318 chromeos::switches::kAggressiveCacheDiscardThreshold },
319 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS,
320 chromeos::switches::kMemoryPressureThresholds,
321 chromeos::switches::kAggressiveTabDiscardThreshold },
322 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS,
323 chromeos::switches::kMemoryPressureThresholds,
324 chromeos::switches::kAggressiveThreshold },
326 #endif
328 const Experiment::Choice kExtensionContentVerificationChoices[] = {
329 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
330 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
331 switches::kExtensionContentVerification,
332 switches::kExtensionContentVerificationBootstrap },
333 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
334 switches::kExtensionContentVerification,
335 switches::kExtensionContentVerificationEnforce },
336 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
337 switches::kExtensionContentVerification,
338 switches::kExtensionContentVerificationEnforceStrict },
341 // Note that the value is specified in seconds (where 0 is equivalent to
342 // disabled).
343 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
344 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
345 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
346 switches::kRememberCertErrorDecisions,
347 "-1" },
348 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
349 switches::kRememberCertErrorDecisions,
350 "86400" },
351 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
352 switches::kRememberCertErrorDecisions,
353 "259200" },
354 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
355 switches::kRememberCertErrorDecisions,
356 "604800" },
357 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
358 switches::kRememberCertErrorDecisions,
359 "2592000" },
360 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
361 switches::kRememberCertErrorDecisions,
362 "7776000" },
365 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
366 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
367 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
368 password_manager::switches::kAllowAutofillSyncCredential, ""},
369 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
370 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
371 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
372 password_manager::switches::kDisallowAutofillSyncCredential, ""},
375 const Experiment::Choice kSSLVersionMinChoices[] = {
376 { IDS_FLAGS_SSL_VERSION_DEFAULT, "", "" },
377 { IDS_FLAGS_SSL_VERSION_SSLV3, switches::kSSLVersionMin,
378 switches::kSSLVersionSSLv3 },
379 { IDS_FLAGS_SSL_VERSION_TLSV1, switches::kSSLVersionMin,
380 switches::kSSLVersionTLSv1 },
381 { IDS_FLAGS_SSL_VERSION_TLSV11, switches::kSSLVersionMin,
382 switches::kSSLVersionTLSv11 },
383 { IDS_FLAGS_SSL_VERSION_TLSV12, switches::kSSLVersionMin,
384 switches::kSSLVersionTLSv12 },
387 const Experiment::Choice kFillOnAccountSelectChoices[] = {
388 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
389 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
390 autofill::switches::kDisableFillOnAccountSelect, "" },
391 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING,
392 autofill::switches::kEnableFillOnAccountSelect, "" },
393 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING,
394 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" },
397 #if defined(USE_ASH)
398 const Experiment::Choice kAshScreenRotationAnimationChoices[] = {
399 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
400 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
401 ash::switches::kAshEnableScreenRotationAnimation,
402 "none" },
403 { IDS_ASH_SCREEN_ROTATION_ANIMATION_PARTIAL_ROTATION,
404 ash::switches::kAshEnableScreenRotationAnimation,
405 "partial-rotation" },
406 { IDS_ASH_SCREEN_ROTATION_ANIMATION_FULL_ROTATION,
407 ash::switches::kAshEnableScreenRotationAnimation,
408 "full-rotation" }
410 #endif
412 // RECORDING USER METRICS FOR FLAGS:
413 // -----------------------------------------------------------------------------
414 // The first line of the experiment is the internal name. If you'd like to
415 // gather statistics about the usage of your flag, you should append a marker
416 // comment to the end of the feature name, like so:
417 // "my-special-feature", // FLAGS:RECORD_UMA
419 // After doing that, run
420 // tools/metrics/actions/extract_actions.py
421 // to add the metric to actions.xml (which will enable UMA to record your
422 // feature flag), then update the <owner>s and <description> sections. Make sure
423 // to include the actions.xml file when you upload your code for review!
425 // After your feature has shipped under a flag, you can locate the metrics under
426 // the action name AboutFlags_internal-action-name. Actions are recorded once
427 // per startup, so you should divide this number by AboutFlags_StartupTick to
428 // get a sense of usage. Note that this will not be the same as number of users
429 // with a given feature enabled because users can quit and relaunch the
430 // application multiple times over a given time interval. The dashboard also
431 // shows you how many (metrics reporting) users have enabled the flag over the
432 // last seven days. However, note that this is not the same as the number of
433 // users who have the flag enabled, since enabling the flag happens once,
434 // whereas running with the flag enabled happens until the user flips the flag
435 // again.
437 // To add a new experiment add to the end of kExperiments. There are two
438 // distinct types of experiments:
439 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
440 // macro for this type supplying the command line to the macro.
441 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
442 // deactivated state for this lab (i.e. no command line option). To specify
443 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
444 // array of choices.
445 // See the documentation of Experiment for details on the fields.
447 // Command-line switches must have entries in enum "LoginCustomFlags" in
448 // histograms.xml. See note in histograms.xml and don't forget to run
449 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
451 // When adding a new choice, add it to the end of the list.
452 const Experiment kExperiments[] = {
454 "ignore-gpu-blacklist",
455 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
456 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
457 kOsAll,
458 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
460 #if defined(OS_WIN)
462 "disable-direct-write",
463 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
464 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
465 kOsWin,
466 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
469 "enable-win32k-renderer-lockdown",
470 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_NAME,
471 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_DESCRIPTION,
472 kOsWin,
473 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableWin32kRendererLockDown,
474 switches::kDisableWin32kRendererLockDown)
476 #endif
478 "enable-experimental-canvas-features",
479 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
480 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
481 kOsAll,
482 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
485 "disable-accelerated-2d-canvas",
486 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
487 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
488 kOsAll,
489 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
492 "enable-display-list-2d-canvas",
493 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
494 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
495 kOsAll,
496 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas,
497 switches::kDisableDisplayList2dCanvas)
500 "composited-layer-borders",
501 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
502 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
503 kOsAll,
504 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
507 "show-fps-counter",
508 IDS_FLAGS_SHOW_FPS_COUNTER,
509 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
510 kOsAll,
511 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
514 "disable-webgl",
515 IDS_FLAGS_DISABLE_WEBGL_NAME,
516 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
517 kOsAll,
518 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
520 #if defined(OS_WIN) || defined(OS_MACOSX)
522 "enable-npapi",
523 IDS_FLAGS_ENABLE_NPAPI_NAME,
524 IDS_FLAGS_ENABLE_NPAPI_DESCRIPTION,
525 kOsWin | kOsMac,
526 SINGLE_VALUE_TYPE(switches::kEnableNpapi)
528 #endif
530 "disable-webrtc",
531 IDS_FLAGS_DISABLE_WEBRTC_NAME,
532 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
533 kOsAndroid,
534 #if defined(OS_ANDROID)
535 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
536 #else
537 SINGLE_VALUE_TYPE("")
538 #endif
540 #if defined(ENABLE_WEBRTC)
542 "disable-webrtc-hw-decoding",
543 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
544 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
545 kOsAndroid | kOsCrOS,
546 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
549 "disable-webrtc-hw-encoding",
550 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
551 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
552 kOsAndroid | kOsCrOS,
553 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
556 "enable-webrtc-stun-origin",
557 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_NAME,
558 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_DESCRIPTION,
559 kOsAll,
560 SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin)
562 #endif
563 #if defined(OS_ANDROID)
565 "disable-webaudio",
566 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
567 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
568 kOsAndroid,
569 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
571 #endif
572 // Native client is compiled out when DISABLE_NACL is defined.
573 #if !defined(DISABLE_NACL)
575 "enable-nacl", // FLAGS:RECORD_UMA
576 IDS_FLAGS_ENABLE_NACL_NAME,
577 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
578 kOsAll,
579 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
582 "enable-nacl-debug", // FLAGS:RECORD_UMA
583 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
584 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
585 kOsDesktop,
586 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
589 "nacl-debug-mask", // FLAGS:RECORD_UMA
590 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
591 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
592 kOsDesktop,
593 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
595 #endif
596 #if defined(ENABLE_EXTENSIONS)
598 "extension-apis", // FLAGS:RECORD_UMA
599 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
600 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
601 kOsDesktop,
602 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
605 "extensions-on-chrome-urls",
606 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
607 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
608 kOsAll,
609 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
611 #endif
613 "enable-fast-unload",
614 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
615 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
616 kOsAll,
617 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
619 #if defined(ENABLE_EXTENSIONS)
621 "enable-app-window-controls",
622 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
623 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
624 kOsDesktop,
625 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
627 #endif
629 "disable-hyperlink-auditing",
630 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
631 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
632 kOsAll,
633 SINGLE_VALUE_TYPE(switches::kNoPings)
635 #if defined(OS_ANDROID)
637 "contextual-search",
638 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
639 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
640 kOsAndroid,
641 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
642 switches::kDisableContextualSearch)
644 #endif
646 "show-autofill-type-predictions",
647 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
648 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
649 kOsAll,
650 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
653 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
654 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
655 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
656 // Can't expose the switch unless the code is compiled in.
657 // On by default for the Mac (different implementation in WebKit).
658 kOsLinux,
659 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
661 #if defined(USE_AURA) || defined(OS_LINUX)
663 "overlay-scrollbars",
664 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
665 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
666 // Uses the system preference on Mac (a different implementation).
667 // On Android, this is always enabled.
668 kOsLinux | kOsCrOS | kOsWin,
669 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar,
670 switches::kDisableOverlayScrollbar)
672 #endif
674 "enable-panels",
675 IDS_FLAGS_ENABLE_PANELS_NAME,
676 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
677 kOsDesktop,
678 SINGLE_VALUE_TYPE(switches::kEnablePanels)
681 // See http://crbug.com/120416 for how to remove this flag.
682 "save-page-as-mhtml", // FLAGS:RECORD_UMA
683 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
684 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
685 kOsMac | kOsWin | kOsLinux,
686 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
689 "enable-quic",
690 IDS_FLAGS_ENABLE_QUIC_NAME,
691 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
692 kOsAll,
693 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
694 switches::kDisableQuic)
697 "enable-spdy4",
698 IDS_FLAGS_ENABLE_SPDY4_NAME,
699 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
700 kOsAll,
701 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
704 "disable-media-source",
705 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
706 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
707 kOsAll,
708 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
711 "disable-encrypted-media",
712 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
713 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
714 kOsAll,
715 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
718 "disable-prefixed-encrypted-media",
719 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
720 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
721 kOsAll,
722 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
724 #if defined(OS_ANDROID)
726 "disable-infobar-for-protected-media-identifier",
727 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
728 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
729 kOsAndroid,
730 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
732 #endif // defined(OS_ANDROID)
734 "disable-javascript-harmony-shipping",
735 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_NAME,
736 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_DESCRIPTION,
737 kOsAll,
738 SINGLE_VALUE_TYPE(switches::kDisableJavaScriptHarmonyShipping)
741 "enable-javascript-harmony",
742 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
743 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
744 kOsAll,
745 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
748 "disable-software-rasterizer",
749 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
750 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
751 #if defined(ENABLE_SWIFTSHADER)
752 kOsAll,
753 #else
755 #endif
756 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
759 "enable-gpu-rasterization",
760 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
761 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
762 kOsAll,
763 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
766 "enable-threaded-gpu-rasterization",
767 IDS_FLAGS_ENABLE_THREADED_GPU_RASTERIZATION_NAME,
768 IDS_FLAGS_ENABLE_THREADED_GPU_RASTERIZATION_DESCRIPTION,
769 kOsAll,
770 ENABLE_DISABLE_VALUE_TYPE(
771 switches::kEnableThreadedGpuRasterization,
772 switches::kDisableThreadedGpuRasterization)
775 "enable-slimming-paint",
776 IDS_FLAGS_ENABLE_SLIMMING_PAINT_NAME,
777 IDS_FLAGS_ENABLE_SLIMMING_PAINT_DESCRIPTION,
778 kOsAll,
779 SINGLE_VALUE_TYPE(switches::kEnableSlimmingPaint)
782 "enable-experimental-web-platform-features",
783 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
784 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
785 kOsAll,
786 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
789 "disable-ntp-other-sessions-menu",
790 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
791 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
792 kOsDesktop,
793 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
796 "enable-devtools-experiments",
797 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
798 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
799 kOsDesktop,
800 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
803 "silent-debugger-extension-api",
804 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
805 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
806 kOsDesktop,
807 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
809 #if defined(ENABLE_SPELLCHECK)
811 "spellcheck-autocorrect",
812 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
813 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
814 kOsWin | kOsLinux | kOsCrOS,
815 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
817 #endif
819 "enable-scroll-prediction",
820 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
821 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
822 kOsDesktop,
823 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
826 "touch-events",
827 IDS_TOUCH_EVENTS_NAME,
828 IDS_TOUCH_EVENTS_DESCRIPTION,
829 kOsDesktop,
830 MULTI_VALUE_TYPE(kTouchEventsChoices)
833 "disable-touch-adjustment",
834 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
835 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
836 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
837 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
839 #if defined(OS_CHROMEOS)
841 "network-portal-notification",
842 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
843 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
844 kOsCrOS,
845 ENABLE_DISABLE_VALUE_TYPE(
846 chromeos::switches::kEnableNetworkPortalNotification,
847 chromeos::switches::kDisableNetworkPortalNotification)
849 #endif
851 "enable-download-resumption",
852 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
853 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
854 kOsDesktop,
855 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
858 "enable-download-notification",
859 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_NAME,
860 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_DESCRIPTION,
861 kOsCrOS,
862 SINGLE_VALUE_TYPE(switches::kEnableDownloadNotification)
864 #if defined(ENABLE_PLUGINS)
866 "allow-nacl-socket-api",
867 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
868 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
869 kOsDesktop,
870 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
872 #endif
873 #if defined(OS_CHROMEOS)
875 "allow-touchpad-three-finger-click",
876 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
877 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
878 kOsCrOS,
879 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
882 "disable-easy-unlock",
883 IDS_FLAGS_DISABLE_EASY_UNLOCK_NAME,
884 IDS_FLAGS_DISABLE_EASY_UNLOCK_DESCRIPTION,
885 kOsCrOS,
886 SINGLE_VALUE_TYPE(proximity_auth::switches::kDisableEasyUnlock)
889 "enable-easy-unlock-proximity-detection",
890 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
891 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
892 kOsCrOS,
893 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)
895 #endif
896 #if defined(USE_ASH)
898 "disable-minimize-on-second-launcher-item-click",
899 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
900 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
901 kOsAll,
902 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
905 "show-touch-hud",
906 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
907 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
908 kOsAll,
909 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
912 "enable-pinch",
913 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
914 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
915 kOsLinux | kOsWin | kOsCrOS,
916 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
918 #endif // defined(USE_ASH)
920 "enable-pinch-virtual-viewport",
921 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
922 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
923 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
924 ENABLE_DISABLE_VALUE_TYPE(
925 cc::switches::kEnablePinchVirtualViewport,
926 cc::switches::kDisablePinchVirtualViewport),
929 "enable-viewport-meta",
930 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
931 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
932 kOsLinux | kOsWin | kOsCrOS | kOsMac,
933 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
935 #if defined(OS_CHROMEOS)
937 "disable-boot-animation",
938 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
939 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
940 kOsCrOSOwnerOnly,
941 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
944 "enable-video-player-chromecast-support",
945 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
946 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
947 kOsCrOS,
948 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
951 "disable-office-editing-component-app",
952 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
953 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
954 kOsCrOS,
955 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
958 "disable-display-color-calibration",
959 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
960 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
961 kOsCrOS,
962 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
965 "ash-disable-screen-orientation-lock",
966 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
967 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
968 kOsCrOS,
969 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
971 #endif // defined(OS_CHROMEOS)
972 { "disable-accelerated-video-decode",
973 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
974 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
975 kOsMac | kOsWin | kOsCrOS,
976 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
978 #if defined(USE_ASH)
980 "ash-debug-shortcuts",
981 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
982 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
983 kOsAll,
984 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
987 "ash-disable-maximize-mode-window-backdrop",
988 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME,
989 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_DESCRIPTION,
990 kOsCrOS,
991 SINGLE_VALUE_TYPE(ash::switches::kAshDisableMaximizeModeWindowBackdrop),
993 { "ash-enable-touch-view-testing",
994 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
995 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
996 kOsCrOS,
997 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
1000 "disable-touch-feedback",
1001 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
1002 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
1003 kOsCrOS,
1004 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
1006 { "ash-enable-mirrored-screen",
1007 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
1008 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
1009 kOsCrOS,
1010 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
1013 "ash-enable-screen-rotation-animations",
1014 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_NAME,
1015 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_DESCRIPTION,
1016 kOsCrOS,
1017 MULTI_VALUE_TYPE(kAshScreenRotationAnimationChoices)
1019 #endif // defined(USE_ASH)
1020 #if defined(OS_CHROMEOS)
1022 "enable-carrier-switching",
1023 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1024 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1025 kOsCrOS,
1026 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
1029 "disable-cloud-import",
1030 IDS_FLAGS_DISABLE_CLOUD_IMPORT,
1031 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION,
1032 kOsCrOS,
1033 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport)
1036 "enable-request-tablet-site",
1037 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1038 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1039 kOsCrOS,
1040 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
1042 #endif
1044 "debug-packed-apps",
1045 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1046 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1047 kOsDesktop,
1048 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1051 "enable-password-generation",
1052 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1053 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1054 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1055 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1056 autofill::switches::kDisablePasswordGeneration)
1059 "enable-automatic-password-saving",
1060 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1061 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1062 kOsDesktop,
1063 SINGLE_VALUE_TYPE(
1064 password_manager::switches::kEnableAutomaticPasswordSaving)
1067 "password-manager-reauthentication",
1068 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1069 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1070 kOsMac | kOsWin,
1071 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
1074 "enable-password-link",
1075 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1076 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1077 kOsAndroid | kOsDesktop,
1078 ENABLE_DISABLE_VALUE_TYPE(
1079 password_manager::switches::kEnablePasswordLink,
1080 password_manager::switches::kDisablePasswordLink)
1083 "enable-password-save-in-page-navigation",
1084 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_NAME,
1085 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_DESCRIPTION,
1086 kOsAll,
1087 SINGLE_VALUE_TYPE(
1088 autofill::switches::kEnablePasswordSaveOnInPageNavigation)
1091 "enable-affiliation-based-matching",
1092 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME,
1093 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION,
1094 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1095 ENABLE_DISABLE_VALUE_TYPE(
1096 password_manager::switches::kEnableAffiliationBasedMatching,
1097 password_manager::switches::kDisableAffiliationBasedMatching)
1100 "enable-deferred-image-decoding",
1101 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1102 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1103 kOsMac | kOsLinux | kOsCrOS,
1104 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1107 "wallet-service-use-sandbox",
1108 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1109 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1110 kOsAndroid | kOsDesktop,
1111 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1112 autofill::switches::kWalletServiceUseSandbox, "1",
1113 autofill::switches::kWalletServiceUseSandbox, "0")
1115 #if defined(USE_AURA)
1117 "overscroll-history-navigation",
1118 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1119 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1120 kOsAll,
1121 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
1123 #endif
1125 "scroll-end-effect",
1126 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1127 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1128 kOsCrOS,
1129 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1130 switches::kScrollEndEffect, "1",
1131 switches::kScrollEndEffect, "0")
1134 "enable-icon-ntp",
1135 IDS_FLAGS_ENABLE_ICON_NTP_NAME,
1136 IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION,
1137 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1138 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIconNtp,
1139 switches::kDisableIconNtp)
1142 "enable-touch-drag-drop",
1143 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1144 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1145 kOsWin | kOsCrOS,
1146 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1147 switches::kDisableTouchDragDrop)
1150 "enable-touch-editing",
1151 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1152 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1153 kOsCrOS | kOsWin | kOsLinux,
1154 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1155 switches::kDisableTouchEditing)
1158 "enable-stale-while-revalidate",
1159 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME,
1160 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION,
1161 kOsAll,
1162 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate)
1165 "enable-suggestions-service",
1166 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1167 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1168 kOsAndroid | kOsCrOS,
1169 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1170 switches::kDisableSuggestionsService)
1173 "enable-supervised-user-blacklist",
1174 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1175 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1176 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1177 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist,
1178 switches::kDisableSupervisedUserBlacklist)
1181 "enable-supervised-user-managed-bookmarks-folder",
1182 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME,
1183 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION,
1184 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1185 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder)
1188 "enable-supervised-user-safesites",
1189 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME,
1190 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1191 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1192 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites,
1193 switches::kDisableSupervisedUserSafeSites)
1195 #if defined(ENABLE_APP_LIST)
1197 "enable-sync-app-list",
1198 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1199 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1200 kOsDesktop,
1201 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1202 app_list::switches::kDisableSyncAppList)
1204 #endif
1205 #if defined(OS_MACOSX)
1207 "enable-avfoundation",
1208 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1209 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1210 kOsMac,
1211 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1212 switches::kForceQTKit)
1214 #endif
1216 "lcd-text-aa",
1217 IDS_FLAGS_LCD_TEXT_NAME,
1218 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1219 kOsDesktop,
1220 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1221 switches::kDisableLCDText)
1223 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1225 "delegated-renderer",
1226 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1227 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1228 kOsAndroid, // TODO(ccameron) Add mac support soon.
1229 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1230 switches::kDisableDelegatedRenderer)
1232 #endif
1234 "max-tiles-for-interest-area",
1235 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1236 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1237 kOsAll,
1238 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1241 "enable-offer-store-unmasked-wallet-cards",
1242 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS,
1243 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION,
1244 kOsAll,
1245 ENABLE_DISABLE_VALUE_TYPE(
1246 autofill::switches::kEnableOfferStoreUnmaskedWalletCards,
1247 autofill::switches::kDisableOfferStoreUnmaskedWalletCards)
1250 "enable-offline-auto-reload",
1251 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1252 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1253 kOsAll,
1254 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1255 switches::kDisableOfflineAutoReload)
1258 "enable-offline-auto-reload-visible-only",
1259 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1260 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1261 kOsAll,
1262 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1263 switches::kDisableOfflineAutoReloadVisibleOnly)
1266 "show-saved-copy",
1267 IDS_FLAGS_SHOW_SAVED_COPY_NAME,
1268 IDS_FLAGS_SHOW_SAVED_COPY_DESCRIPTION,
1269 kOsAll,
1270 MULTI_VALUE_TYPE(kShowSavedCopyChoices)
1273 "default-tile-width",
1274 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1275 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1276 kOsAll,
1277 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1280 "default-tile-height",
1281 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1282 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1283 kOsAll,
1284 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1286 #if defined(OS_ANDROID)
1288 "disable-gesture-requirement-for-media-playback",
1289 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1290 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1291 kOsAndroid,
1292 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1294 #endif
1295 #if defined(OS_CHROMEOS)
1297 "enable-virtual-keyboard",
1298 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1299 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1300 kOsCrOS,
1301 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1304 "enable-virtual-keyboard-overscroll",
1305 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1306 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1307 kOsCrOS,
1308 ENABLE_DISABLE_VALUE_TYPE(
1309 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1310 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1313 "enable-swipe-selection",
1314 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1315 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1316 kOsCrOS,
1317 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1320 "enable-input-view",
1321 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1322 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1323 kOsCrOS,
1324 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1325 keyboard::switches::kDisableInputView)
1328 "enable-new-korean-ime",
1329 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_NAME,
1330 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_DESCRIPTION,
1331 kOsCrOS,
1332 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewKoreanIme)
1335 "disable-new-md-input-view",
1336 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_NAME,
1337 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_DESCRIPTION,
1338 kOsCrOS,
1339 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewMDInputView)
1342 "enable-physical-keyboard-autocorrect",
1343 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1344 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1345 kOsCrOS,
1346 ENABLE_DISABLE_VALUE_TYPE(
1347 chromeos::switches::kEnablePhysicalKeyboardAutocorrect,
1348 chromeos::switches::kDisablePhysicalKeyboardAutocorrect)
1351 "disable-voice-input",
1352 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME,
1353 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION,
1354 kOsCrOS,
1355 SINGLE_VALUE_TYPE(chromeos::switches::kDisableVoiceInput)
1358 "enable-experimental-input-view-features",
1359 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1360 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1361 kOsCrOS,
1362 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1365 "enable-gesture-typing",
1366 IDS_FLAGS_ENABLE_GESTURE_TYPING_NAME,
1367 IDS_FLAGS_ENABLE_GESTURE_TYPING_DESCRIPTION,
1368 kOsCrOS,
1369 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureTyping)
1372 "enable-gesture-deletion",
1373 IDS_FLAGS_ENABLE_GESTURE_DELETION_NAME,
1374 IDS_FLAGS_ENABLE_GESTURE_DELETION_DESCRIPTION,
1375 kOsCrOS,
1376 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureDeletion)
1379 "enable-gesture-selection",
1380 IDS_FLAGS_ENABLE_GESTURE_SELECTION_NAME,
1381 IDS_FLAGS_ENABLE_GESTURE_SELECTION_DESCRIPTION,
1382 kOsCrOS,
1383 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureSelection)
1386 "disable-smart-virtual-keyboard",
1387 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_NAME,
1388 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_DESCRIPTION,
1389 kOsCrOS,
1390 SINGLE_VALUE_TYPE(keyboard::switches::kDisableSmartVirtualKeyboard)
1392 #endif
1394 "enable-simple-cache-backend",
1395 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1396 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1397 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1398 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1401 "enable-tcp-fast-open",
1402 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1403 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1404 kOsLinux | kOsCrOS | kOsAndroid,
1405 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1407 #if defined(ENABLE_SERVICE_DISCOVERY)
1409 "device-discovery-notifications",
1410 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1411 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1412 kOsDesktop,
1413 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1414 switches::kDisableDeviceDiscoveryNotifications)
1417 "enable-print-preview-register-promos",
1418 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1419 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1420 kOsDesktop,
1421 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1423 #endif // ENABLE_SERVICE_DISCOVERY
1424 #if defined(OS_WIN)
1426 "enable-cloud-print-xps",
1427 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1428 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1429 kOsWin,
1430 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1432 #endif
1433 #if defined(USE_AURA)
1435 "tab-capture-upscale-quality",
1436 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1437 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1438 kOsAll,
1439 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1442 "tab-capture-downscale-quality",
1443 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1444 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1445 kOsAll,
1446 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1448 #endif
1449 #if defined(TOOLKIT_VIEWS)
1451 "disable-hide-inactive-stacked-tab-close-buttons",
1452 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_NAME,
1453 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_DESCRIPTION,
1454 kOsCrOS | kOsWin | kOsLinux,
1455 SINGLE_VALUE_TYPE(switches::kDisableHideInactiveStackedTabCloseButtons)
1457 #endif
1458 #if defined(ENABLE_SPELLCHECK)
1460 "enable-spelling-feedback-field-trial",
1461 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1462 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1463 kOsAll,
1464 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)
1466 #endif
1468 "enable-webgl-draft-extensions",
1469 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1470 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1471 kOsAll,
1472 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1475 "enable-new-profile-management",
1476 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1477 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1478 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1479 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1480 switches::kDisableNewProfileManagement)
1483 "enable-account-consistency",
1484 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1485 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1486 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1487 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1488 switches::kDisableAccountConsistency)
1491 "enable-fast-user-switching",
1492 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1493 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1494 kOsMac | kOsWin | kOsLinux,
1495 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1498 "enable-new-avatar-menu",
1499 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1500 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1501 kOsMac | kOsWin | kOsLinux,
1502 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1503 switches::kDisableNewAvatarMenu)
1506 "enable-iframe-based-signin",
1507 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME,
1508 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION,
1509 kOsMac | kOsWin | kOsLinux,
1510 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin)
1513 "enable-google-profile-info",
1514 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1515 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1516 kOsMac | kOsWin | kOsLinux,
1517 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
1520 "reset-app-list-install-state",
1521 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1522 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1523 kOsMac | kOsWin | kOsLinux,
1524 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
1526 #if defined(ENABLE_APP_LIST)
1527 #if defined(OS_LINUX)
1529 // This is compiled out on non-Linux platforms because otherwise it would be
1530 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1531 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1532 "enable-app-list",
1533 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1534 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1535 kOsLinux,
1536 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1538 #endif
1539 #if defined(ENABLE_EXTENSIONS)
1541 "enable-surface-worker",
1542 IDS_FLAGS_ENABLE_SURFACE_WORKER_NAME,
1543 IDS_FLAGS_ENABLE_SURFACE_WORKER_DESCRIPTION,
1544 kOsDesktop,
1545 SINGLE_VALUE_TYPE(extensions::switches::kEnableSurfaceWorker)
1547 #endif
1549 "disable-drive-apps-in-app-list",
1550 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1551 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1552 kOsCrOS,
1553 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
1555 #endif
1556 #if defined(OS_ANDROID)
1558 "enable-accessibility-tab-switcher",
1559 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1560 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1561 kOsAndroid,
1562 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
1565 // TODO(dmazzoni): remove this flag when native android accessibility
1566 // ships in the stable channel. http://crbug.com/356775
1567 "enable-accessibility-script-injection",
1568 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1569 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1570 kOsAndroid,
1571 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1572 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1574 #endif
1576 "enable-one-copy",
1577 IDS_FLAGS_ONE_COPY_NAME,
1578 IDS_FLAGS_ONE_COPY_DESCRIPTION,
1579 kOsAll,
1580 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy,
1581 switches::kDisableOneCopy)
1584 "enable-zero-copy",
1585 IDS_FLAGS_ZERO_COPY_NAME,
1586 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1587 kOsAll,
1588 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)
1590 #if defined(OS_CHROMEOS)
1592 "enable-first-run-ui-transitions",
1593 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1594 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1595 kOsCrOS,
1596 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1598 #endif
1600 "disable-new-bookmark-apps",
1601 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME,
1602 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION,
1603 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1604 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps,
1605 switches::kDisableNewBookmarkApps)
1607 #if defined(OS_MACOSX)
1609 "disable-hosted-app-shim-creation",
1610 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME,
1611 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION,
1612 kOsMac,
1613 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation)
1616 "enable-hosted-app-quit-notification",
1617 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME,
1618 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION,
1619 kOsMac,
1620 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)
1622 #endif
1624 "enable-ephemeral-apps-in-webstore",
1625 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
1626 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
1627 kOsAll,
1628 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)
1631 "enable-linkable-ephemeral-apps",
1632 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1633 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1634 kOsAll,
1635 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1638 "enable-service-worker-sync",
1639 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1640 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1641 kOsAll,
1642 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1644 #if defined(OS_ANDROID)
1646 "disable-click-delay",
1647 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1648 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1649 kOsAndroid,
1650 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1651 SINGLE_VALUE_TYPE("disable-click-delay")
1654 "disable-pull-to-refresh-effect",
1655 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1656 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1657 kOsAndroid,
1658 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)
1660 #endif
1661 #if defined(OS_MACOSX)
1663 "enable-translate-new-ux",
1664 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1665 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1666 kOsMac,
1667 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1669 #endif
1670 #if defined(TOOLKIT_VIEWS)
1672 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1673 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1674 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1675 kOsCrOS | kOsWin | kOsLinux,
1676 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
1679 "enable-link-disambiguation-popup",
1680 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1681 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1682 kOsCrOS | kOsWin,
1683 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)
1685 #endif
1686 #if defined(ENABLE_EXTENSIONS)
1688 "enable-apps-show-on-first-paint",
1689 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1690 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1691 kOsDesktop,
1692 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1694 #endif
1696 "enhanced-bookmarks-experiment",
1697 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1698 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1699 kOsDesktop | kOsAndroid,
1700 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1701 switches::kEnhancedBookmarksExperiment, "1",
1702 switches::kEnhancedBookmarksExperiment, "0")
1704 #if defined(OS_ANDROID)
1706 "enable-zero-suggest-experiment",
1707 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1708 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1709 kOsAndroid,
1710 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1713 "enable-reader-mode-toolbar-icon",
1714 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1715 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1716 kOsAndroid,
1717 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1719 #endif
1721 "num-raster-threads",
1722 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1723 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1724 kOsAll,
1725 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
1728 "ignore-autocomplete-off-autofill",
1729 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_NAME,
1730 IDS_FLAGS_IGNORE_AUTOCOMPLETE_OFF_AUTOFILL_DESCRIPTION,
1731 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1732 ENABLE_DISABLE_VALUE_TYPE(
1733 autofill::switches::kIgnoreAutocompleteOffForAutofill,
1734 autofill::switches::kRespectAutocompleteOffForAutofill)
1737 "enable-single-click-autofill",
1738 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1739 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1740 kOsCrOS | kOsMac | kOsWin | kOsLinux | kOsAndroid,
1741 ENABLE_DISABLE_VALUE_TYPE(
1742 autofill::switches::kEnableSingleClickAutofill,
1743 autofill::switches::kDisableSingleClickAutofill)
1746 "enable-permissions-bubbles",
1747 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1748 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1749 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1750 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1751 switches::kDisablePermissionsBubbles)
1754 "enable-session-crashed-bubble",
1755 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1756 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1757 kOsWin | kOsLinux,
1758 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1759 switches::kDisableSessionCrashedBubble)
1762 "enable-out-of-process-pdf",
1763 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1764 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1765 kOsDesktop,
1766 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf,
1767 switches::kDisableOutOfProcessPdf)
1770 "enable-pdf-material-ui",
1771 IDS_FLAGS_PDF_MATERIAL_UI_NAME,
1772 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
1773 kOsDesktop,
1774 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI,
1775 switches::kDisablePdfMaterialUI)
1778 "disable-cast-streaming-hw-encoding",
1779 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1780 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1781 kOsAll,
1782 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)
1784 #if defined(OS_ANDROID)
1786 "disable-cast",
1787 IDS_FLAGS_DISABLE_CAST_NAME,
1788 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1789 kOsAndroid,
1790 SINGLE_VALUE_TYPE(switches::kDisableCast)
1793 "prefetch-search-results",
1794 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1795 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1796 kOsAndroid,
1797 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1799 #endif
1800 #if defined(ENABLE_APP_LIST)
1802 "enable-experimental-app-list",
1803 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1804 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1805 kOsWin | kOsLinux | kOsCrOS,
1806 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList,
1807 app_list::switches::kDisableExperimentalAppList)
1810 "enable-centered-app-list",
1811 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1812 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1813 kOsWin | kOsLinux | kOsCrOS,
1814 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
1816 #endif
1818 "disable-threaded-scrolling",
1819 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1820 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1821 kOsWin | kOsLinux | kOsCrOS | kOsAndroid | kOsMac,
1822 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)
1825 "bleeding-edge-renderer-mode",
1826 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1827 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1828 kOsAndroid,
1829 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1832 "enable-settings-window",
1833 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1834 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1835 kOsDesktop,
1836 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1837 switches::kDisableSettingsWindow)
1839 #if defined(OS_ANDROID)
1841 "enable-instant-search-clicks",
1842 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1843 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1844 kOsAndroid,
1845 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1847 #endif
1849 "enable-save-password-bubble",
1850 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1851 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1852 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1853 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1854 switches::kDisableSavePasswordBubble)
1857 "enable-apps-file-associations",
1858 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1859 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1860 kOsMac,
1861 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1863 #if defined(OS_ANDROID)
1865 "enable-embeddedsearch-api",
1866 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1867 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1868 kOsAndroid,
1869 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1872 "enable-app-install-alerts",
1873 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1874 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1875 kOsAndroid,
1876 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1878 #endif
1880 "distance-field-text",
1881 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1882 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1883 kOsAll,
1884 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1885 switches::kDisableDistanceFieldText)
1888 "extension-content-verification",
1889 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1890 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1891 kOsDesktop,
1892 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1894 #if defined(USE_AURA)
1896 "text-input-focus-manager",
1897 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1898 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1899 kOsCrOS | kOsLinux | kOsWin,
1900 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1901 switches::kDisableTextInputFocusManager)
1903 #endif
1904 #if defined(ENABLE_EXTENSIONS)
1906 "extension-active-script-permission",
1907 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1908 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1909 kOsAll,
1910 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1912 #endif
1914 "answers-in-suggest",
1915 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1916 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1917 kOsAndroid | kOsWin | kOsLinux | kOsCrOS,
1918 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest,
1919 switches::kDisableAnswersInSuggest)
1921 #if defined(OS_ANDROID)
1923 "enable-data-reduction-proxy-dev",
1924 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1925 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1926 kOsAndroid,
1927 ENABLE_DISABLE_VALUE_TYPE(
1928 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1929 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1932 "enable-data-reduction-proxy-alt",
1933 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1934 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1935 kOsAndroid,
1936 SINGLE_VALUE_TYPE(
1937 data_reduction_proxy::switches::kEnableDataReductionProxyAlt)
1939 #endif
1941 "enable-hotword-hardware",
1942 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1943 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1944 kOsCrOS,
1945 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)
1947 #if defined(ENABLE_EXTENSIONS)
1949 "enable-embedded-extension-options",
1950 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1951 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1952 kOsDesktop,
1953 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1955 #endif
1956 #if defined(USE_ASH)
1958 "enable-web-app-frame",
1959 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME,
1960 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION,
1961 kOsWin | kOsCrOS,
1962 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)
1964 #endif
1966 "enable-website-settings-manager",
1967 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1968 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1969 kOsDesktop,
1970 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1973 "remember-cert-error-decisions",
1974 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1975 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1976 kOsAll,
1977 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1980 "enable-drop-sync-credential",
1981 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1982 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1983 kOsAll,
1984 ENABLE_DISABLE_VALUE_TYPE(
1985 password_manager::switches::kEnableDropSyncCredential,
1986 password_manager::switches::kDisableDropSyncCredential)
1988 #if defined(ENABLE_EXTENSIONS)
1990 "enable-extension-action-redesign",
1991 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1992 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1993 kOsDesktop,
1994 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
1996 #endif
1998 "autofill-sync-credential",
1999 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
2000 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
2001 kOsAll,
2002 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
2004 #if !defined(OS_ANDROID)
2006 "enable-message-center-always-scroll-up-upon-notification-removal",
2007 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
2008 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
2009 kOsDesktop,
2010 SINGLE_VALUE_TYPE(
2011 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
2014 "enable-md-settings",
2015 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME,
2016 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION,
2017 kOsDesktop,
2018 SINGLE_VALUE_TYPE(
2019 switches::kEnableMaterialDesignSettings)
2021 #endif
2022 #if defined(OS_CHROMEOS)
2024 "disable-memory-pressure-chromeos",
2025 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_NAME,
2026 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_DESCRIPTION,
2027 kOsCrOS,
2028 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMemoryPressureSystemChromeOS)
2031 "memory-pressure-thresholds",
2032 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME,
2033 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION,
2034 kOsCrOS,
2035 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices)
2038 "wake-on-packets",
2039 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
2040 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
2041 kOsCrOSOwnerOnly,
2042 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
2044 #endif // OS_CHROMEOS
2046 "enable-tab-audio-muting",
2047 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
2048 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
2049 kOsDesktop,
2050 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)
2053 "enable-credential-manager-api",
2054 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
2055 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
2056 kOsAll,
2057 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)
2060 "reduced-referrer-granularity",
2061 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
2062 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
2063 kOsAll,
2064 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)
2066 #if defined(ENABLE_PLUGINS)
2068 "enable-plugin-power-saver",
2069 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
2070 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
2071 kOsDesktop,
2072 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePluginPowerSaver,
2073 switches::kDisablePluginPowerSaver)
2075 #endif
2076 #if defined(OS_CHROMEOS)
2078 "disable-new-zip-unpacker",
2079 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
2080 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
2081 kOsCrOS,
2082 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)
2084 #endif // defined(OS_CHROMEOS)
2086 "ssl-version-min",
2087 IDS_FLAGS_SSL_VERSION_MIN_NAME,
2088 IDS_FLAGS_SSL_VERSION_MIN_DESCRIPTION,
2089 kOsAll,
2090 MULTI_VALUE_TYPE(kSSLVersionMinChoices)
2093 "enable-credit-card-scan",
2094 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
2095 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
2096 kOsAndroid,
2097 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan,
2098 autofill::switches::kDisableCreditCardScan)
2100 #if defined(OS_CHROMEOS)
2102 "disable-captive-portal-bypass-proxy",
2103 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
2104 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
2105 kOsCrOS,
2106 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCaptivePortalBypassProxy)
2109 "disable-roboto-font-ui",
2110 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_NAME,
2111 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_DESCRIPTION,
2112 kOsCrOS,
2113 SINGLE_VALUE_TYPE(switches::kDisableRobotoFontUI)
2115 #endif // defined(OS_CHROMEOS)
2116 #if defined(OS_ANDROID)
2118 "enable-seccomp-filter-sandbox",
2119 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
2120 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
2121 kOsAndroid,
2122 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)
2124 #endif
2126 "enable-touch-hover",
2127 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME,
2128 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION,
2129 kOsAndroid,
2130 SINGLE_VALUE_TYPE("enable-touch-hover")
2133 "enable-fill-on-account-select",
2134 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
2135 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
2136 kOsAll,
2137 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices)
2139 #if defined(OS_CHROMEOS)
2141 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA
2142 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
2143 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
2144 kOsCrOS,
2145 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)
2148 "enable-potentially-annoying-security-features",
2149 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME,
2150 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION,
2151 kOsAll,
2152 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)
2154 #endif
2156 "enable-delay-agnostic-aec",
2157 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
2158 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
2159 kOsDesktop,
2160 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)
2163 "mark-non-secure-as", // FLAGS:RECORD_UMA
2164 IDS_MARK_NON_SECURE_AS_NAME,
2165 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
2166 kOsAll,
2167 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)
2170 "enable-site-per-process",
2171 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
2172 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
2173 kOsAll,
2174 SINGLE_VALUE_TYPE(switches::kSitePerProcess)
2176 #if defined(OS_MACOSX)
2178 "enable-harfbuzz-rendertext",
2179 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
2180 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
2181 kOsMac,
2182 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)
2184 #endif // defined(OS_MACOSX)
2185 #if defined(OS_CHROMEOS)
2187 "disable-timezone-tracking",
2188 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
2189 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
2190 kOsCrOS,
2191 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption)
2194 "disable-webview-signin-flow",
2195 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_NAME,
2196 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_DESCRIPTION,
2197 kOsCrOS,
2198 SINGLE_VALUE_TYPE(chromeos::switches::kDisableWebviewSigninFlow)
2200 #endif // defined(OS_CHROMEOS)
2202 "enable-data-reduction-proxy-lo-fi",
2203 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME,
2204 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION,
2205 kOsAll,
2206 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2207 kEnableDataReductionProxyLoFi)
2210 "clear-data-reduction-proxy-data-savings",
2211 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME,
2212 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION,
2213 kOsAll,
2214 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2215 kClearDataReductionProxyDataSavings)
2217 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2219 "enable-data-reduction-proxy-bypass-warnings",
2220 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2221 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2222 kOsAndroid,
2223 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2224 kEnableDataReductionProxyBypassWarning)
2226 #endif
2228 "allow-insecure-localhost",
2229 IDS_ALLOW_INSECURE_LOCALHOST,
2230 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION,
2231 kOsAll,
2232 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)
2235 "bypass-app-banner-engagement-checks",
2236 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME,
2237 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION,
2238 kOsAndroid,
2239 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks)
2242 "use-sync-sandbox",
2243 IDS_FLAGS_SYNC_SANDBOX_NAME,
2244 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
2245 kOsAll,
2246 SINGLE_VALUE_TYPE_AND_VALUE(
2247 switches::kSyncServiceURL,
2248 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
2251 "enable-child-account-detection",
2252 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_NAME,
2253 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_DESCRIPTION,
2254 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
2255 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableChildAccountDetection,
2256 switches::kDisableChildAccountDetection)
2258 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
2260 "ozone-test-single-overlay-support",
2261 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY,
2262 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION,
2263 kOsCrOS,
2264 SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport)
2266 #endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
2268 "v8-pac-mojo-out-of-process",
2269 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME,
2270 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION,
2271 kOsDesktop,
2272 SINGLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess),
2274 #if defined(OS_CHROMEOS)
2276 "enable-firewall-hole-punching",
2277 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_NAME,
2278 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_DESCRIPTION,
2279 kOsCrOS,
2280 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirewallHolePunching)
2282 #endif // defined(OS_CHROMEOS)
2284 "enable-media-router",
2285 IDS_FLAGS_ENABLE_MEDIA_ROUTER_NAME,
2286 IDS_FLAGS_ENABLE_MEDIA_ROUTER_DESCRIPTION,
2287 kOsAll,
2288 SINGLE_VALUE_TYPE(switches::kEnableMediaRouter)
2291 "enable-cert-collection",
2292 IDS_ENABLE_INVALID_CERT_COLLECTION,
2293 IDS_ENABLE_INVALID_CERT_COLLECTION_DESCRIPTION,
2294 kOsAll,
2295 SINGLE_VALUE_TYPE(switches::kEnableInvalidCertCollection)
2297 // Since kEnableLauncherSearchProviderApi is not available when app list is
2298 // disabled, flag guard enable-launcher-search-provider-api.
2299 #if defined(ENABLE_APP_LIST)
2301 "enable-launcher-search-provider-api",
2302 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API,
2303 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API_DESCRIPTION,
2304 kOsCrOS,
2305 SINGLE_VALUE_TYPE(app_list::switches::kEnableLauncherSearchProviderApi)
2307 #endif // defined(ENABLE_APP_LIST)
2309 // NOTE: Adding new command-line switches requires adding corresponding
2310 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2311 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2314 const Experiment* experiments = kExperiments;
2315 size_t num_experiments = arraysize(kExperiments);
2317 // Stores and encapsulates the little state that about:flags has.
2318 class FlagsState {
2319 public:
2320 FlagsState() : needs_restart_(false) {}
2321 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2322 base::CommandLine* command_line,
2323 SentinelsMode sentinels);
2324 bool IsRestartNeededToCommitChanges();
2325 void SetExperimentEnabled(
2326 FlagsStorage* flags_storage,
2327 const std::string& internal_name,
2328 bool enable);
2329 void RemoveFlagsSwitches(
2330 std::map<std::string, base::CommandLine::StringType>* switch_list);
2331 void ResetAllFlags(FlagsStorage* flags_storage);
2332 void reset();
2334 // Returns the singleton instance of this class
2335 static FlagsState* GetInstance() {
2336 return Singleton<FlagsState>::get();
2339 private:
2340 bool needs_restart_;
2341 std::map<std::string, std::string> flags_switches_;
2343 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2346 // Adds the internal names for the specified experiment to |names|.
2347 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2348 if (e.type == Experiment::SINGLE_VALUE) {
2349 names->insert(e.internal_name);
2350 } else {
2351 DCHECK(e.type == Experiment::MULTI_VALUE ||
2352 e.type == Experiment::ENABLE_DISABLE_VALUE);
2353 for (int i = 0; i < e.num_choices; ++i)
2354 names->insert(e.NameForChoice(i));
2358 // Confirms that an experiment is valid, used in a DCHECK in
2359 // SanitizeList below.
2360 bool ValidateExperiment(const Experiment& e) {
2361 switch (e.type) {
2362 case Experiment::SINGLE_VALUE:
2363 DCHECK_EQ(0, e.num_choices);
2364 DCHECK(!e.choices);
2365 break;
2366 case Experiment::MULTI_VALUE:
2367 DCHECK_GT(e.num_choices, 0);
2368 DCHECK(e.choices);
2369 DCHECK(e.choices[0].command_line_switch);
2370 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2371 break;
2372 case Experiment::ENABLE_DISABLE_VALUE:
2373 DCHECK_EQ(3, e.num_choices);
2374 DCHECK(!e.choices);
2375 DCHECK(e.command_line_switch);
2376 DCHECK(e.command_line_value);
2377 DCHECK(e.disable_command_line_switch);
2378 DCHECK(e.disable_command_line_value);
2379 break;
2380 default:
2381 NOTREACHED();
2383 return true;
2386 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2387 // unknown, to prevent this list to become very long as experiments are added
2388 // and removed.
2389 void SanitizeList(FlagsStorage* flags_storage) {
2390 std::set<std::string> known_experiments;
2391 for (size_t i = 0; i < num_experiments; ++i) {
2392 DCHECK(ValidateExperiment(experiments[i]));
2393 AddInternalName(experiments[i], &known_experiments);
2396 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2398 std::set<std::string> new_enabled_experiments =
2399 base::STLSetIntersection<std::set<std::string> >(
2400 known_experiments, enabled_experiments);
2402 if (new_enabled_experiments != enabled_experiments)
2403 flags_storage->SetFlags(new_enabled_experiments);
2406 void GetSanitizedEnabledFlags(
2407 FlagsStorage* flags_storage, std::set<std::string>* result) {
2408 SanitizeList(flags_storage);
2409 *result = flags_storage->GetFlags();
2412 bool SkipConditionalExperiment(const Experiment& experiment,
2413 FlagsStorage* flags_storage) {
2414 #if defined(OS_ANDROID) || defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2415 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2416 #endif
2418 #if defined(OS_ANDROID)
2419 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2420 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2421 channel != chrome::VersionInfo::CHANNEL_BETA &&
2422 channel != chrome::VersionInfo::CHANNEL_DEV) {
2423 return true;
2425 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2426 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2427 channel != chrome::VersionInfo::CHANNEL_DEV) {
2428 return true;
2430 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and
2431 // the Canary/Dev channel.
2432 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) &&
2433 channel != chrome::VersionInfo::CHANNEL_DEV &&
2434 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2435 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2436 return true;
2438 #endif
2440 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2441 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2442 // builds and Canary/Dev channel.
2443 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2444 experiment.internal_name) &&
2445 channel != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2446 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2447 channel != chrome::VersionInfo::CHANNEL_DEV) {
2448 return true;
2450 #endif
2452 return false;
2456 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2457 // enabled on the current platform.
2458 void GetSanitizedEnabledFlagsForCurrentPlatform(
2459 FlagsStorage* flags_storage, std::set<std::string>* result) {
2460 GetSanitizedEnabledFlags(flags_storage, result);
2462 // Filter out any experiments that aren't enabled on the current platform. We
2463 // don't remove these from prefs else syncing to a platform with a different
2464 // set of experiments would be lossy.
2465 std::set<std::string> platform_experiments;
2466 int current_platform = GetCurrentPlatform();
2467 for (size_t i = 0; i < num_experiments; ++i) {
2468 if (experiments[i].supported_platforms & current_platform)
2469 AddInternalName(experiments[i], &platform_experiments);
2470 #if defined(OS_CHROMEOS)
2471 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2472 AddInternalName(experiments[i], &platform_experiments);
2473 #endif
2476 std::set<std::string> new_enabled_experiments =
2477 base::STLSetIntersection<std::set<std::string> >(
2478 platform_experiments, *result);
2480 result->swap(new_enabled_experiments);
2483 // Returns the Value representing the choice data in the specified experiment.
2484 base::Value* CreateChoiceData(
2485 const Experiment& experiment,
2486 const std::set<std::string>& enabled_experiments) {
2487 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2488 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2489 base::ListValue* result = new base::ListValue;
2490 for (int i = 0; i < experiment.num_choices; ++i) {
2491 base::DictionaryValue* value = new base::DictionaryValue;
2492 const std::string name = experiment.NameForChoice(i);
2493 value->SetString("internal_name", name);
2494 value->SetString("description", experiment.DescriptionForChoice(i));
2495 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2496 result->Append(value);
2498 return result;
2501 } // namespace
2503 std::string Experiment::NameForChoice(int index) const {
2504 DCHECK(type == Experiment::MULTI_VALUE ||
2505 type == Experiment::ENABLE_DISABLE_VALUE);
2506 DCHECK_LT(index, num_choices);
2507 return std::string(internal_name) + testing::kMultiSeparator +
2508 base::IntToString(index);
2511 base::string16 Experiment::DescriptionForChoice(int index) const {
2512 DCHECK(type == Experiment::MULTI_VALUE ||
2513 type == Experiment::ENABLE_DISABLE_VALUE);
2514 DCHECK_LT(index, num_choices);
2515 int description_id;
2516 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2517 const int kEnableDisableDescriptionIds[] = {
2518 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2519 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2520 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2522 description_id = kEnableDisableDescriptionIds[index];
2523 } else {
2524 description_id = choices[index].description_id;
2526 return l10n_util::GetStringUTF16(description_id);
2529 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2530 base::CommandLine* command_line,
2531 SentinelsMode sentinels) {
2532 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2533 command_line,
2534 sentinels);
2537 bool AreSwitchesIdenticalToCurrentCommandLine(
2538 const base::CommandLine& new_cmdline,
2539 const base::CommandLine& active_cmdline,
2540 std::set<base::CommandLine::StringType>* out_difference) {
2541 std::set<base::CommandLine::StringType> new_flags =
2542 ExtractFlagsFromCommandLine(new_cmdline);
2543 std::set<base::CommandLine::StringType> active_flags =
2544 ExtractFlagsFromCommandLine(active_cmdline);
2546 bool result = false;
2547 // Needed because std::equal doesn't check if the 2nd set is empty.
2548 if (new_flags.size() == active_flags.size()) {
2549 result =
2550 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2553 if (out_difference && !result) {
2554 std::set_symmetric_difference(
2555 new_flags.begin(),
2556 new_flags.end(),
2557 active_flags.begin(),
2558 active_flags.end(),
2559 std::inserter(*out_difference, out_difference->begin()));
2562 return result;
2565 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2566 FlagAccess access,
2567 base::ListValue* supported_experiments,
2568 base::ListValue* unsupported_experiments) {
2569 std::set<std::string> enabled_experiments;
2570 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2572 int current_platform = GetCurrentPlatform();
2574 for (size_t i = 0; i < num_experiments; ++i) {
2575 const Experiment& experiment = experiments[i];
2576 if (SkipConditionalExperiment(experiment, flags_storage))
2577 continue;
2579 base::DictionaryValue* data = new base::DictionaryValue();
2580 data->SetString("internal_name", experiment.internal_name);
2581 data->SetString("name",
2582 l10n_util::GetStringUTF16(experiment.visible_name_id));
2583 data->SetString("description",
2584 l10n_util::GetStringUTF16(
2585 experiment.visible_description_id));
2587 base::ListValue* supported_platforms = new base::ListValue();
2588 AddOsStrings(experiment.supported_platforms, supported_platforms);
2589 data->Set("supported_platforms", supported_platforms);
2591 switch (experiment.type) {
2592 case Experiment::SINGLE_VALUE:
2593 data->SetBoolean(
2594 "enabled",
2595 enabled_experiments.count(experiment.internal_name) > 0);
2596 break;
2597 case Experiment::MULTI_VALUE:
2598 case Experiment::ENABLE_DISABLE_VALUE:
2599 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2600 break;
2601 default:
2602 NOTREACHED();
2605 bool supported = (experiment.supported_platforms & current_platform) != 0;
2606 #if defined(OS_CHROMEOS)
2607 if (access == kOwnerAccessToFlags &&
2608 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2609 supported = true;
2611 #endif
2612 if (supported)
2613 supported_experiments->Append(data);
2614 else
2615 unsupported_experiments->Append(data);
2619 bool IsRestartNeededToCommitChanges() {
2620 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2623 void SetExperimentEnabled(FlagsStorage* flags_storage,
2624 const std::string& internal_name,
2625 bool enable) {
2626 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2627 internal_name, enable);
2630 void RemoveFlagsSwitches(
2631 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2632 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2635 void ResetAllFlags(FlagsStorage* flags_storage) {
2636 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2639 int GetCurrentPlatform() {
2640 #if defined(OS_MACOSX)
2641 return kOsMac;
2642 #elif defined(OS_WIN)
2643 return kOsWin;
2644 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2645 return kOsCrOS;
2646 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2647 return kOsLinux;
2648 #elif defined(OS_ANDROID)
2649 return kOsAndroid;
2650 #else
2651 #error Unknown platform
2652 #endif
2655 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2656 std::set<std::string> flags = flags_storage->GetFlags();
2657 for (const std::string& flag : flags) {
2658 std::string action("AboutFlags_");
2659 action += flag;
2660 content::RecordComputedAction(action);
2662 // Since flag metrics are recorded every startup, add a tick so that the
2663 // stats can be made meaningful.
2664 if (flags.size())
2665 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2666 content::RecordAction(base::UserMetricsAction("StartupTick"));
2669 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2670 return static_cast<base::HistogramBase::Sample>(
2671 metrics::HashMetricName(switch_name));
2674 void ReportCustomFlags(const std::string& uma_histogram_hame,
2675 const std::set<std::string>& command_line_difference) {
2676 for (const std::string& flag : command_line_difference) {
2677 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2678 if (StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2679 // Skip '--' before switch name.
2680 std::string switch_name(flag.substr(2));
2682 // Kill value, if any.
2683 const size_t value_pos = switch_name.find('=');
2684 if (value_pos != std::string::npos)
2685 switch_name.resize(value_pos);
2687 uma_id = GetSwitchUMAId(switch_name);
2688 } else {
2689 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2690 << "' has incorrect format.";
2692 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2693 << "' '" << flag << "', uma_id=" << uma_id;
2695 // Sparse histogram macro does not cache the histogram, so it's safe
2696 // to use macro with non-static histogram name here.
2697 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2701 //////////////////////////////////////////////////////////////////////////////
2702 // FlagsState implementation.
2704 namespace {
2706 typedef std::map<std::string, std::pair<std::string, std::string> >
2707 NameToSwitchAndValueMap;
2709 void SetFlagToSwitchMapping(const std::string& key,
2710 const std::string& switch_name,
2711 const std::string& switch_value,
2712 NameToSwitchAndValueMap* name_to_switch_map) {
2713 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2714 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2717 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2718 base::CommandLine* command_line,
2719 SentinelsMode sentinels) {
2720 if (command_line->HasSwitch(switches::kNoExperiments))
2721 return;
2723 std::set<std::string> enabled_experiments;
2725 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2726 &enabled_experiments);
2728 NameToSwitchAndValueMap name_to_switch_map;
2729 for (size_t i = 0; i < num_experiments; ++i) {
2730 const Experiment& e = experiments[i];
2731 if (e.type == Experiment::SINGLE_VALUE) {
2732 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2733 e.command_line_value, &name_to_switch_map);
2734 } else if (e.type == Experiment::MULTI_VALUE) {
2735 for (int j = 0; j < e.num_choices; ++j) {
2736 SetFlagToSwitchMapping(e.NameForChoice(j),
2737 e.choices[j].command_line_switch,
2738 e.choices[j].command_line_value,
2739 &name_to_switch_map);
2741 } else {
2742 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2743 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2744 &name_to_switch_map);
2745 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2746 e.command_line_value, &name_to_switch_map);
2747 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2748 e.disable_command_line_value, &name_to_switch_map);
2752 if (sentinels == kAddSentinels) {
2753 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2754 flags_switches_.insert(
2755 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2756 std::string()));
2758 for (const std::string& experiment_name : enabled_experiments) {
2759 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2760 name_to_switch_map.find(experiment_name);
2761 if (name_to_switch_it == name_to_switch_map.end()) {
2762 NOTREACHED();
2763 continue;
2766 const std::pair<std::string, std::string>&
2767 switch_and_value_pair = name_to_switch_it->second;
2769 CHECK(!switch_and_value_pair.first.empty());
2770 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2771 switch_and_value_pair.second);
2772 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2774 if (sentinels == kAddSentinels) {
2775 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2776 flags_switches_.insert(
2777 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2778 std::string()));
2782 bool FlagsState::IsRestartNeededToCommitChanges() {
2783 return needs_restart_;
2786 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2787 const std::string& internal_name,
2788 bool enable) {
2789 size_t at_index = internal_name.find(testing::kMultiSeparator);
2790 if (at_index != std::string::npos) {
2791 DCHECK(enable);
2792 // We're being asked to enable a multi-choice experiment. Disable the
2793 // currently selected choice.
2794 DCHECK_NE(at_index, 0u);
2795 const std::string experiment_name = internal_name.substr(0, at_index);
2796 SetExperimentEnabled(flags_storage, experiment_name, false);
2798 // And enable the new choice, if it is not the default first choice.
2799 if (internal_name != experiment_name + "@0") {
2800 std::set<std::string> enabled_experiments;
2801 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2802 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2803 flags_storage->SetFlags(enabled_experiments);
2805 return;
2808 std::set<std::string> enabled_experiments;
2809 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2811 const Experiment* e = NULL;
2812 for (size_t i = 0; i < num_experiments; ++i) {
2813 if (experiments[i].internal_name == internal_name) {
2814 e = experiments + i;
2815 break;
2818 DCHECK(e);
2820 if (e->type == Experiment::SINGLE_VALUE) {
2821 if (enable)
2822 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2823 else
2824 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2825 } else {
2826 if (enable) {
2827 // Enable the first choice.
2828 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2829 } else {
2830 // Find the currently enabled choice and disable it.
2831 for (int i = 0; i < e->num_choices; ++i) {
2832 std::string choice_name = e->NameForChoice(i);
2833 if (enabled_experiments.find(choice_name) !=
2834 enabled_experiments.end()) {
2835 needs_restart_ = true;
2836 enabled_experiments.erase(choice_name);
2837 // Continue on just in case there's a bug and more than one
2838 // experiment for this choice was enabled.
2844 flags_storage->SetFlags(enabled_experiments);
2847 void FlagsState::RemoveFlagsSwitches(
2848 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2849 for (const auto& entry : flags_switches_)
2850 switch_list->erase(entry.first);
2853 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2854 needs_restart_ = true;
2856 std::set<std::string> no_experiments;
2857 flags_storage->SetFlags(no_experiments);
2860 void FlagsState::reset() {
2861 needs_restart_ = false;
2862 flags_switches_.clear();
2865 } // namespace
2867 namespace testing {
2869 // WARNING: '@' is also used in the html file. If you update this constant you
2870 // also need to update the html file.
2871 const char kMultiSeparator[] = "@";
2873 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2875 void ClearState() {
2876 FlagsState::GetInstance()->reset();
2879 void SetExperiments(const Experiment* e, size_t count) {
2880 if (!e) {
2881 experiments = kExperiments;
2882 num_experiments = arraysize(kExperiments);
2883 } else {
2884 experiments = e;
2885 num_experiments = count;
2889 const Experiment* GetExperiments(size_t* count) {
2890 *count = num_experiments;
2891 return experiments;
2894 } // namespace testing
2896 } // namespace about_flags