Re-land: C++ readability review
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blobad25f94f100da7e064a1a05e38671da5c4604d9d
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 kGpuRasterizationMSAASampleCountChoices[] = {
301 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
303 "" },
304 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_ZERO,
305 switches::kGpuRasterizationMSAASampleCount, "0" },
306 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_TWO,
307 switches::kGpuRasterizationMSAASampleCount, "2" },
308 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_FOUR,
309 switches::kGpuRasterizationMSAASampleCount, "4" },
310 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_EIGHT,
311 switches::kGpuRasterizationMSAASampleCount, "8" },
312 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_SIXTEEN,
313 switches::kGpuRasterizationMSAASampleCount, "16" },
316 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
317 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
318 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
319 switches::kEnableGpuRasterization, "" },
320 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
321 switches::kDisableGpuRasterization, "" },
322 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
323 switches::kForceGpuRasterization, "" },
326 #if defined(OS_CHROMEOS)
327 const Experiment::Choice kMemoryPressureThresholdChoices[] = {
328 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
329 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS,
330 chromeos::switches::kMemoryPressureThresholds,
331 chromeos::switches::kConservativeThreshold },
332 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS,
333 chromeos::switches::kMemoryPressureThresholds,
334 chromeos::switches::kAggressiveCacheDiscardThreshold },
335 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS,
336 chromeos::switches::kMemoryPressureThresholds,
337 chromeos::switches::kAggressiveTabDiscardThreshold },
338 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS,
339 chromeos::switches::kMemoryPressureThresholds,
340 chromeos::switches::kAggressiveThreshold },
342 #endif
344 const Experiment::Choice kExtensionContentVerificationChoices[] = {
345 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
346 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
347 switches::kExtensionContentVerification,
348 switches::kExtensionContentVerificationBootstrap },
349 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
350 switches::kExtensionContentVerification,
351 switches::kExtensionContentVerificationEnforce },
352 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
353 switches::kExtensionContentVerification,
354 switches::kExtensionContentVerificationEnforceStrict },
357 // Note that the value is specified in seconds (where 0 is equivalent to
358 // disabled).
359 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
360 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
361 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
362 switches::kRememberCertErrorDecisions,
363 "-1" },
364 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
365 switches::kRememberCertErrorDecisions,
366 "86400" },
367 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
368 switches::kRememberCertErrorDecisions,
369 "259200" },
370 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
371 switches::kRememberCertErrorDecisions,
372 "604800" },
373 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
374 switches::kRememberCertErrorDecisions,
375 "2592000" },
376 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
377 switches::kRememberCertErrorDecisions,
378 "7776000" },
381 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
382 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
383 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
384 password_manager::switches::kAllowAutofillSyncCredential, ""},
385 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
386 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
387 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
388 password_manager::switches::kDisallowAutofillSyncCredential, ""},
391 const Experiment::Choice kSSLVersionMinChoices[] = {
392 { IDS_FLAGS_SSL_VERSION_DEFAULT, "", "" },
393 { IDS_FLAGS_SSL_VERSION_SSLV3, switches::kSSLVersionMin,
394 switches::kSSLVersionSSLv3 },
395 { IDS_FLAGS_SSL_VERSION_TLSV1, switches::kSSLVersionMin,
396 switches::kSSLVersionTLSv1 },
397 { IDS_FLAGS_SSL_VERSION_TLSV11, switches::kSSLVersionMin,
398 switches::kSSLVersionTLSv11 },
399 { IDS_FLAGS_SSL_VERSION_TLSV12, switches::kSSLVersionMin,
400 switches::kSSLVersionTLSv12 },
403 const Experiment::Choice kFillOnAccountSelectChoices[] = {
404 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
405 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
406 autofill::switches::kDisableFillOnAccountSelect, "" },
407 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING,
408 autofill::switches::kEnableFillOnAccountSelect, "" },
409 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING,
410 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" },
413 #if defined(USE_ASH)
414 const Experiment::Choice kAshScreenRotationAnimationChoices[] = {
415 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
416 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
417 ash::switches::kAshEnableScreenRotationAnimation,
418 "none" },
419 { IDS_ASH_SCREEN_ROTATION_ANIMATION_PARTIAL_ROTATION,
420 ash::switches::kAshEnableScreenRotationAnimation,
421 "partial-rotation" },
422 { IDS_ASH_SCREEN_ROTATION_ANIMATION_FULL_ROTATION,
423 ash::switches::kAshEnableScreenRotationAnimation,
424 "full-rotation" }
426 #endif
428 // RECORDING USER METRICS FOR FLAGS:
429 // -----------------------------------------------------------------------------
430 // The first line of the experiment is the internal name. If you'd like to
431 // gather statistics about the usage of your flag, you should append a marker
432 // comment to the end of the feature name, like so:
433 // "my-special-feature", // FLAGS:RECORD_UMA
435 // After doing that, run
436 // tools/metrics/actions/extract_actions.py
437 // to add the metric to actions.xml (which will enable UMA to record your
438 // feature flag), then update the <owner>s and <description> sections. Make sure
439 // to include the actions.xml file when you upload your code for review!
441 // After your feature has shipped under a flag, you can locate the metrics under
442 // the action name AboutFlags_internal-action-name. Actions are recorded once
443 // per startup, so you should divide this number by AboutFlags_StartupTick to
444 // get a sense of usage. Note that this will not be the same as number of users
445 // with a given feature enabled because users can quit and relaunch the
446 // application multiple times over a given time interval. The dashboard also
447 // shows you how many (metrics reporting) users have enabled the flag over the
448 // last seven days. However, note that this is not the same as the number of
449 // users who have the flag enabled, since enabling the flag happens once,
450 // whereas running with the flag enabled happens until the user flips the flag
451 // again.
453 // To add a new experiment add to the end of kExperiments. There are two
454 // distinct types of experiments:
455 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
456 // macro for this type supplying the command line to the macro.
457 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
458 // deactivated state for this lab (i.e. no command line option). To specify
459 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
460 // array of choices.
461 // See the documentation of Experiment for details on the fields.
463 // Command-line switches must have entries in enum "LoginCustomFlags" in
464 // histograms.xml. See note in histograms.xml and don't forget to run
465 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
467 // When adding a new choice, add it to the end of the list.
468 const Experiment kExperiments[] = {
470 "ignore-gpu-blacklist",
471 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
472 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
473 kOsAll,
474 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
476 #if defined(OS_WIN)
478 "disable-direct-write",
479 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
480 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
481 kOsWin,
482 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
485 "enable-win32k-renderer-lockdown",
486 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_NAME,
487 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_DESCRIPTION,
488 kOsWin,
489 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableWin32kRendererLockDown,
490 switches::kDisableWin32kRendererLockDown)
492 #endif
494 "enable-experimental-canvas-features",
495 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
496 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
497 kOsAll,
498 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
501 "disable-accelerated-2d-canvas",
502 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
503 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
504 kOsAll,
505 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
508 "enable-display-list-2d-canvas",
509 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
510 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
511 kOsAll,
512 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas,
513 switches::kDisableDisplayList2dCanvas)
516 "composited-layer-borders",
517 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
518 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
519 kOsAll,
520 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
523 "show-fps-counter",
524 IDS_FLAGS_SHOW_FPS_COUNTER,
525 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
526 kOsAll,
527 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
530 "disable-webgl",
531 IDS_FLAGS_DISABLE_WEBGL_NAME,
532 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
533 kOsAll,
534 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
536 #if defined(OS_WIN) || defined(OS_MACOSX)
538 "enable-npapi",
539 IDS_FLAGS_ENABLE_NPAPI_NAME,
540 IDS_FLAGS_ENABLE_NPAPI_DESCRIPTION,
541 kOsWin | kOsMac,
542 SINGLE_VALUE_TYPE(switches::kEnableNpapi)
544 #endif
546 "disable-webrtc",
547 IDS_FLAGS_DISABLE_WEBRTC_NAME,
548 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
549 kOsAndroid,
550 #if defined(OS_ANDROID)
551 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
552 #else
553 SINGLE_VALUE_TYPE("")
554 #endif
556 #if defined(ENABLE_WEBRTC)
558 "disable-webrtc-hw-decoding",
559 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
560 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
561 kOsAndroid | kOsCrOS,
562 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
565 "disable-webrtc-hw-encoding",
566 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
567 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
568 kOsAndroid | kOsCrOS,
569 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
572 "enable-webrtc-stun-origin",
573 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_NAME,
574 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_DESCRIPTION,
575 kOsAll,
576 SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin)
578 #endif
579 #if defined(OS_ANDROID)
581 "disable-webaudio",
582 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
583 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
584 kOsAndroid,
585 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
587 #endif
588 // Native client is compiled out when DISABLE_NACL is defined.
589 #if !defined(DISABLE_NACL)
591 "enable-nacl", // FLAGS:RECORD_UMA
592 IDS_FLAGS_ENABLE_NACL_NAME,
593 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
594 kOsAll,
595 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
598 "enable-nacl-debug", // FLAGS:RECORD_UMA
599 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
600 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
601 kOsDesktop,
602 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
605 "nacl-debug-mask", // FLAGS:RECORD_UMA
606 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
607 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
608 kOsDesktop,
609 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
611 #endif
612 #if defined(ENABLE_EXTENSIONS)
614 "extension-apis", // FLAGS:RECORD_UMA
615 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
616 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
617 kOsDesktop,
618 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
621 "extensions-on-chrome-urls",
622 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
623 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
624 kOsAll,
625 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
627 #endif
629 "enable-fast-unload",
630 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
631 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
632 kOsAll,
633 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
635 #if defined(ENABLE_EXTENSIONS)
637 "enable-app-window-controls",
638 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
639 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
640 kOsDesktop,
641 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
643 #endif
645 "disable-hyperlink-auditing",
646 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
647 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
648 kOsAll,
649 SINGLE_VALUE_TYPE(switches::kNoPings)
651 #if defined(OS_ANDROID)
653 "contextual-search",
654 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
655 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
656 kOsAndroid,
657 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
658 switches::kDisableContextualSearch)
660 #endif
662 "show-autofill-type-predictions",
663 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
664 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
665 kOsAll,
666 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
669 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
670 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
671 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
672 // Can't expose the switch unless the code is compiled in.
673 // On by default for the Mac (different implementation in WebKit).
674 kOsLinux,
675 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
677 #if defined(USE_AURA) || defined(OS_LINUX)
679 "overlay-scrollbars",
680 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
681 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
682 // Uses the system preference on Mac (a different implementation).
683 // On Android, this is always enabled.
684 kOsLinux | kOsCrOS | kOsWin,
685 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar,
686 switches::kDisableOverlayScrollbar)
688 #endif
690 "enable-panels",
691 IDS_FLAGS_ENABLE_PANELS_NAME,
692 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
693 kOsDesktop,
694 SINGLE_VALUE_TYPE(switches::kEnablePanels)
697 // See http://crbug.com/120416 for how to remove this flag.
698 "save-page-as-mhtml", // FLAGS:RECORD_UMA
699 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
700 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
701 kOsMac | kOsWin | kOsLinux,
702 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
705 "enable-quic",
706 IDS_FLAGS_ENABLE_QUIC_NAME,
707 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
708 kOsAll,
709 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
710 switches::kDisableQuic)
713 "enable-spdy4",
714 IDS_FLAGS_ENABLE_SPDY4_NAME,
715 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
716 kOsAll,
717 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
720 "disable-media-source",
721 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
722 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
723 kOsAll,
724 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
727 "disable-encrypted-media",
728 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
729 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
730 kOsAll,
731 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
734 "disable-prefixed-encrypted-media",
735 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
736 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
737 kOsAll,
738 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
740 #if defined(OS_ANDROID)
742 "disable-infobar-for-protected-media-identifier",
743 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
744 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
745 kOsAndroid,
746 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
748 #endif // defined(OS_ANDROID)
750 "disable-javascript-harmony-shipping",
751 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_NAME,
752 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_DESCRIPTION,
753 kOsAll,
754 SINGLE_VALUE_TYPE(switches::kDisableJavaScriptHarmonyShipping)
757 "enable-javascript-harmony",
758 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
759 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
764 "disable-software-rasterizer",
765 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
766 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
767 #if defined(ENABLE_SWIFTSHADER)
768 kOsAll,
769 #else
771 #endif
772 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
775 "enable-gpu-rasterization",
776 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
777 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
778 kOsAll,
779 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
782 "gpu-rasterization-msaa-sample-count",
783 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_NAME,
784 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_DESCRIPTION,
785 kOsAll,
786 MULTI_VALUE_TYPE(kGpuRasterizationMSAASampleCountChoices)
789 "enable-slimming-paint",
790 IDS_FLAGS_ENABLE_SLIMMING_PAINT_NAME,
791 IDS_FLAGS_ENABLE_SLIMMING_PAINT_DESCRIPTION,
792 kOsAll,
793 SINGLE_VALUE_TYPE(switches::kEnableSlimmingPaint)
796 "enable-experimental-web-platform-features",
797 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
798 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
799 kOsAll,
800 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
803 "disable-ntp-other-sessions-menu",
804 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
805 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
806 kOsDesktop,
807 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
810 "enable-devtools-experiments",
811 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
812 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
813 kOsDesktop,
814 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
817 "silent-debugger-extension-api",
818 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
819 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
820 kOsDesktop,
821 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
823 #if defined(ENABLE_SPELLCHECK)
825 "spellcheck-autocorrect",
826 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
827 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
828 kOsWin | kOsLinux | kOsCrOS,
829 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
831 #endif
833 "enable-scroll-prediction",
834 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
835 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
836 kOsDesktop,
837 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
840 "touch-events",
841 IDS_TOUCH_EVENTS_NAME,
842 IDS_TOUCH_EVENTS_DESCRIPTION,
843 kOsDesktop,
844 MULTI_VALUE_TYPE(kTouchEventsChoices)
847 "disable-touch-adjustment",
848 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
849 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
850 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
851 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
853 #if defined(OS_CHROMEOS)
855 "network-portal-notification",
856 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
857 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
858 kOsCrOS,
859 ENABLE_DISABLE_VALUE_TYPE(
860 chromeos::switches::kEnableNetworkPortalNotification,
861 chromeos::switches::kDisableNetworkPortalNotification)
863 #endif
865 "enable-download-resumption",
866 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
867 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
868 kOsDesktop,
869 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
872 "enable-download-notification",
873 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_NAME,
874 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_DESCRIPTION,
875 kOsCrOS,
876 SINGLE_VALUE_TYPE(switches::kEnableDownloadNotification)
878 #if defined(ENABLE_PLUGINS)
880 "allow-nacl-socket-api",
881 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
882 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
883 kOsDesktop,
884 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
886 #endif
887 #if defined(OS_CHROMEOS)
889 "allow-touchpad-three-finger-click",
890 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
891 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
892 kOsCrOS,
893 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
896 "disable-easy-unlock",
897 IDS_FLAGS_DISABLE_EASY_UNLOCK_NAME,
898 IDS_FLAGS_DISABLE_EASY_UNLOCK_DESCRIPTION,
899 kOsCrOS,
900 SINGLE_VALUE_TYPE(proximity_auth::switches::kDisableEasyUnlock)
903 "enable-easy-unlock-proximity-detection",
904 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
905 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
906 kOsCrOS,
907 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)
909 #endif
910 #if defined(USE_ASH)
912 "disable-minimize-on-second-launcher-item-click",
913 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
914 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
915 kOsAll,
916 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
919 "show-touch-hud",
920 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
921 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
922 kOsAll,
923 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
926 "enable-pinch",
927 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
928 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
929 kOsLinux | kOsWin | kOsCrOS,
930 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
932 #endif // defined(USE_ASH)
934 "enable-pinch-virtual-viewport",
935 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
936 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
937 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
938 ENABLE_DISABLE_VALUE_TYPE(
939 cc::switches::kEnablePinchVirtualViewport,
940 cc::switches::kDisablePinchVirtualViewport),
943 "enable-viewport-meta",
944 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
945 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
946 kOsLinux | kOsWin | kOsCrOS | kOsMac,
947 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
949 #if defined(OS_CHROMEOS)
951 "disable-boot-animation",
952 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
953 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
954 kOsCrOSOwnerOnly,
955 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
958 "enable-video-player-chromecast-support",
959 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
960 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
961 kOsCrOS,
962 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
965 "disable-office-editing-component-app",
966 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
967 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
968 kOsCrOS,
969 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
972 "disable-display-color-calibration",
973 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
974 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
975 kOsCrOS,
976 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
979 "ash-disable-screen-orientation-lock",
980 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
981 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
982 kOsCrOS,
983 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
985 #endif // defined(OS_CHROMEOS)
986 { "disable-accelerated-video-decode",
987 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
988 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
989 kOsMac | kOsWin | kOsCrOS,
990 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
992 #if defined(USE_ASH)
994 "ash-debug-shortcuts",
995 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
996 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
997 kOsAll,
998 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1001 "ash-disable-maximize-mode-window-backdrop",
1002 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME,
1003 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_DESCRIPTION,
1004 kOsCrOS,
1005 SINGLE_VALUE_TYPE(ash::switches::kAshDisableMaximizeModeWindowBackdrop),
1007 { "ash-enable-touch-view-testing",
1008 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
1009 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
1010 kOsCrOS,
1011 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
1014 "disable-touch-feedback",
1015 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
1016 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
1017 kOsCrOS,
1018 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
1020 { "ash-enable-mirrored-screen",
1021 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
1022 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
1023 kOsCrOS,
1024 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
1027 "ash-enable-screen-rotation-animations",
1028 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_NAME,
1029 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_DESCRIPTION,
1030 kOsCrOS,
1031 MULTI_VALUE_TYPE(kAshScreenRotationAnimationChoices)
1033 #endif // defined(USE_ASH)
1034 #if defined(OS_CHROMEOS)
1036 "enable-carrier-switching",
1037 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1038 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1039 kOsCrOS,
1040 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
1043 "disable-cloud-import",
1044 IDS_FLAGS_DISABLE_CLOUD_IMPORT,
1045 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION,
1046 kOsCrOS,
1047 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport)
1050 "enable-request-tablet-site",
1051 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1052 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1053 kOsCrOS,
1054 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
1056 #endif
1058 "debug-packed-apps",
1059 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1060 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1061 kOsDesktop,
1062 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1065 "enable-password-generation",
1066 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1067 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1068 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1069 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1070 autofill::switches::kDisablePasswordGeneration)
1073 "enable-automatic-password-saving",
1074 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1075 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1076 kOsDesktop,
1077 SINGLE_VALUE_TYPE(
1078 password_manager::switches::kEnableAutomaticPasswordSaving)
1081 "password-manager-reauthentication",
1082 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1083 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1084 kOsMac | kOsWin,
1085 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
1088 "enable-password-link",
1089 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1090 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1091 kOsAndroid | kOsDesktop,
1092 ENABLE_DISABLE_VALUE_TYPE(
1093 password_manager::switches::kEnablePasswordLink,
1094 password_manager::switches::kDisablePasswordLink)
1097 "enable-password-save-in-page-navigation",
1098 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_NAME,
1099 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_DESCRIPTION,
1100 kOsAll,
1101 SINGLE_VALUE_TYPE(
1102 autofill::switches::kEnablePasswordSaveOnInPageNavigation)
1105 "enable-affiliation-based-matching",
1106 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME,
1107 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION,
1108 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1109 ENABLE_DISABLE_VALUE_TYPE(
1110 password_manager::switches::kEnableAffiliationBasedMatching,
1111 password_manager::switches::kDisableAffiliationBasedMatching)
1114 "enable-deferred-image-decoding",
1115 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1116 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1117 kOsMac | kOsLinux | kOsCrOS,
1118 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1121 "wallet-service-use-sandbox",
1122 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1123 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1124 kOsAndroid | kOsDesktop,
1125 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1126 autofill::switches::kWalletServiceUseSandbox, "1",
1127 autofill::switches::kWalletServiceUseSandbox, "0")
1129 #if defined(USE_AURA)
1131 "overscroll-history-navigation",
1132 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1133 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1134 kOsAll,
1135 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
1137 #endif
1139 "scroll-end-effect",
1140 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1141 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1142 kOsCrOS,
1143 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1144 switches::kScrollEndEffect, "1",
1145 switches::kScrollEndEffect, "0")
1148 "enable-icon-ntp",
1149 IDS_FLAGS_ENABLE_ICON_NTP_NAME,
1150 IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION,
1151 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1152 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIconNtp,
1153 switches::kDisableIconNtp)
1156 "enable-touch-drag-drop",
1157 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1158 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1159 kOsWin | kOsCrOS,
1160 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1161 switches::kDisableTouchDragDrop)
1164 "enable-touch-editing",
1165 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1166 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1167 kOsCrOS | kOsWin | kOsLinux,
1168 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1169 switches::kDisableTouchEditing)
1172 "enable-stale-while-revalidate",
1173 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME,
1174 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION,
1175 kOsAll,
1176 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate)
1179 "enable-suggestions-service",
1180 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1181 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1182 kOsAndroid | kOsCrOS,
1183 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1184 switches::kDisableSuggestionsService)
1187 "enable-supervised-user-blacklist",
1188 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1189 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1190 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1191 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist,
1192 switches::kDisableSupervisedUserBlacklist)
1195 "enable-supervised-user-managed-bookmarks-folder",
1196 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME,
1197 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION,
1198 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1199 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder)
1202 "enable-supervised-user-safesites",
1203 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME,
1204 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1205 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1206 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites,
1207 switches::kDisableSupervisedUserSafeSites)
1209 #if defined(ENABLE_APP_LIST)
1211 "enable-sync-app-list",
1212 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1213 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1214 kOsDesktop,
1215 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1216 app_list::switches::kDisableSyncAppList)
1218 #endif
1219 #if defined(OS_MACOSX)
1221 "enable-avfoundation",
1222 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1223 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1224 kOsMac,
1225 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1226 switches::kForceQTKit)
1228 #endif
1230 "lcd-text-aa",
1231 IDS_FLAGS_LCD_TEXT_NAME,
1232 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1233 kOsDesktop,
1234 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1235 switches::kDisableLCDText)
1237 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1239 "delegated-renderer",
1240 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1241 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1242 kOsAndroid, // TODO(ccameron) Add mac support soon.
1243 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1244 switches::kDisableDelegatedRenderer)
1246 #endif
1248 "max-tiles-for-interest-area",
1249 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1250 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1251 kOsAll,
1252 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1255 "enable-offer-store-unmasked-wallet-cards",
1256 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS,
1257 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION,
1258 kOsAll,
1259 ENABLE_DISABLE_VALUE_TYPE(
1260 autofill::switches::kEnableOfferStoreUnmaskedWalletCards,
1261 autofill::switches::kDisableOfferStoreUnmaskedWalletCards)
1264 "enable-offline-auto-reload",
1265 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1266 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1267 kOsAll,
1268 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1269 switches::kDisableOfflineAutoReload)
1272 "enable-offline-auto-reload-visible-only",
1273 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1274 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1275 kOsAll,
1276 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1277 switches::kDisableOfflineAutoReloadVisibleOnly)
1280 "show-saved-copy",
1281 IDS_FLAGS_SHOW_SAVED_COPY_NAME,
1282 IDS_FLAGS_SHOW_SAVED_COPY_DESCRIPTION,
1283 kOsAll,
1284 MULTI_VALUE_TYPE(kShowSavedCopyChoices)
1287 "default-tile-width",
1288 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1289 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1290 kOsAll,
1291 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1294 "default-tile-height",
1295 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1296 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1297 kOsAll,
1298 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1300 #if defined(OS_ANDROID)
1302 "disable-gesture-requirement-for-media-playback",
1303 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1304 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1305 kOsAndroid,
1306 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1308 #endif
1309 #if defined(OS_CHROMEOS)
1311 "enable-virtual-keyboard",
1312 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1313 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1314 kOsCrOS,
1315 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1318 "enable-virtual-keyboard-overscroll",
1319 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1320 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1321 kOsCrOS,
1322 ENABLE_DISABLE_VALUE_TYPE(
1323 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1324 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1327 "enable-swipe-selection",
1328 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1329 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1330 kOsCrOS,
1331 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1334 "enable-input-view",
1335 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1336 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1337 kOsCrOS,
1338 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1339 keyboard::switches::kDisableInputView)
1342 "enable-new-korean-ime",
1343 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_NAME,
1344 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_DESCRIPTION,
1345 kOsCrOS,
1346 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewKoreanIme)
1349 "disable-new-md-input-view",
1350 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_NAME,
1351 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_DESCRIPTION,
1352 kOsCrOS,
1353 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewMDInputView)
1356 "enable-physical-keyboard-autocorrect",
1357 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1358 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1359 kOsCrOS,
1360 ENABLE_DISABLE_VALUE_TYPE(
1361 chromeos::switches::kEnablePhysicalKeyboardAutocorrect,
1362 chromeos::switches::kDisablePhysicalKeyboardAutocorrect)
1365 "disable-voice-input",
1366 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME,
1367 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION,
1368 kOsCrOS,
1369 SINGLE_VALUE_TYPE(chromeos::switches::kDisableVoiceInput)
1372 "enable-experimental-input-view-features",
1373 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1374 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1375 kOsCrOS,
1376 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1379 "enable-gesture-typing",
1380 IDS_FLAGS_ENABLE_GESTURE_TYPING_NAME,
1381 IDS_FLAGS_ENABLE_GESTURE_TYPING_DESCRIPTION,
1382 kOsCrOS,
1383 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureTyping)
1386 "enable-gesture-deletion",
1387 IDS_FLAGS_ENABLE_GESTURE_DELETION_NAME,
1388 IDS_FLAGS_ENABLE_GESTURE_DELETION_DESCRIPTION,
1389 kOsCrOS,
1390 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureDeletion)
1393 "enable-gesture-selection",
1394 IDS_FLAGS_ENABLE_GESTURE_SELECTION_NAME,
1395 IDS_FLAGS_ENABLE_GESTURE_SELECTION_DESCRIPTION,
1396 kOsCrOS,
1397 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureSelection)
1400 "disable-smart-virtual-keyboard",
1401 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_NAME,
1402 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_DESCRIPTION,
1403 kOsCrOS,
1404 SINGLE_VALUE_TYPE(keyboard::switches::kDisableSmartVirtualKeyboard)
1406 #endif
1408 "enable-simple-cache-backend",
1409 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1410 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1411 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1412 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1415 "enable-tcp-fast-open",
1416 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1417 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1418 kOsLinux | kOsCrOS | kOsAndroid,
1419 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1421 #if defined(ENABLE_SERVICE_DISCOVERY)
1423 "device-discovery-notifications",
1424 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1425 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1426 kOsDesktop,
1427 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1428 switches::kDisableDeviceDiscoveryNotifications)
1431 "enable-print-preview-register-promos",
1432 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1433 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1434 kOsDesktop,
1435 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1437 #endif // ENABLE_SERVICE_DISCOVERY
1438 #if defined(OS_WIN)
1440 "enable-cloud-print-xps",
1441 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1442 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1443 kOsWin,
1444 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1446 #endif
1447 #if defined(USE_AURA)
1449 "tab-capture-upscale-quality",
1450 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1451 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1452 kOsAll,
1453 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1456 "tab-capture-downscale-quality",
1457 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1458 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1459 kOsAll,
1460 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1462 #endif
1463 #if defined(TOOLKIT_VIEWS)
1465 "disable-hide-inactive-stacked-tab-close-buttons",
1466 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_NAME,
1467 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_DESCRIPTION,
1468 kOsCrOS | kOsWin | kOsLinux,
1469 SINGLE_VALUE_TYPE(switches::kDisableHideInactiveStackedTabCloseButtons)
1471 #endif
1472 #if defined(ENABLE_SPELLCHECK)
1474 "enable-spelling-feedback-field-trial",
1475 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1476 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1477 kOsAll,
1478 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)
1480 #endif
1482 "enable-webgl-draft-extensions",
1483 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1484 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1485 kOsAll,
1486 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1489 "enable-new-profile-management",
1490 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1491 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1492 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1493 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1494 switches::kDisableNewProfileManagement)
1497 "enable-account-consistency",
1498 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1499 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1500 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1501 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1502 switches::kDisableAccountConsistency)
1505 "enable-fast-user-switching",
1506 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1507 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1508 kOsMac | kOsWin | kOsLinux,
1509 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1512 "enable-new-avatar-menu",
1513 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1514 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1515 kOsMac | kOsWin | kOsLinux,
1516 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1517 switches::kDisableNewAvatarMenu)
1520 "enable-iframe-based-signin",
1521 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME,
1522 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION,
1523 kOsMac | kOsWin | kOsLinux,
1524 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin)
1527 "enable-google-profile-info",
1528 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1529 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1530 kOsMac | kOsWin | kOsLinux,
1531 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
1534 "reset-app-list-install-state",
1535 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1536 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1537 kOsMac | kOsWin | kOsLinux,
1538 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
1540 #if defined(ENABLE_APP_LIST)
1541 #if defined(OS_LINUX)
1543 // This is compiled out on non-Linux platforms because otherwise it would be
1544 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1545 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1546 "enable-app-list",
1547 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1548 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1549 kOsLinux,
1550 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1552 #endif
1553 #if defined(ENABLE_EXTENSIONS)
1555 "enable-surface-worker",
1556 IDS_FLAGS_ENABLE_SURFACE_WORKER_NAME,
1557 IDS_FLAGS_ENABLE_SURFACE_WORKER_DESCRIPTION,
1558 kOsDesktop,
1559 SINGLE_VALUE_TYPE(extensions::switches::kEnableSurfaceWorker)
1561 #endif
1563 "disable-drive-apps-in-app-list",
1564 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1565 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1566 kOsCrOS,
1567 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
1569 #endif
1570 #if defined(OS_ANDROID)
1572 "enable-accessibility-tab-switcher",
1573 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1574 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1575 kOsAndroid,
1576 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
1579 // TODO(dmazzoni): remove this flag when native android accessibility
1580 // ships in the stable channel. http://crbug.com/356775
1581 "enable-accessibility-script-injection",
1582 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1583 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1584 kOsAndroid,
1585 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1586 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1588 #endif
1590 "enable-one-copy",
1591 IDS_FLAGS_ONE_COPY_NAME,
1592 IDS_FLAGS_ONE_COPY_DESCRIPTION,
1593 kOsAll,
1594 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy,
1595 switches::kDisableOneCopy)
1598 "enable-zero-copy",
1599 IDS_FLAGS_ZERO_COPY_NAME,
1600 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1601 kOsAll,
1602 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)
1604 #if defined(OS_CHROMEOS)
1606 "enable-first-run-ui-transitions",
1607 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1608 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1609 kOsCrOS,
1610 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1612 #endif
1614 "disable-new-bookmark-apps",
1615 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME,
1616 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION,
1617 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1618 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps,
1619 switches::kDisableNewBookmarkApps)
1621 #if defined(OS_MACOSX)
1623 "disable-hosted-app-shim-creation",
1624 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME,
1625 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION,
1626 kOsMac,
1627 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation)
1630 "enable-hosted-app-quit-notification",
1631 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME,
1632 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION,
1633 kOsMac,
1634 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)
1636 #endif
1638 "enable-ephemeral-apps-in-webstore",
1639 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
1640 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
1641 kOsAll,
1642 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)
1645 "enable-linkable-ephemeral-apps",
1646 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1647 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1648 kOsAll,
1649 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1652 "enable-service-worker-sync",
1653 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1654 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1655 kOsAll,
1656 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1658 #if defined(OS_ANDROID)
1660 "disable-click-delay",
1661 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1662 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1663 kOsAndroid,
1664 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1665 SINGLE_VALUE_TYPE("disable-click-delay")
1668 "disable-pull-to-refresh-effect",
1669 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1670 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1671 kOsAndroid,
1672 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)
1674 #endif
1675 #if defined(OS_MACOSX)
1677 "enable-translate-new-ux",
1678 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1679 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1680 kOsMac,
1681 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1683 #endif
1684 #if defined(TOOLKIT_VIEWS)
1686 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1687 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1688 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1689 kOsCrOS | kOsWin | kOsLinux,
1690 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
1693 "enable-link-disambiguation-popup",
1694 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1695 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1696 kOsCrOS | kOsWin,
1697 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)
1699 #endif
1700 #if defined(ENABLE_EXTENSIONS)
1702 "enable-apps-show-on-first-paint",
1703 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1704 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1705 kOsDesktop,
1706 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1708 #endif
1710 "enhanced-bookmarks-experiment",
1711 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1712 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1713 kOsDesktop | kOsAndroid,
1714 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1715 switches::kEnhancedBookmarksExperiment, "1",
1716 switches::kEnhancedBookmarksExperiment, "0")
1718 #if defined(OS_ANDROID)
1720 "enable-zero-suggest-experiment",
1721 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1722 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1723 kOsAndroid,
1724 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1727 "enable-reader-mode-toolbar-icon",
1728 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1729 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1730 kOsAndroid,
1731 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1734 "enable-dom-distiller-button-animation",
1735 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION,
1736 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION_DESCRIPTION,
1737 kOsAndroid,
1738 SINGLE_VALUE_TYPE(switches::kEnableDomDistillerButtonAnimation)
1740 #endif
1742 "num-raster-threads",
1743 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1744 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1745 kOsAll,
1746 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
1749 "enable-single-click-autofill",
1750 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1751 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1752 kOsCrOS | kOsMac | kOsWin | kOsLinux | kOsAndroid,
1753 ENABLE_DISABLE_VALUE_TYPE(
1754 autofill::switches::kEnableSingleClickAutofill,
1755 autofill::switches::kDisableSingleClickAutofill)
1758 "enable-permissions-bubbles",
1759 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1760 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1761 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1762 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1763 switches::kDisablePermissionsBubbles)
1766 "enable-session-crashed-bubble",
1767 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1768 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1769 kOsWin | kOsLinux,
1770 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1771 switches::kDisableSessionCrashedBubble)
1774 "enable-out-of-process-pdf",
1775 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1776 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1777 kOsDesktop,
1778 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf,
1779 switches::kDisableOutOfProcessPdf)
1782 "enable-pdf-material-ui",
1783 IDS_FLAGS_PDF_MATERIAL_UI_NAME,
1784 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
1785 kOsDesktop,
1786 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI,
1787 switches::kDisablePdfMaterialUI)
1790 "disable-cast-streaming-hw-encoding",
1791 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1792 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1793 kOsAll,
1794 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)
1796 #if defined(OS_ANDROID)
1798 "disable-cast",
1799 IDS_FLAGS_DISABLE_CAST_NAME,
1800 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1801 kOsAndroid,
1802 SINGLE_VALUE_TYPE(switches::kDisableCast)
1805 "prefetch-search-results",
1806 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1807 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1808 kOsAndroid,
1809 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1811 #endif
1812 #if defined(ENABLE_APP_LIST)
1814 "enable-experimental-app-list",
1815 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1816 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1817 kOsWin | kOsLinux | kOsCrOS,
1818 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList,
1819 app_list::switches::kDisableExperimentalAppList)
1822 "enable-centered-app-list",
1823 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1824 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1825 kOsWin | kOsLinux | kOsCrOS,
1826 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
1828 #endif
1830 "disable-threaded-scrolling",
1831 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1832 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1833 kOsWin | kOsLinux | kOsCrOS | kOsAndroid | kOsMac,
1834 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)
1837 "bleeding-edge-renderer-mode",
1838 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1839 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1840 kOsAndroid,
1841 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1844 "enable-settings-window",
1845 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1846 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1847 kOsDesktop,
1848 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1849 switches::kDisableSettingsWindow)
1851 #if defined(OS_ANDROID)
1853 "enable-instant-search-clicks",
1854 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1855 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1856 kOsAndroid,
1857 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1859 #endif
1861 "enable-save-password-bubble",
1862 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1863 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1864 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1865 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1866 switches::kDisableSavePasswordBubble)
1869 "enable-apps-file-associations",
1870 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1871 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1872 kOsMac,
1873 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1875 #if defined(OS_ANDROID)
1877 "enable-embeddedsearch-api",
1878 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1879 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1880 kOsAndroid,
1881 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1884 "enable-app-install-alerts",
1885 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1886 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1887 kOsAndroid,
1888 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1890 #endif
1892 "distance-field-text",
1893 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1894 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1895 kOsAll,
1896 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1897 switches::kDisableDistanceFieldText)
1900 "extension-content-verification",
1901 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1902 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1903 kOsDesktop,
1904 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1906 #if defined(USE_AURA)
1908 "text-input-focus-manager",
1909 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1910 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1911 kOsCrOS | kOsLinux | kOsWin,
1912 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1913 switches::kDisableTextInputFocusManager)
1915 #endif
1916 #if defined(ENABLE_EXTENSIONS)
1918 "extension-active-script-permission",
1919 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1920 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1921 kOsAll,
1922 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1924 #endif
1926 "answers-in-suggest",
1927 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1928 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1929 kOsAndroid | kOsWin | kOsLinux | kOsCrOS,
1930 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest,
1931 switches::kDisableAnswersInSuggest)
1933 #if defined(OS_ANDROID)
1935 "enable-data-reduction-proxy-dev",
1936 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1937 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1938 kOsAndroid,
1939 ENABLE_DISABLE_VALUE_TYPE(
1940 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1941 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1944 "enable-data-reduction-proxy-alt",
1945 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1946 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1947 kOsAndroid,
1948 SINGLE_VALUE_TYPE(
1949 data_reduction_proxy::switches::kEnableDataReductionProxyAlt)
1951 #endif
1953 "enable-hotword-hardware",
1954 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1955 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1956 kOsCrOS,
1957 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)
1959 #if defined(ENABLE_EXTENSIONS)
1961 "enable-embedded-extension-options",
1962 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1963 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1964 kOsDesktop,
1965 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1967 #endif
1968 #if defined(USE_ASH)
1970 "enable-web-app-frame",
1971 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME,
1972 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION,
1973 kOsWin | kOsCrOS,
1974 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)
1976 #endif
1978 "enable-website-settings-manager",
1979 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1980 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1981 kOsDesktop,
1982 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1985 "remember-cert-error-decisions",
1986 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1987 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1988 kOsAll,
1989 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1992 "enable-drop-sync-credential",
1993 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1994 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1995 kOsAll,
1996 ENABLE_DISABLE_VALUE_TYPE(
1997 password_manager::switches::kEnableDropSyncCredential,
1998 password_manager::switches::kDisableDropSyncCredential)
2000 #if defined(ENABLE_EXTENSIONS)
2002 "enable-extension-action-redesign",
2003 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
2004 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
2005 kOsDesktop,
2006 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
2008 #endif
2010 "autofill-sync-credential",
2011 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
2012 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
2013 kOsAll,
2014 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
2016 #if !defined(OS_ANDROID)
2018 "enable-message-center-always-scroll-up-upon-notification-removal",
2019 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
2020 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
2021 kOsDesktop,
2022 SINGLE_VALUE_TYPE(
2023 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
2026 "enable-md-settings",
2027 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME,
2028 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION,
2029 kOsDesktop,
2030 SINGLE_VALUE_TYPE(
2031 switches::kEnableMaterialDesignSettings)
2033 #endif
2034 #if defined(OS_CHROMEOS)
2036 "disable-memory-pressure-chromeos",
2037 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_NAME,
2038 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_DESCRIPTION,
2039 kOsCrOS,
2040 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMemoryPressureSystemChromeOS)
2043 "memory-pressure-thresholds",
2044 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME,
2045 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION,
2046 kOsCrOS,
2047 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices)
2050 "wake-on-packets",
2051 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
2052 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
2053 kOsCrOSOwnerOnly,
2054 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
2056 #endif // OS_CHROMEOS
2058 "enable-tab-audio-muting",
2059 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
2060 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
2061 kOsDesktop,
2062 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)
2065 "enable-credential-manager-api",
2066 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
2067 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
2068 kOsAll,
2069 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)
2072 "reduced-referrer-granularity",
2073 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
2074 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
2075 kOsAll,
2076 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)
2078 #if defined(ENABLE_PLUGINS)
2080 "enable-plugin-power-saver",
2081 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
2082 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
2083 kOsDesktop,
2084 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePluginPowerSaver,
2085 switches::kDisablePluginPowerSaver)
2087 #endif
2088 #if defined(OS_CHROMEOS)
2090 "disable-new-zip-unpacker",
2091 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
2092 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
2093 kOsCrOS,
2094 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)
2096 #endif // defined(OS_CHROMEOS)
2098 "ssl-version-min",
2099 IDS_FLAGS_SSL_VERSION_MIN_NAME,
2100 IDS_FLAGS_SSL_VERSION_MIN_DESCRIPTION,
2101 kOsAll,
2102 MULTI_VALUE_TYPE(kSSLVersionMinChoices)
2105 "enable-credit-card-scan",
2106 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
2107 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
2108 kOsAndroid,
2109 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan,
2110 autofill::switches::kDisableCreditCardScan)
2112 #if defined(OS_CHROMEOS)
2114 "disable-captive-portal-bypass-proxy",
2115 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
2116 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
2117 kOsCrOS,
2118 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCaptivePortalBypassProxy)
2121 "disable-roboto-font-ui",
2122 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_NAME,
2123 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_DESCRIPTION,
2124 kOsCrOS,
2125 SINGLE_VALUE_TYPE(switches::kDisableRobotoFontUI)
2127 #endif // defined(OS_CHROMEOS)
2128 #if defined(OS_ANDROID)
2130 "enable-seccomp-filter-sandbox",
2131 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
2132 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
2133 kOsAndroid,
2134 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)
2136 #endif
2138 "enable-touch-hover",
2139 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME,
2140 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION,
2141 kOsAndroid,
2142 SINGLE_VALUE_TYPE("enable-touch-hover")
2145 "enable-fill-on-account-select",
2146 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
2147 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
2148 kOsAll,
2149 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices)
2151 #if defined(OS_CHROMEOS)
2153 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA
2154 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
2155 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
2156 kOsCrOS,
2157 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)
2160 "enable-potentially-annoying-security-features",
2161 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME,
2162 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION,
2163 kOsAll,
2164 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)
2166 #endif
2168 "enable-delay-agnostic-aec",
2169 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
2170 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
2171 kOsDesktop,
2172 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)
2175 "mark-non-secure-as", // FLAGS:RECORD_UMA
2176 IDS_MARK_NON_SECURE_AS_NAME,
2177 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
2178 kOsAll,
2179 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)
2182 "enable-site-per-process",
2183 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
2184 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
2185 kOsAll,
2186 SINGLE_VALUE_TYPE(switches::kSitePerProcess)
2188 #if defined(OS_MACOSX)
2190 "enable-harfbuzz-rendertext",
2191 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
2192 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
2193 kOsMac,
2194 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)
2196 #endif // defined(OS_MACOSX)
2197 #if defined(OS_CHROMEOS)
2199 "disable-timezone-tracking",
2200 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
2201 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
2202 kOsCrOS,
2203 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption)
2206 "disable-webview-signin-flow",
2207 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_NAME,
2208 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_DESCRIPTION,
2209 kOsCrOS,
2210 SINGLE_VALUE_TYPE(chromeos::switches::kDisableWebviewSigninFlow)
2212 #endif // defined(OS_CHROMEOS)
2214 "enable-data-reduction-proxy-lo-fi",
2215 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME,
2216 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION,
2217 kOsAll,
2218 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2219 kEnableDataReductionProxyLoFi)
2222 "clear-data-reduction-proxy-data-savings",
2223 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME,
2224 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION,
2225 kOsAll,
2226 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2227 kClearDataReductionProxyDataSavings)
2229 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2231 "enable-data-reduction-proxy-bypass-warnings",
2232 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2233 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2234 kOsAndroid,
2235 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2236 kEnableDataReductionProxyBypassWarning)
2238 #endif
2240 "allow-insecure-localhost",
2241 IDS_ALLOW_INSECURE_LOCALHOST,
2242 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION,
2243 kOsAll,
2244 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)
2247 "bypass-app-banner-engagement-checks",
2248 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME,
2249 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION,
2250 kOsAndroid,
2251 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks)
2254 "use-sync-sandbox",
2255 IDS_FLAGS_SYNC_SANDBOX_NAME,
2256 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
2257 kOsAll,
2258 SINGLE_VALUE_TYPE_AND_VALUE(
2259 switches::kSyncServiceURL,
2260 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
2263 "enable-child-account-detection",
2264 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_NAME,
2265 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_DESCRIPTION,
2266 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
2267 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableChildAccountDetection,
2268 switches::kDisableChildAccountDetection)
2270 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
2272 "ozone-test-single-overlay-support",
2273 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY,
2274 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION,
2275 kOsCrOS,
2276 SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport)
2278 #endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
2280 "v8-pac-mojo-out-of-process",
2281 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME,
2282 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION,
2283 kOsDesktop,
2284 SINGLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess),
2286 #if defined(OS_CHROMEOS)
2288 "enable-firewall-hole-punching",
2289 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_NAME,
2290 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_DESCRIPTION,
2291 kOsCrOS,
2292 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirewallHolePunching)
2294 #endif // defined(OS_CHROMEOS)
2296 "enable-media-router",
2297 IDS_FLAGS_ENABLE_MEDIA_ROUTER_NAME,
2298 IDS_FLAGS_ENABLE_MEDIA_ROUTER_DESCRIPTION,
2299 kOsAll,
2300 SINGLE_VALUE_TYPE(switches::kEnableMediaRouter)
2302 // Since kEnableLauncherSearchProviderApi is not available when app list is
2303 // disabled, flag guard enable-launcher-search-provider-api.
2304 #if defined(ENABLE_APP_LIST)
2306 "enable-launcher-search-provider-api",
2307 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API,
2308 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API_DESCRIPTION,
2309 kOsCrOS,
2310 SINGLE_VALUE_TYPE(app_list::switches::kEnableLauncherSearchProviderApi)
2312 #endif // defined(ENABLE_APP_LIST)
2313 #if defined(OS_CHROMEOS)
2315 "enable-mtp-write-support",
2316 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_NAME,
2317 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_DESCRIPTION,
2318 kOsCrOS,
2319 SINGLE_VALUE_TYPE(chromeos::switches::kEnableMtpWriteSupport)
2321 #endif // defined(OS_CHROMEOS)
2322 // NOTE: Adding new command-line switches requires adding corresponding
2323 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2324 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2327 const Experiment* experiments = kExperiments;
2328 size_t num_experiments = arraysize(kExperiments);
2330 // Stores and encapsulates the little state that about:flags has.
2331 class FlagsState {
2332 public:
2333 FlagsState() : needs_restart_(false) {}
2334 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2335 base::CommandLine* command_line,
2336 SentinelsMode sentinels);
2337 bool IsRestartNeededToCommitChanges();
2338 void SetExperimentEnabled(
2339 FlagsStorage* flags_storage,
2340 const std::string& internal_name,
2341 bool enable);
2342 void RemoveFlagsSwitches(
2343 std::map<std::string, base::CommandLine::StringType>* switch_list);
2344 void ResetAllFlags(FlagsStorage* flags_storage);
2345 void reset();
2347 // Returns the singleton instance of this class
2348 static FlagsState* GetInstance() {
2349 return Singleton<FlagsState>::get();
2352 private:
2353 bool needs_restart_;
2354 std::map<std::string, std::string> flags_switches_;
2356 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2359 // Adds the internal names for the specified experiment to |names|.
2360 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2361 if (e.type == Experiment::SINGLE_VALUE) {
2362 names->insert(e.internal_name);
2363 } else {
2364 DCHECK(e.type == Experiment::MULTI_VALUE ||
2365 e.type == Experiment::ENABLE_DISABLE_VALUE);
2366 for (int i = 0; i < e.num_choices; ++i)
2367 names->insert(e.NameForChoice(i));
2371 // Confirms that an experiment is valid, used in a DCHECK in
2372 // SanitizeList below.
2373 bool ValidateExperiment(const Experiment& e) {
2374 switch (e.type) {
2375 case Experiment::SINGLE_VALUE:
2376 DCHECK_EQ(0, e.num_choices);
2377 DCHECK(!e.choices);
2378 break;
2379 case Experiment::MULTI_VALUE:
2380 DCHECK_GT(e.num_choices, 0);
2381 DCHECK(e.choices);
2382 DCHECK(e.choices[0].command_line_switch);
2383 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2384 break;
2385 case Experiment::ENABLE_DISABLE_VALUE:
2386 DCHECK_EQ(3, e.num_choices);
2387 DCHECK(!e.choices);
2388 DCHECK(e.command_line_switch);
2389 DCHECK(e.command_line_value);
2390 DCHECK(e.disable_command_line_switch);
2391 DCHECK(e.disable_command_line_value);
2392 break;
2393 default:
2394 NOTREACHED();
2396 return true;
2399 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2400 // unknown, to prevent this list to become very long as experiments are added
2401 // and removed.
2402 void SanitizeList(FlagsStorage* flags_storage) {
2403 std::set<std::string> known_experiments;
2404 for (size_t i = 0; i < num_experiments; ++i) {
2405 DCHECK(ValidateExperiment(experiments[i]));
2406 AddInternalName(experiments[i], &known_experiments);
2409 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2411 std::set<std::string> new_enabled_experiments =
2412 base::STLSetIntersection<std::set<std::string> >(
2413 known_experiments, enabled_experiments);
2415 if (new_enabled_experiments != enabled_experiments)
2416 flags_storage->SetFlags(new_enabled_experiments);
2419 void GetSanitizedEnabledFlags(
2420 FlagsStorage* flags_storage, std::set<std::string>* result) {
2421 SanitizeList(flags_storage);
2422 *result = flags_storage->GetFlags();
2425 bool SkipConditionalExperiment(const Experiment& experiment,
2426 FlagsStorage* flags_storage) {
2427 #if defined(OS_ANDROID) || defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2428 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2429 #endif
2431 #if defined(OS_ANDROID)
2432 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2433 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2434 channel != chrome::VersionInfo::CHANNEL_BETA &&
2435 channel != chrome::VersionInfo::CHANNEL_DEV) {
2436 return true;
2438 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2439 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2440 channel != chrome::VersionInfo::CHANNEL_DEV) {
2441 return true;
2443 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and
2444 // the Canary/Dev channel.
2445 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) &&
2446 channel != chrome::VersionInfo::CHANNEL_DEV &&
2447 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2448 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2449 return true;
2451 #endif
2453 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2454 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2455 // builds and Canary/Dev channel.
2456 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2457 experiment.internal_name) &&
2458 channel != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2459 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2460 channel != chrome::VersionInfo::CHANNEL_DEV) {
2461 return true;
2463 #endif
2465 return false;
2469 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2470 // enabled on the current platform.
2471 void GetSanitizedEnabledFlagsForCurrentPlatform(
2472 FlagsStorage* flags_storage, std::set<std::string>* result) {
2473 GetSanitizedEnabledFlags(flags_storage, result);
2475 // Filter out any experiments that aren't enabled on the current platform. We
2476 // don't remove these from prefs else syncing to a platform with a different
2477 // set of experiments would be lossy.
2478 std::set<std::string> platform_experiments;
2479 int current_platform = GetCurrentPlatform();
2480 for (size_t i = 0; i < num_experiments; ++i) {
2481 if (experiments[i].supported_platforms & current_platform)
2482 AddInternalName(experiments[i], &platform_experiments);
2483 #if defined(OS_CHROMEOS)
2484 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2485 AddInternalName(experiments[i], &platform_experiments);
2486 #endif
2489 std::set<std::string> new_enabled_experiments =
2490 base::STLSetIntersection<std::set<std::string> >(
2491 platform_experiments, *result);
2493 result->swap(new_enabled_experiments);
2496 // Returns the Value representing the choice data in the specified experiment.
2497 base::Value* CreateChoiceData(
2498 const Experiment& experiment,
2499 const std::set<std::string>& enabled_experiments) {
2500 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2501 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2502 base::ListValue* result = new base::ListValue;
2503 for (int i = 0; i < experiment.num_choices; ++i) {
2504 base::DictionaryValue* value = new base::DictionaryValue;
2505 const std::string name = experiment.NameForChoice(i);
2506 value->SetString("internal_name", name);
2507 value->SetString("description", experiment.DescriptionForChoice(i));
2508 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2509 result->Append(value);
2511 return result;
2514 } // namespace
2516 std::string Experiment::NameForChoice(int index) const {
2517 DCHECK(type == Experiment::MULTI_VALUE ||
2518 type == Experiment::ENABLE_DISABLE_VALUE);
2519 DCHECK_LT(index, num_choices);
2520 return std::string(internal_name) + testing::kMultiSeparator +
2521 base::IntToString(index);
2524 base::string16 Experiment::DescriptionForChoice(int index) const {
2525 DCHECK(type == Experiment::MULTI_VALUE ||
2526 type == Experiment::ENABLE_DISABLE_VALUE);
2527 DCHECK_LT(index, num_choices);
2528 int description_id;
2529 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2530 const int kEnableDisableDescriptionIds[] = {
2531 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2532 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2533 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2535 description_id = kEnableDisableDescriptionIds[index];
2536 } else {
2537 description_id = choices[index].description_id;
2539 return l10n_util::GetStringUTF16(description_id);
2542 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2543 base::CommandLine* command_line,
2544 SentinelsMode sentinels) {
2545 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2546 command_line,
2547 sentinels);
2550 bool AreSwitchesIdenticalToCurrentCommandLine(
2551 const base::CommandLine& new_cmdline,
2552 const base::CommandLine& active_cmdline,
2553 std::set<base::CommandLine::StringType>* out_difference) {
2554 std::set<base::CommandLine::StringType> new_flags =
2555 ExtractFlagsFromCommandLine(new_cmdline);
2556 std::set<base::CommandLine::StringType> active_flags =
2557 ExtractFlagsFromCommandLine(active_cmdline);
2559 bool result = false;
2560 // Needed because std::equal doesn't check if the 2nd set is empty.
2561 if (new_flags.size() == active_flags.size()) {
2562 result =
2563 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2566 if (out_difference && !result) {
2567 std::set_symmetric_difference(
2568 new_flags.begin(),
2569 new_flags.end(),
2570 active_flags.begin(),
2571 active_flags.end(),
2572 std::inserter(*out_difference, out_difference->begin()));
2575 return result;
2578 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2579 FlagAccess access,
2580 base::ListValue* supported_experiments,
2581 base::ListValue* unsupported_experiments) {
2582 std::set<std::string> enabled_experiments;
2583 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2585 int current_platform = GetCurrentPlatform();
2587 for (size_t i = 0; i < num_experiments; ++i) {
2588 const Experiment& experiment = experiments[i];
2589 if (SkipConditionalExperiment(experiment, flags_storage))
2590 continue;
2592 base::DictionaryValue* data = new base::DictionaryValue();
2593 data->SetString("internal_name", experiment.internal_name);
2594 data->SetString("name",
2595 l10n_util::GetStringUTF16(experiment.visible_name_id));
2596 data->SetString("description",
2597 l10n_util::GetStringUTF16(
2598 experiment.visible_description_id));
2600 base::ListValue* supported_platforms = new base::ListValue();
2601 AddOsStrings(experiment.supported_platforms, supported_platforms);
2602 data->Set("supported_platforms", supported_platforms);
2604 switch (experiment.type) {
2605 case Experiment::SINGLE_VALUE:
2606 data->SetBoolean(
2607 "enabled",
2608 enabled_experiments.count(experiment.internal_name) > 0);
2609 break;
2610 case Experiment::MULTI_VALUE:
2611 case Experiment::ENABLE_DISABLE_VALUE:
2612 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2613 break;
2614 default:
2615 NOTREACHED();
2618 bool supported = (experiment.supported_platforms & current_platform) != 0;
2619 #if defined(OS_CHROMEOS)
2620 if (access == kOwnerAccessToFlags &&
2621 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2622 supported = true;
2624 #endif
2625 if (supported)
2626 supported_experiments->Append(data);
2627 else
2628 unsupported_experiments->Append(data);
2632 bool IsRestartNeededToCommitChanges() {
2633 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2636 void SetExperimentEnabled(FlagsStorage* flags_storage,
2637 const std::string& internal_name,
2638 bool enable) {
2639 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2640 internal_name, enable);
2643 void RemoveFlagsSwitches(
2644 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2645 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2648 void ResetAllFlags(FlagsStorage* flags_storage) {
2649 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2652 int GetCurrentPlatform() {
2653 #if defined(OS_MACOSX)
2654 return kOsMac;
2655 #elif defined(OS_WIN)
2656 return kOsWin;
2657 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2658 return kOsCrOS;
2659 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2660 return kOsLinux;
2661 #elif defined(OS_ANDROID)
2662 return kOsAndroid;
2663 #else
2664 #error Unknown platform
2665 #endif
2668 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2669 std::set<std::string> flags = flags_storage->GetFlags();
2670 for (const std::string& flag : flags) {
2671 std::string action("AboutFlags_");
2672 action += flag;
2673 content::RecordComputedAction(action);
2675 // Since flag metrics are recorded every startup, add a tick so that the
2676 // stats can be made meaningful.
2677 if (flags.size())
2678 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2679 content::RecordAction(base::UserMetricsAction("StartupTick"));
2682 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2683 return static_cast<base::HistogramBase::Sample>(
2684 metrics::HashMetricName(switch_name));
2687 void ReportCustomFlags(const std::string& uma_histogram_hame,
2688 const std::set<std::string>& command_line_difference) {
2689 for (const std::string& flag : command_line_difference) {
2690 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2691 if (StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2692 // Skip '--' before switch name.
2693 std::string switch_name(flag.substr(2));
2695 // Kill value, if any.
2696 const size_t value_pos = switch_name.find('=');
2697 if (value_pos != std::string::npos)
2698 switch_name.resize(value_pos);
2700 uma_id = GetSwitchUMAId(switch_name);
2701 } else {
2702 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2703 << "' has incorrect format.";
2705 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2706 << "' '" << flag << "', uma_id=" << uma_id;
2708 // Sparse histogram macro does not cache the histogram, so it's safe
2709 // to use macro with non-static histogram name here.
2710 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2714 //////////////////////////////////////////////////////////////////////////////
2715 // FlagsState implementation.
2717 namespace {
2719 typedef std::map<std::string, std::pair<std::string, std::string> >
2720 NameToSwitchAndValueMap;
2722 void SetFlagToSwitchMapping(const std::string& key,
2723 const std::string& switch_name,
2724 const std::string& switch_value,
2725 NameToSwitchAndValueMap* name_to_switch_map) {
2726 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2727 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2730 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2731 base::CommandLine* command_line,
2732 SentinelsMode sentinels) {
2733 if (command_line->HasSwitch(switches::kNoExperiments))
2734 return;
2736 std::set<std::string> enabled_experiments;
2738 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2739 &enabled_experiments);
2741 NameToSwitchAndValueMap name_to_switch_map;
2742 for (size_t i = 0; i < num_experiments; ++i) {
2743 const Experiment& e = experiments[i];
2744 if (e.type == Experiment::SINGLE_VALUE) {
2745 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2746 e.command_line_value, &name_to_switch_map);
2747 } else if (e.type == Experiment::MULTI_VALUE) {
2748 for (int j = 0; j < e.num_choices; ++j) {
2749 SetFlagToSwitchMapping(e.NameForChoice(j),
2750 e.choices[j].command_line_switch,
2751 e.choices[j].command_line_value,
2752 &name_to_switch_map);
2754 } else {
2755 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2756 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2757 &name_to_switch_map);
2758 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2759 e.command_line_value, &name_to_switch_map);
2760 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2761 e.disable_command_line_value, &name_to_switch_map);
2765 if (sentinels == kAddSentinels) {
2766 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2767 flags_switches_.insert(
2768 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2769 std::string()));
2771 for (const std::string& experiment_name : enabled_experiments) {
2772 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2773 name_to_switch_map.find(experiment_name);
2774 if (name_to_switch_it == name_to_switch_map.end()) {
2775 NOTREACHED();
2776 continue;
2779 const std::pair<std::string, std::string>&
2780 switch_and_value_pair = name_to_switch_it->second;
2782 CHECK(!switch_and_value_pair.first.empty());
2783 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2784 switch_and_value_pair.second);
2785 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2787 if (sentinels == kAddSentinels) {
2788 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2789 flags_switches_.insert(
2790 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2791 std::string()));
2795 bool FlagsState::IsRestartNeededToCommitChanges() {
2796 return needs_restart_;
2799 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2800 const std::string& internal_name,
2801 bool enable) {
2802 size_t at_index = internal_name.find(testing::kMultiSeparator);
2803 if (at_index != std::string::npos) {
2804 DCHECK(enable);
2805 // We're being asked to enable a multi-choice experiment. Disable the
2806 // currently selected choice.
2807 DCHECK_NE(at_index, 0u);
2808 const std::string experiment_name = internal_name.substr(0, at_index);
2809 SetExperimentEnabled(flags_storage, experiment_name, false);
2811 // And enable the new choice, if it is not the default first choice.
2812 if (internal_name != experiment_name + "@0") {
2813 std::set<std::string> enabled_experiments;
2814 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2815 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2816 flags_storage->SetFlags(enabled_experiments);
2818 return;
2821 std::set<std::string> enabled_experiments;
2822 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2824 const Experiment* e = NULL;
2825 for (size_t i = 0; i < num_experiments; ++i) {
2826 if (experiments[i].internal_name == internal_name) {
2827 e = experiments + i;
2828 break;
2831 DCHECK(e);
2833 if (e->type == Experiment::SINGLE_VALUE) {
2834 if (enable)
2835 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2836 else
2837 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2838 } else {
2839 if (enable) {
2840 // Enable the first choice.
2841 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2842 } else {
2843 // Find the currently enabled choice and disable it.
2844 for (int i = 0; i < e->num_choices; ++i) {
2845 std::string choice_name = e->NameForChoice(i);
2846 if (enabled_experiments.find(choice_name) !=
2847 enabled_experiments.end()) {
2848 needs_restart_ = true;
2849 enabled_experiments.erase(choice_name);
2850 // Continue on just in case there's a bug and more than one
2851 // experiment for this choice was enabled.
2857 flags_storage->SetFlags(enabled_experiments);
2860 void FlagsState::RemoveFlagsSwitches(
2861 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2862 for (const auto& entry : flags_switches_)
2863 switch_list->erase(entry.first);
2866 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2867 needs_restart_ = true;
2869 std::set<std::string> no_experiments;
2870 flags_storage->SetFlags(no_experiments);
2873 void FlagsState::reset() {
2874 needs_restart_ = false;
2875 flags_switches_.clear();
2878 } // namespace
2880 namespace testing {
2882 // WARNING: '@' is also used in the html file. If you update this constant you
2883 // also need to update the html file.
2884 const char kMultiSeparator[] = "@";
2886 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2888 void ClearState() {
2889 FlagsState::GetInstance()->reset();
2892 void SetExperiments(const Experiment* e, size_t count) {
2893 if (!e) {
2894 experiments = kExperiments;
2895 num_experiments = arraysize(kExperiments);
2896 } else {
2897 experiments = e;
2898 num_experiments = count;
2902 const Experiment* GetExperiments(size_t* count) {
2903 *count = num_experiments;
2904 return experiments;
2907 } // namespace testing
2909 } // namespace about_flags