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"
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"
48 #include "ui/message_center/message_center_switches.h"
52 #include "ash/ash_switches.h"
55 #if defined(OS_CHROMEOS)
56 #include "chromeos/chromeos_switches.h"
57 #include "third_party/cros_system_api/switches/chrome_switches.h"
60 #if defined(ENABLE_APP_LIST)
61 #include "ui/app_list/app_list_switches.h"
64 #if defined(ENABLE_EXTENSIONS)
65 #include "extensions/common/switches.h"
68 #if defined(USE_OZONE)
69 #include "ui/ozone/public/ozone_switches.h"
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)
91 // Enumeration of OSs.
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
) {
109 const char* const name
;
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
);
157 const Experiment::Choice kTouchEventsChoices
[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC
, "", "" },
159 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
160 switches::kTouchEvents
,
161 switches::kTouchEventsEnabled
},
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
163 switches::kTouchEvents
,
164 switches::kTouchEventsDisabled
}
167 #if defined(USE_AURA)
168 const Experiment::Choice kOverscrollHistoryNavigationChoices
[] = {
169 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
, "", "" },
170 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
171 switches::kOverscrollHistoryNavigation
,
173 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI
,
174 switches::kOverscrollHistoryNavigation
,
179 #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" }
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" },
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
, ""}
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
,
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
},
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
359 const Experiment::Choice kRememberCertificateErrorDecisionsChoices
[] = {
360 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
361 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
362 switches::kRememberCertErrorDecisions
,
364 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY
,
365 switches::kRememberCertErrorDecisions
,
367 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS
,
368 switches::kRememberCertErrorDecisions
,
370 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK
,
371 switches::kRememberCertErrorDecisions
,
373 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH
,
374 switches::kRememberCertErrorDecisions
,
376 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS
,
377 switches::kRememberCertErrorDecisions
,
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
, "" },
414 const Experiment::Choice kAshScreenRotationAnimationChoices
[] = {
415 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
416 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
417 ash::switches::kAshEnableScreenRotationAnimation
,
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
,
428 #if defined(OS_CHROMEOS)
429 const Experiment::Choice kDataSaverPromptChoices
[] = {
430 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
, "", "" },
431 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
432 chromeos::switches::kDisableDataSaverPrompt
, "" },
433 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
434 chromeos::switches::kEnableDataSaverPrompt
, "" },
435 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE
,
436 chromeos::switches::kEnableDataSaverPrompt
,
437 chromeos::switches::kDataSaverPromptDemoMode
},
441 // RECORDING USER METRICS FOR FLAGS:
442 // -----------------------------------------------------------------------------
443 // The first line of the experiment is the internal name. If you'd like to
444 // gather statistics about the usage of your flag, you should append a marker
445 // comment to the end of the feature name, like so:
446 // "my-special-feature", // FLAGS:RECORD_UMA
448 // After doing that, run
449 // tools/metrics/actions/extract_actions.py
450 // to add the metric to actions.xml (which will enable UMA to record your
451 // feature flag), then update the <owner>s and <description> sections. Make sure
452 // to include the actions.xml file when you upload your code for review!
454 // After your feature has shipped under a flag, you can locate the metrics under
455 // the action name AboutFlags_internal-action-name. Actions are recorded once
456 // per startup, so you should divide this number by AboutFlags_StartupTick to
457 // get a sense of usage. Note that this will not be the same as number of users
458 // with a given feature enabled because users can quit and relaunch the
459 // application multiple times over a given time interval. The dashboard also
460 // shows you how many (metrics reporting) users have enabled the flag over the
461 // last seven days. However, note that this is not the same as the number of
462 // users who have the flag enabled, since enabling the flag happens once,
463 // whereas running with the flag enabled happens until the user flips the flag
466 // To add a new experiment add to the end of kExperiments. There are two
467 // distinct types of experiments:
468 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
469 // macro for this type supplying the command line to the macro.
470 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
471 // deactivated state for this lab (i.e. no command line option). To specify
472 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
474 // See the documentation of Experiment for details on the fields.
476 // Command-line switches must have entries in enum "LoginCustomFlags" in
477 // histograms.xml. See note in histograms.xml and don't forget to run
478 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
480 // When adding a new choice, add it to the end of the list.
481 const Experiment kExperiments
[] = {
483 "ignore-gpu-blacklist",
484 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME
,
485 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION
,
487 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist
)
491 "disable-direct-write",
492 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME
,
493 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION
,
495 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite
)
498 "enable-win32k-renderer-lockdown",
499 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_NAME
,
500 IDS_FLAGS_ENABLE_WIN32K_RENDERER_LOCKDOWN_DESCRIPTION
,
502 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableWin32kRendererLockDown
,
503 switches::kDisableWin32kRendererLockDown
)
507 "enable-experimental-canvas-features",
508 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME
,
509 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION
,
511 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures
)
514 "disable-accelerated-2d-canvas",
515 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME
,
516 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION
,
518 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas
)
521 "enable-display-list-2d-canvas",
522 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME
,
523 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION
,
525 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas
,
526 switches::kDisableDisplayList2dCanvas
)
529 "composited-layer-borders",
530 IDS_FLAGS_COMPOSITED_LAYER_BORDERS
,
531 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION
,
533 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders
)
537 IDS_FLAGS_SHOW_FPS_COUNTER
,
538 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION
,
540 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter
)
544 IDS_FLAGS_DISABLE_WEBGL_NAME
,
545 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION
,
547 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL
)
549 #if defined(OS_WIN) || defined(OS_MACOSX)
552 IDS_FLAGS_ENABLE_NPAPI_NAME
,
553 IDS_FLAGS_ENABLE_NPAPI_DESCRIPTION
,
555 SINGLE_VALUE_TYPE(switches::kEnableNpapi
)
560 IDS_FLAGS_DISABLE_WEBRTC_NAME
,
561 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION
,
563 #if defined(OS_ANDROID)
564 SINGLE_VALUE_TYPE(switches::kDisableWebRTC
)
566 SINGLE_VALUE_TYPE("")
569 #if defined(ENABLE_WEBRTC)
571 "disable-webrtc-hw-decoding",
572 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME
,
573 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION
,
574 kOsAndroid
| kOsCrOS
,
575 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding
)
578 "disable-webrtc-hw-encoding",
579 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME
,
580 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION
,
581 kOsAndroid
| kOsCrOS
,
582 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding
)
585 "enable-webrtc-stun-origin",
586 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_NAME
,
587 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_DESCRIPTION
,
589 SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin
)
592 #if defined(OS_ANDROID)
595 IDS_FLAGS_DISABLE_WEBAUDIO_NAME
,
596 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION
,
598 SINGLE_VALUE_TYPE(switches::kDisableWebAudio
)
601 // Native client is compiled out when DISABLE_NACL is defined.
602 #if !defined(DISABLE_NACL)
604 "enable-nacl", // FLAGS:RECORD_UMA
605 IDS_FLAGS_ENABLE_NACL_NAME
,
606 IDS_FLAGS_ENABLE_NACL_DESCRIPTION
,
608 SINGLE_VALUE_TYPE(switches::kEnableNaCl
)
611 "enable-nacl-debug", // FLAGS:RECORD_UMA
612 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME
,
613 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION
,
615 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug
)
618 "nacl-debug-mask", // FLAGS:RECORD_UMA
619 IDS_FLAGS_NACL_DEBUG_MASK_NAME
,
620 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION
,
622 MULTI_VALUE_TYPE(kNaClDebugMaskChoices
)
625 #if defined(ENABLE_EXTENSIONS)
627 "extension-apis", // FLAGS:RECORD_UMA
628 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME
,
629 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION
,
631 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis
)
634 "extensions-on-chrome-urls",
635 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME
,
636 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION
,
638 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs
)
642 "enable-fast-unload",
643 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME
,
644 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION
,
646 SINGLE_VALUE_TYPE(switches::kEnableFastUnload
)
648 #if defined(ENABLE_EXTENSIONS)
650 "enable-app-window-controls",
651 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME
,
652 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION
,
654 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls
)
658 "disable-hyperlink-auditing",
659 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME
,
660 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION
,
662 SINGLE_VALUE_TYPE(switches::kNoPings
)
664 #if defined(OS_ANDROID)
667 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH
,
668 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION
,
670 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch
,
671 switches::kDisableContextualSearch
)
675 "show-autofill-type-predictions",
676 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME
,
677 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION
,
679 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions
)
682 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
683 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME
,
684 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION
,
685 // Can't expose the switch unless the code is compiled in.
686 // On by default for the Mac (different implementation in WebKit).
688 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling
)
690 #if defined(USE_AURA) || defined(OS_LINUX)
692 "overlay-scrollbars",
693 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME
,
694 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION
,
695 // Uses the system preference on Mac (a different implementation).
696 // On Android, this is always enabled.
697 kOsLinux
| kOsCrOS
| kOsWin
,
698 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar
,
699 switches::kDisableOverlayScrollbar
)
704 IDS_FLAGS_ENABLE_PANELS_NAME
,
705 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION
,
707 SINGLE_VALUE_TYPE(switches::kEnablePanels
)
710 // See http://crbug.com/120416 for how to remove this flag.
711 "save-page-as-mhtml", // FLAGS:RECORD_UMA
712 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME
,
713 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION
,
714 kOsMac
| kOsWin
| kOsLinux
,
715 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML
)
719 IDS_FLAGS_ENABLE_QUIC_NAME
,
720 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION
,
722 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic
,
723 switches::kDisableQuic
)
727 IDS_FLAGS_ENABLE_SPDY4_NAME
,
728 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION
,
730 SINGLE_VALUE_TYPE(switches::kEnableSpdy4
)
733 "disable-media-source",
734 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME
,
735 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION
,
737 SINGLE_VALUE_TYPE(switches::kDisableMediaSource
)
740 "disable-encrypted-media",
741 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME
,
742 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION
,
744 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia
)
747 "disable-prefixed-encrypted-media",
748 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME
,
749 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION
,
751 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia
)
753 #if defined(OS_ANDROID)
755 "disable-infobar-for-protected-media-identifier",
756 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME
,
757 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION
,
759 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier
)
761 #endif // defined(OS_ANDROID)
763 "disable-javascript-harmony-shipping",
764 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_NAME
,
765 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_DESCRIPTION
,
767 SINGLE_VALUE_TYPE(switches::kDisableJavaScriptHarmonyShipping
)
770 "enable-javascript-harmony",
771 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME
,
772 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION
,
774 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony
)
777 "disable-software-rasterizer",
778 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME
,
779 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION
,
780 #if defined(ENABLE_SWIFTSHADER)
785 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer
)
788 "enable-gpu-rasterization",
789 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME
,
790 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION
,
792 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices
)
795 "gpu-rasterization-msaa-sample-count",
796 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_NAME
,
797 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_DESCRIPTION
,
799 MULTI_VALUE_TYPE(kGpuRasterizationMSAASampleCountChoices
)
802 "enable-slimming-paint",
803 IDS_FLAGS_ENABLE_SLIMMING_PAINT_NAME
,
804 IDS_FLAGS_ENABLE_SLIMMING_PAINT_DESCRIPTION
,
806 SINGLE_VALUE_TYPE(switches::kEnableSlimmingPaint
)
809 "enable-experimental-web-platform-features",
810 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME
,
811 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION
,
813 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures
)
816 "disable-ntp-other-sessions-menu",
817 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME
,
818 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION
,
820 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu
)
823 "enable-devtools-experiments",
824 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME
,
825 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION
,
827 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments
)
830 "silent-debugger-extension-api",
831 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME
,
832 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION
,
834 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI
)
836 #if defined(ENABLE_SPELLCHECK)
838 "spellcheck-autocorrect",
839 IDS_FLAGS_SPELLCHECK_AUTOCORRECT
,
840 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION
,
841 kOsWin
| kOsLinux
| kOsCrOS
,
842 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect
)
846 "enable-scroll-prediction",
847 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME
,
848 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION
,
850 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction
)
854 IDS_TOUCH_EVENTS_NAME
,
855 IDS_TOUCH_EVENTS_DESCRIPTION
,
857 MULTI_VALUE_TYPE(kTouchEventsChoices
)
860 "disable-touch-adjustment",
861 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME
,
862 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION
,
863 kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
,
864 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment
)
866 #if defined(OS_CHROMEOS)
868 "network-portal-notification",
869 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME
,
870 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION
,
872 ENABLE_DISABLE_VALUE_TYPE(
873 chromeos::switches::kEnableNetworkPortalNotification
,
874 chromeos::switches::kDisableNetworkPortalNotification
)
878 "enable-download-resumption",
879 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME
,
880 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION
,
882 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption
)
885 "enable-download-notification",
886 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_NAME
,
887 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_DESCRIPTION
,
889 SINGLE_VALUE_TYPE(switches::kEnableDownloadNotification
)
891 #if defined(ENABLE_PLUGINS)
893 "allow-nacl-socket-api",
894 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME
,
895 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION
,
897 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI
, "*")
900 #if defined(OS_CHROMEOS)
902 "allow-touchpad-three-finger-click",
903 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME
,
904 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION
,
906 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick
)
909 "disable-easy-unlock",
910 IDS_FLAGS_DISABLE_EASY_UNLOCK_NAME
,
911 IDS_FLAGS_DISABLE_EASY_UNLOCK_DESCRIPTION
,
913 SINGLE_VALUE_TYPE(proximity_auth::switches::kDisableEasyUnlock
)
916 "enable-easy-unlock-proximity-detection",
917 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME
,
918 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION
,
920 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection
)
925 "disable-minimize-on-second-launcher-item-click",
926 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME
,
927 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION
,
929 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick
)
933 IDS_FLAGS_SHOW_TOUCH_HUD_NAME
,
934 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION
,
936 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud
)
940 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME
,
941 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION
,
942 kOsLinux
| kOsWin
| kOsCrOS
,
943 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch
, switches::kDisablePinch
),
945 #endif // defined(USE_ASH)
947 "enable-pinch-virtual-viewport",
948 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME
,
949 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION
,
950 kOsLinux
| kOsWin
| kOsCrOS
| kOsAndroid
,
951 ENABLE_DISABLE_VALUE_TYPE(
952 cc::switches::kEnablePinchVirtualViewport
,
953 cc::switches::kDisablePinchVirtualViewport
),
956 "enable-viewport-meta",
957 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME
,
958 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION
,
959 kOsLinux
| kOsWin
| kOsCrOS
| kOsMac
,
960 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta
),
962 #if defined(OS_CHROMEOS)
964 "disable-boot-animation",
965 IDS_FLAGS_DISABLE_BOOT_ANIMATION
,
966 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION
,
968 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation
),
971 "enable-video-player-chromecast-support",
972 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME
,
973 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION
,
975 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport
)
978 "disable-office-editing-component-app",
979 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME
,
980 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION
,
982 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp
),
985 "disable-display-color-calibration",
986 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME
,
987 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION
,
989 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration
),
992 "ash-disable-screen-orientation-lock",
993 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME
,
994 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION
,
996 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock
),
998 #endif // defined(OS_CHROMEOS)
999 { "disable-accelerated-video-decode",
1000 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME
,
1001 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION
,
1002 kOsMac
| kOsWin
| kOsCrOS
,
1003 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode
),
1005 #if defined(USE_ASH)
1007 "ash-debug-shortcuts",
1008 IDS_FLAGS_DEBUG_SHORTCUTS_NAME
,
1009 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION
,
1011 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts
),
1014 "ash-disable-maximize-mode-window-backdrop",
1015 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME
,
1016 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_DESCRIPTION
,
1018 SINGLE_VALUE_TYPE(ash::switches::kAshDisableMaximizeModeWindowBackdrop
),
1020 { "ash-enable-touch-view-testing",
1021 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME
,
1022 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION
,
1024 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting
),
1027 "disable-touch-feedback",
1028 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME
,
1029 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION
,
1031 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback
),
1033 { "ash-enable-mirrored-screen",
1034 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME
,
1035 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION
,
1037 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen
),
1040 "ash-enable-screen-rotation-animations",
1041 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_NAME
,
1042 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_DESCRIPTION
,
1044 MULTI_VALUE_TYPE(kAshScreenRotationAnimationChoices
)
1046 #endif // defined(USE_ASH)
1047 #if defined(OS_CHROMEOS)
1049 "enable-carrier-switching",
1050 IDS_FLAGS_ENABLE_CARRIER_SWITCHING
,
1051 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION
,
1053 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching
)
1056 "disable-cloud-import",
1057 IDS_FLAGS_DISABLE_CLOUD_IMPORT
,
1058 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION
,
1060 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport
)
1063 "enable-request-tablet-site",
1064 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME
,
1065 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION
,
1067 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite
)
1071 "debug-packed-apps",
1072 IDS_FLAGS_DEBUG_PACKED_APP_NAME
,
1073 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION
,
1075 SINGLE_VALUE_TYPE(switches::kDebugPackedApps
)
1078 "enable-password-generation",
1079 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME
,
1080 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION
,
1081 kOsWin
| kOsLinux
| kOsCrOS
| kOsMac
| kOsAndroid
,
1082 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration
,
1083 autofill::switches::kDisablePasswordGeneration
)
1086 "enable-automatic-password-saving",
1087 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME
,
1088 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION
,
1091 password_manager::switches::kEnableAutomaticPasswordSaving
)
1094 "password-manager-reauthentication",
1095 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME
,
1096 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION
,
1098 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication
)
1101 "enable-password-link",
1102 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME
,
1103 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION
,
1104 kOsAndroid
| kOsDesktop
,
1105 ENABLE_DISABLE_VALUE_TYPE(
1106 password_manager::switches::kEnablePasswordLink
,
1107 password_manager::switches::kDisablePasswordLink
)
1110 "enable-password-save-in-page-navigation",
1111 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_NAME
,
1112 IDS_FLAGS_ENABLE_SAVE_PASSOWRD_ON_IN_PAGE_NAVIGATION_DESCRIPTION
,
1115 autofill::switches::kEnablePasswordSaveOnInPageNavigation
)
1118 "enable-affiliation-based-matching",
1119 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME
,
1120 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION
,
1121 kOsWin
| kOsLinux
| kOsCrOS
| kOsMac
| kOsAndroid
,
1122 ENABLE_DISABLE_VALUE_TYPE(
1123 password_manager::switches::kEnableAffiliationBasedMatching
,
1124 password_manager::switches::kDisableAffiliationBasedMatching
)
1127 "enable-deferred-image-decoding",
1128 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME
,
1129 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION
,
1130 kOsMac
| kOsLinux
| kOsCrOS
,
1131 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding
)
1134 "wallet-service-use-sandbox",
1135 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME
,
1136 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION
,
1137 kOsAndroid
| kOsDesktop
,
1138 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1139 autofill::switches::kWalletServiceUseSandbox
, "1",
1140 autofill::switches::kWalletServiceUseSandbox
, "0")
1142 #if defined(USE_AURA)
1144 "overscroll-history-navigation",
1145 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME
,
1146 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION
,
1148 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices
)
1152 "scroll-end-effect",
1153 IDS_FLAGS_SCROLL_END_EFFECT_NAME
,
1154 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION
,
1156 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1157 switches::kScrollEndEffect
, "1",
1158 switches::kScrollEndEffect
, "0")
1162 IDS_FLAGS_ENABLE_ICON_NTP_NAME
,
1163 IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION
,
1164 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1165 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIconNtp
,
1166 switches::kDisableIconNtp
)
1169 "enable-touch-drag-drop",
1170 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME
,
1171 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION
,
1173 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop
,
1174 switches::kDisableTouchDragDrop
)
1177 "enable-touch-editing",
1178 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME
,
1179 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION
,
1180 kOsCrOS
| kOsWin
| kOsLinux
,
1181 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing
,
1182 switches::kDisableTouchEditing
)
1185 "enable-stale-while-revalidate",
1186 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME
,
1187 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION
,
1189 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate
)
1192 "enable-suggestions-service",
1193 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME
,
1194 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION
,
1195 kOsAndroid
| kOsCrOS
,
1196 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService
,
1197 switches::kDisableSuggestionsService
)
1200 "enable-supervised-user-blacklist",
1201 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME
,
1202 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION
,
1203 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1204 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist
,
1205 switches::kDisableSupervisedUserBlacklist
)
1208 "enable-supervised-user-managed-bookmarks-folder",
1209 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME
,
1210 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION
,
1211 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1212 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder
)
1215 "enable-supervised-user-safesites",
1216 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_NAME
,
1217 IDS_FLAGS_ENABLE_SUPERVISED_USER_SAFESITES_DESCRIPTION
,
1218 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1219 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserSafeSites
,
1220 switches::kDisableSupervisedUserSafeSites
)
1222 #if defined(ENABLE_APP_LIST)
1224 "enable-sync-app-list",
1225 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME
,
1226 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION
,
1228 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList
,
1229 app_list::switches::kDisableSyncAppList
)
1232 #if defined(OS_MACOSX)
1234 "enable-avfoundation",
1235 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME
,
1236 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION
,
1238 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation
,
1239 switches::kForceQTKit
)
1244 IDS_FLAGS_LCD_TEXT_NAME
,
1245 IDS_FLAGS_LCD_TEXT_DESCRIPTION
,
1247 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText
,
1248 switches::kDisableLCDText
)
1250 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1252 "delegated-renderer",
1253 IDS_FLAGS_DELEGATED_RENDERER_NAME
,
1254 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION
,
1255 kOsAndroid
, // TODO(ccameron) Add mac support soon.
1256 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer
,
1257 switches::kDisableDelegatedRenderer
)
1261 "max-tiles-for-interest-area",
1262 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME
,
1263 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION
,
1265 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices
)
1268 "enable-offer-store-unmasked-wallet-cards",
1269 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS
,
1270 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION
,
1272 ENABLE_DISABLE_VALUE_TYPE(
1273 autofill::switches::kEnableOfferStoreUnmaskedWalletCards
,
1274 autofill::switches::kDisableOfferStoreUnmaskedWalletCards
)
1277 "enable-offline-auto-reload",
1278 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME
,
1279 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION
,
1281 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload
,
1282 switches::kDisableOfflineAutoReload
)
1285 "enable-offline-auto-reload-visible-only",
1286 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME
,
1287 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION
,
1289 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly
,
1290 switches::kDisableOfflineAutoReloadVisibleOnly
)
1294 IDS_FLAGS_SHOW_SAVED_COPY_NAME
,
1295 IDS_FLAGS_SHOW_SAVED_COPY_DESCRIPTION
,
1297 MULTI_VALUE_TYPE(kShowSavedCopyChoices
)
1300 "default-tile-width",
1301 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME
,
1302 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION
,
1304 MULTI_VALUE_TYPE(kDefaultTileWidthChoices
)
1307 "default-tile-height",
1308 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME
,
1309 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION
,
1311 MULTI_VALUE_TYPE(kDefaultTileHeightChoices
)
1313 #if defined(OS_ANDROID)
1315 "disable-gesture-requirement-for-media-playback",
1316 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME
,
1317 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION
,
1319 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback
)
1322 #if defined(OS_CHROMEOS)
1324 "enable-virtual-keyboard",
1325 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME
,
1326 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION
,
1328 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard
)
1331 "enable-virtual-keyboard-overscroll",
1332 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME
,
1333 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION
,
1335 ENABLE_DISABLE_VALUE_TYPE(
1336 keyboard::switches::kEnableVirtualKeyboardOverscroll
,
1337 keyboard::switches::kDisableVirtualKeyboardOverscroll
)
1340 "enable-swipe-selection",
1341 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME
,
1342 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION
,
1344 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection
)
1347 "enable-input-view",
1348 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME
,
1349 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION
,
1351 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView
,
1352 keyboard::switches::kDisableInputView
)
1355 "enable-new-korean-ime",
1356 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_NAME
,
1357 IDS_FLAGS_ENABLE_NEW_KOREAN_IME_DESCRIPTION
,
1359 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewKoreanIme
)
1362 "disable-new-md-input-view",
1363 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_NAME
,
1364 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_DESCRIPTION
,
1366 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewMDInputView
)
1369 "enable-physical-keyboard-autocorrect",
1370 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME
,
1371 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION
,
1373 ENABLE_DISABLE_VALUE_TYPE(
1374 chromeos::switches::kEnablePhysicalKeyboardAutocorrect
,
1375 chromeos::switches::kDisablePhysicalKeyboardAutocorrect
)
1378 "disable-voice-input",
1379 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME
,
1380 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION
,
1382 SINGLE_VALUE_TYPE(chromeos::switches::kDisableVoiceInput
)
1385 "enable-experimental-input-view-features",
1386 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME
,
1387 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION
,
1389 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures
)
1392 "enable-gesture-typing",
1393 IDS_FLAGS_ENABLE_GESTURE_TYPING_NAME
,
1394 IDS_FLAGS_ENABLE_GESTURE_TYPING_DESCRIPTION
,
1396 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureTyping
)
1399 "enable-gesture-deletion",
1400 IDS_FLAGS_ENABLE_GESTURE_DELETION_NAME
,
1401 IDS_FLAGS_ENABLE_GESTURE_DELETION_DESCRIPTION
,
1403 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureDeletion
)
1406 "enable-gesture-selection",
1407 IDS_FLAGS_ENABLE_GESTURE_SELECTION_NAME
,
1408 IDS_FLAGS_ENABLE_GESTURE_SELECTION_DESCRIPTION
,
1410 SINGLE_VALUE_TYPE(keyboard::switches::kEnableGestureSelection
)
1413 "disable-smart-virtual-keyboard",
1414 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_NAME
,
1415 IDS_FLAGS_DISABLE_SMART_VIRTUAL_KEYBOARD_DESCRIPTION
,
1417 SINGLE_VALUE_TYPE(keyboard::switches::kDisableSmartVirtualKeyboard
)
1421 "enable-simple-cache-backend",
1422 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME
,
1423 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION
,
1424 kOsWin
| kOsMac
| kOsLinux
| kOsCrOS
,
1425 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices
)
1428 "enable-tcp-fast-open",
1429 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME
,
1430 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION
,
1431 kOsLinux
| kOsCrOS
| kOsAndroid
,
1432 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen
)
1434 #if defined(ENABLE_SERVICE_DISCOVERY)
1436 "device-discovery-notifications",
1437 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME
,
1438 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION
,
1440 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications
,
1441 switches::kDisableDeviceDiscoveryNotifications
)
1444 "enable-print-preview-register-promos",
1445 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME
,
1446 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION
,
1448 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos
)
1450 #endif // ENABLE_SERVICE_DISCOVERY
1453 "enable-cloud-print-xps",
1454 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME
,
1455 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION
,
1457 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps
)
1460 #if defined(USE_AURA)
1462 "tab-capture-upscale-quality",
1463 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME
,
1464 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION
,
1466 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices
)
1469 "tab-capture-downscale-quality",
1470 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME
,
1471 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION
,
1473 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices
)
1476 #if defined(TOOLKIT_VIEWS)
1478 "disable-hide-inactive-stacked-tab-close-buttons",
1479 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_NAME
,
1480 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_DESCRIPTION
,
1481 kOsCrOS
| kOsWin
| kOsLinux
,
1482 SINGLE_VALUE_TYPE(switches::kDisableHideInactiveStackedTabCloseButtons
)
1485 #if defined(ENABLE_SPELLCHECK)
1487 "enable-spelling-feedback-field-trial",
1488 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME
,
1489 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION
,
1491 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial
)
1495 "enable-webgl-draft-extensions",
1496 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME
,
1497 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION
,
1499 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions
)
1502 "enable-new-profile-management",
1503 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME
,
1504 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION
,
1505 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1506 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement
,
1507 switches::kDisableNewProfileManagement
)
1510 "enable-account-consistency",
1511 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME
,
1512 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION
,
1513 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
1514 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency
,
1515 switches::kDisableAccountConsistency
)
1518 "enable-fast-user-switching",
1519 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME
,
1520 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION
,
1521 kOsMac
| kOsWin
| kOsLinux
,
1522 SINGLE_VALUE_TYPE(switches::kFastUserSwitching
)
1525 "enable-new-avatar-menu",
1526 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME
,
1527 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION
,
1528 kOsMac
| kOsWin
| kOsLinux
,
1529 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu
,
1530 switches::kDisableNewAvatarMenu
)
1533 "enable-iframe-based-signin",
1534 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME
,
1535 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION
,
1536 kOsMac
| kOsWin
| kOsLinux
,
1537 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin
)
1540 "enable-google-profile-info",
1541 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME
,
1542 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION
,
1543 kOsMac
| kOsWin
| kOsLinux
,
1544 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo
)
1547 "reset-app-list-install-state",
1548 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME
,
1549 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION
,
1550 kOsMac
| kOsWin
| kOsLinux
,
1551 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState
)
1553 #if defined(ENABLE_APP_LIST)
1554 #if defined(OS_LINUX)
1556 // This is compiled out on non-Linux platforms because otherwise it would be
1557 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1558 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1560 IDS_FLAGS_ENABLE_APP_LIST_NAME
,
1561 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION
,
1563 SINGLE_VALUE_TYPE(switches::kEnableAppList
)
1566 #if defined(ENABLE_EXTENSIONS)
1568 "enable-surface-worker",
1569 IDS_FLAGS_ENABLE_SURFACE_WORKER_NAME
,
1570 IDS_FLAGS_ENABLE_SURFACE_WORKER_DESCRIPTION
,
1572 SINGLE_VALUE_TYPE(extensions::switches::kEnableSurfaceWorker
)
1576 "disable-drive-apps-in-app-list",
1577 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME
,
1578 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION
,
1580 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList
)
1583 #if defined(OS_ANDROID)
1585 "enable-accessibility-tab-switcher",
1586 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME
,
1587 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION
,
1589 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher
)
1592 // TODO(dmazzoni): remove this flag when native android accessibility
1593 // ships in the stable channel. http://crbug.com/356775
1594 "enable-accessibility-script-injection",
1595 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME
,
1596 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION
,
1598 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1599 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1604 IDS_FLAGS_ONE_COPY_NAME
,
1605 IDS_FLAGS_ONE_COPY_DESCRIPTION
,
1607 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy
,
1608 switches::kDisableOneCopy
)
1612 IDS_FLAGS_ZERO_COPY_NAME
,
1613 IDS_FLAGS_ZERO_COPY_DESCRIPTION
,
1615 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy
)
1617 #if defined(OS_CHROMEOS)
1619 "enable-first-run-ui-transitions",
1620 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME
,
1621 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION
,
1623 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions
)
1627 "disable-new-bookmark-apps",
1628 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME
,
1629 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION
,
1630 kOsWin
| kOsCrOS
| kOsLinux
| kOsMac
,
1631 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps
,
1632 switches::kDisableNewBookmarkApps
)
1634 #if defined(OS_MACOSX)
1636 "disable-hosted-app-shim-creation",
1637 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME
,
1638 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION
,
1640 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation
)
1643 "enable-hosted-app-quit-notification",
1644 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME
,
1645 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION
,
1647 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification
)
1651 "enable-ephemeral-apps-in-webstore",
1652 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME
,
1653 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION
,
1655 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore
)
1658 "enable-linkable-ephemeral-apps",
1659 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME
,
1660 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION
,
1662 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps
)
1665 "enable-service-worker-sync",
1666 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME
,
1667 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION
,
1669 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync
)
1671 #if defined(OS_ANDROID)
1673 "disable-click-delay",
1674 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME
,
1675 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION
,
1677 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1678 SINGLE_VALUE_TYPE("disable-click-delay")
1681 "disable-pull-to-refresh-effect",
1682 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME
,
1683 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION
,
1685 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect
)
1688 #if defined(OS_MACOSX)
1690 "enable-translate-new-ux",
1691 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME
,
1692 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION
,
1694 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX
)
1697 #if defined(TOOLKIT_VIEWS)
1699 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1700 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME
,
1701 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION
,
1702 kOsCrOS
| kOsWin
| kOsLinux
,
1703 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting
)
1706 "enable-link-disambiguation-popup",
1707 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME
,
1708 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION
,
1710 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup
)
1713 #if defined(ENABLE_EXTENSIONS)
1715 "enable-apps-show-on-first-paint",
1716 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME
,
1717 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION
,
1719 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint
)
1723 "enhanced-bookmarks-experiment",
1724 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME
,
1725 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION
,
1726 kOsDesktop
| kOsAndroid
,
1727 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1728 switches::kEnhancedBookmarksExperiment
, "1",
1729 switches::kEnhancedBookmarksExperiment
, "0")
1731 #if defined(OS_ANDROID)
1733 "enable-zero-suggest-experiment",
1734 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME
,
1735 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION
,
1737 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices
)
1740 "enable-reader-mode-toolbar-icon",
1741 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME
,
1742 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION
,
1744 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon
)
1747 "enable-dom-distiller-button-animation",
1748 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION
,
1749 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION_DESCRIPTION
,
1751 SINGLE_VALUE_TYPE(switches::kEnableDomDistillerButtonAnimation
)
1755 "num-raster-threads",
1756 IDS_FLAGS_NUM_RASTER_THREADS_NAME
,
1757 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION
,
1759 MULTI_VALUE_TYPE(kNumRasterThreadsChoices
)
1762 "enable-single-click-autofill",
1763 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME
,
1764 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION
,
1765 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
| kOsAndroid
,
1766 ENABLE_DISABLE_VALUE_TYPE(
1767 autofill::switches::kEnableSingleClickAutofill
,
1768 autofill::switches::kDisableSingleClickAutofill
)
1771 "enable-permissions-bubbles",
1772 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME
,
1773 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION
,
1774 kOsCrOS
| kOsMac
| kOsWin
| kOsLinux
,
1775 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles
,
1776 switches::kDisablePermissionsBubbles
)
1779 "enable-session-crashed-bubble",
1780 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME
,
1781 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION
,
1783 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble
,
1784 switches::kDisableSessionCrashedBubble
)
1787 "enable-out-of-process-pdf",
1788 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME
,
1789 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION
,
1791 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf
,
1792 switches::kDisableOutOfProcessPdf
)
1795 "enable-pdf-material-ui",
1796 IDS_FLAGS_PDF_MATERIAL_UI_NAME
,
1797 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION
,
1799 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI
,
1800 switches::kDisablePdfMaterialUI
)
1803 "disable-cast-streaming-hw-encoding",
1804 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME
,
1805 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION
,
1807 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding
)
1809 #if defined(OS_ANDROID)
1812 IDS_FLAGS_DISABLE_CAST_NAME
,
1813 IDS_FLAGS_DISABLE_CAST_DESCRIPTION
,
1815 SINGLE_VALUE_TYPE(switches::kDisableCast
)
1818 "prefetch-search-results",
1819 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME
,
1820 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION
,
1822 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults
)
1825 #if defined(ENABLE_APP_LIST)
1827 "enable-experimental-app-list",
1828 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME
,
1829 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION
,
1830 kOsWin
| kOsLinux
| kOsCrOS
,
1831 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList
,
1832 app_list::switches::kDisableExperimentalAppList
)
1835 "enable-centered-app-list",
1836 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME
,
1837 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION
,
1838 kOsWin
| kOsLinux
| kOsCrOS
,
1839 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList
)
1843 "disable-threaded-scrolling",
1844 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME
,
1845 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION
,
1846 kOsWin
| kOsLinux
| kOsCrOS
| kOsAndroid
| kOsMac
,
1847 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling
)
1850 "bleeding-edge-renderer-mode",
1851 IDS_FLAGS_BLEEDING_RENDERER_NAME
,
1852 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION
,
1854 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths
)
1857 "enable-settings-window",
1858 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME
,
1859 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION
,
1861 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow
,
1862 switches::kDisableSettingsWindow
)
1864 #if defined(OS_ANDROID)
1866 "enable-instant-search-clicks",
1867 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME
,
1868 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION
,
1870 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks
)
1874 "enable-save-password-bubble",
1875 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME
,
1876 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION
,
1877 kOsWin
| kOsLinux
| kOsCrOS
| kOsMac
,
1878 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble
,
1879 switches::kDisableSavePasswordBubble
)
1882 "enable-apps-file-associations",
1883 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME
,
1884 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION
,
1886 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations
)
1888 #if defined(OS_ANDROID)
1890 "enable-embeddedsearch-api",
1891 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME
,
1892 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION
,
1894 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI
)
1897 "enable-app-install-alerts",
1898 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME
,
1899 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION
,
1901 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts
)
1905 "distance-field-text",
1906 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME
,
1907 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION
,
1909 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText
,
1910 switches::kDisableDistanceFieldText
)
1913 "extension-content-verification",
1914 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME
,
1915 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION
,
1917 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices
)
1919 #if defined(USE_AURA)
1921 "text-input-focus-manager",
1922 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME
,
1923 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION
,
1924 kOsCrOS
| kOsLinux
| kOsWin
,
1925 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager
,
1926 switches::kDisableTextInputFocusManager
)
1929 #if defined(ENABLE_EXTENSIONS)
1931 "extension-active-script-permission",
1932 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME
,
1933 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION
,
1935 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction
)
1939 "answers-in-suggest",
1940 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME
,
1941 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION
,
1942 kOsAndroid
| kOsWin
| kOsLinux
| kOsCrOS
,
1943 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest
,
1944 switches::kDisableAnswersInSuggest
)
1946 #if defined(OS_ANDROID)
1948 "enable-data-reduction-proxy-dev",
1949 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME
,
1950 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION
,
1952 ENABLE_DISABLE_VALUE_TYPE(
1953 data_reduction_proxy::switches::kEnableDataReductionProxyDev
,
1954 data_reduction_proxy::switches::kDisableDataReductionProxyDev
)
1957 "enable-data-reduction-proxy-alt",
1958 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME
,
1959 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION
,
1962 data_reduction_proxy::switches::kEnableDataReductionProxyAlt
)
1966 "enable-hotword-hardware",
1967 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME
,
1968 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION
,
1970 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware
)
1972 #if defined(ENABLE_EXTENSIONS)
1974 "enable-embedded-extension-options",
1975 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME
,
1976 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION
,
1978 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions
)
1981 #if defined(USE_ASH)
1983 "enable-web-app-frame",
1984 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME
,
1985 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION
,
1987 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame
)
1991 "enable-website-settings-manager",
1992 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME
,
1993 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION
,
1995 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager
)
1998 "remember-cert-error-decisions",
1999 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME
,
2000 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION
,
2002 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices
)
2005 "enable-drop-sync-credential",
2006 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME
,
2007 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION
,
2009 ENABLE_DISABLE_VALUE_TYPE(
2010 password_manager::switches::kEnableDropSyncCredential
,
2011 password_manager::switches::kDisableDropSyncCredential
)
2013 #if defined(ENABLE_EXTENSIONS)
2015 "enable-extension-action-redesign",
2016 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME
,
2017 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION
,
2019 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign
)
2023 "autofill-sync-credential",
2024 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME
,
2025 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION
,
2027 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices
)
2029 #if !defined(OS_ANDROID)
2031 "enable-message-center-always-scroll-up-upon-notification-removal",
2032 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME
,
2033 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION
,
2036 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval
)
2039 "enable-md-settings",
2040 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME
,
2041 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION
,
2044 switches::kEnableMaterialDesignSettings
)
2047 #if defined(OS_CHROMEOS)
2049 "disable-memory-pressure-chromeos",
2050 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_NAME
,
2051 IDS_FLAGS_DISABLE_MEMORY_PRESSURE_DESCRIPTION
,
2053 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMemoryPressureSystemChromeOS
)
2056 "memory-pressure-thresholds",
2057 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME
,
2058 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION
,
2060 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices
)
2064 IDS_FLAGS_WAKE_ON_PACKETS_NAME
,
2065 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION
,
2067 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets
)
2069 #endif // OS_CHROMEOS
2071 "enable-tab-audio-muting",
2072 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME
,
2073 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION
,
2075 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting
)
2078 "enable-credential-manager-api",
2079 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME
,
2080 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION
,
2082 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI
)
2085 "reduced-referrer-granularity",
2086 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME
,
2087 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION
,
2089 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity
)
2091 #if defined(ENABLE_PLUGINS)
2093 "enable-plugin-power-saver",
2094 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME
,
2095 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION
,
2097 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePluginPowerSaver
,
2098 switches::kDisablePluginPowerSaver
)
2101 #if defined(OS_CHROMEOS)
2103 "disable-new-zip-unpacker",
2104 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME
,
2105 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION
,
2107 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker
)
2109 #endif // defined(OS_CHROMEOS)
2112 IDS_FLAGS_SSL_VERSION_MIN_NAME
,
2113 IDS_FLAGS_SSL_VERSION_MIN_DESCRIPTION
,
2115 MULTI_VALUE_TYPE(kSSLVersionMinChoices
)
2118 "enable-credit-card-scan",
2119 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME
,
2120 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION
,
2122 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan
,
2123 autofill::switches::kDisableCreditCardScan
)
2125 #if defined(OS_CHROMEOS)
2127 "disable-captive-portal-bypass-proxy",
2128 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME
,
2129 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION
,
2131 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCaptivePortalBypassProxy
)
2134 "disable-roboto-font-ui",
2135 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_NAME
,
2136 IDS_FLAGS_DISABLE_ROBOTO_FONT_UI_DESCRIPTION
,
2138 SINGLE_VALUE_TYPE(switches::kDisableRobotoFontUI
)
2140 #endif // defined(OS_CHROMEOS)
2141 #if defined(OS_ANDROID)
2143 "enable-seccomp-filter-sandbox",
2144 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME
,
2145 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION
,
2147 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox
)
2151 "enable-touch-hover",
2152 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME
,
2153 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION
,
2155 SINGLE_VALUE_TYPE("enable-touch-hover")
2158 "enable-fill-on-account-select",
2159 IDS_FILL_ON_ACCOUNT_SELECT_NAME
,
2160 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION
,
2162 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices
)
2164 #if defined(OS_CHROMEOS)
2166 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA
2167 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME
,
2168 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION
,
2170 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync
)
2173 "enable-potentially-annoying-security-features",
2174 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME
,
2175 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION
,
2177 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures
)
2181 "enable-delay-agnostic-aec",
2182 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME
,
2183 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION
,
2185 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec
)
2188 "mark-non-secure-as", // FLAGS:RECORD_UMA
2189 IDS_MARK_NON_SECURE_AS_NAME
,
2190 IDS_MARK_NON_SECURE_AS_DESCRIPTION
,
2192 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices
)
2195 "enable-site-per-process",
2196 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME
,
2197 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION
,
2199 SINGLE_VALUE_TYPE(switches::kSitePerProcess
)
2201 #if defined(OS_MACOSX)
2203 "enable-harfbuzz-rendertext",
2204 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME
,
2205 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION
,
2207 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText
)
2209 #endif // defined(OS_MACOSX)
2210 #if defined(OS_CHROMEOS)
2212 "disable-timezone-tracking",
2213 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME
,
2214 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION
,
2216 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption
)
2219 "disable-webview-signin-flow",
2220 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_NAME
,
2221 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_DESCRIPTION
,
2223 SINGLE_VALUE_TYPE(chromeos::switches::kDisableWebviewSigninFlow
)
2225 #endif // defined(OS_CHROMEOS)
2227 "enable-data-reduction-proxy-lo-fi",
2228 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME
,
2229 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION
,
2231 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2232 kEnableDataReductionProxyLoFi
)
2235 "clear-data-reduction-proxy-data-savings",
2236 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME
,
2237 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION
,
2239 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2240 kClearDataReductionProxyDataSavings
)
2242 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2244 "enable-data-reduction-proxy-bypass-warnings",
2245 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME
,
2246 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION
,
2248 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2249 kEnableDataReductionProxyBypassWarning
)
2253 "allow-insecure-localhost",
2254 IDS_ALLOW_INSECURE_LOCALHOST
,
2255 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION
,
2257 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost
)
2260 "bypass-app-banner-engagement-checks",
2261 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME
,
2262 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION
,
2264 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks
)
2268 IDS_FLAGS_SYNC_SANDBOX_NAME
,
2269 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION
,
2271 SINGLE_VALUE_TYPE_AND_VALUE(
2272 switches::kSyncServiceURL
,
2273 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
2276 "enable-child-account-detection",
2277 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_NAME
,
2278 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_DESCRIPTION
,
2279 kOsAndroid
| kOsMac
| kOsWin
| kOsLinux
| kOsCrOS
,
2280 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableChildAccountDetection
,
2281 switches::kDisableChildAccountDetection
)
2283 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
2285 "ozone-test-single-overlay-support",
2286 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY
,
2287 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION
,
2289 SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport
)
2291 #endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
2293 "v8-pac-mojo-out-of-process",
2294 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME
,
2295 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION
,
2297 SINGLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess
),
2299 #if defined(OS_CHROMEOS)
2301 "enable-firewall-hole-punching",
2302 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_NAME
,
2303 IDS_FLAGS_ENABLE_FIREWALL_HOLE_PUNCHING_DESCRIPTION
,
2305 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirewallHolePunching
)
2307 #endif // defined(OS_CHROMEOS)
2309 "enable-media-router",
2310 IDS_FLAGS_ENABLE_MEDIA_ROUTER_NAME
,
2311 IDS_FLAGS_ENABLE_MEDIA_ROUTER_DESCRIPTION
,
2313 SINGLE_VALUE_TYPE(switches::kEnableMediaRouter
)
2315 // Since kEnableLauncherSearchProviderApi is not available when app list is
2316 // disabled, flag guard enable-launcher-search-provider-api.
2317 #if defined(ENABLE_APP_LIST)
2319 "enable-launcher-search-provider-api",
2320 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API
,
2321 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API_DESCRIPTION
,
2323 SINGLE_VALUE_TYPE(app_list::switches::kEnableLauncherSearchProviderApi
)
2325 #endif // defined(ENABLE_APP_LIST)
2326 #if defined(OS_CHROMEOS)
2328 "enable-mtp-write-support",
2329 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_NAME
,
2330 IDS_FLAG_ENABLE_MTP_WRITE_SUPPORT_DESCRIPTION
,
2332 SINGLE_VALUE_TYPE(chromeos::switches::kEnableMtpWriteSupport
)
2334 #endif // defined(OS_CHROMEOS)
2335 #if defined(OS_CHROMEOS)
2337 "enable-datasaver-prompt",
2338 IDS_FLAGS_DATASAVER_PROMPT_NAME
,
2339 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION
,
2341 MULTI_VALUE_TYPE(kDataSaverPromptChoices
)
2343 #endif // defined(OS_CHROMEOS)
2344 // NOTE: Adding new command-line switches requires adding corresponding
2345 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2346 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2349 const Experiment
* experiments
= kExperiments
;
2350 size_t num_experiments
= arraysize(kExperiments
);
2352 // Stores and encapsulates the little state that about:flags has.
2355 FlagsState() : needs_restart_(false) {}
2356 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2357 base::CommandLine
* command_line
,
2358 SentinelsMode sentinels
);
2359 bool IsRestartNeededToCommitChanges();
2360 void SetExperimentEnabled(
2361 FlagsStorage
* flags_storage
,
2362 const std::string
& internal_name
,
2364 void RemoveFlagsSwitches(
2365 std::map
<std::string
, base::CommandLine::StringType
>* switch_list
);
2366 void ResetAllFlags(FlagsStorage
* flags_storage
);
2369 // Returns the singleton instance of this class
2370 static FlagsState
* GetInstance() {
2371 return Singleton
<FlagsState
>::get();
2375 bool needs_restart_
;
2376 std::map
<std::string
, std::string
> flags_switches_
;
2378 DISALLOW_COPY_AND_ASSIGN(FlagsState
);
2381 // Adds the internal names for the specified experiment to |names|.
2382 void AddInternalName(const Experiment
& e
, std::set
<std::string
>* names
) {
2383 if (e
.type
== Experiment::SINGLE_VALUE
) {
2384 names
->insert(e
.internal_name
);
2386 DCHECK(e
.type
== Experiment::MULTI_VALUE
||
2387 e
.type
== Experiment::ENABLE_DISABLE_VALUE
);
2388 for (int i
= 0; i
< e
.num_choices
; ++i
)
2389 names
->insert(e
.NameForChoice(i
));
2393 // Confirms that an experiment is valid, used in a DCHECK in
2394 // SanitizeList below.
2395 bool ValidateExperiment(const Experiment
& e
) {
2397 case Experiment::SINGLE_VALUE
:
2398 DCHECK_EQ(0, e
.num_choices
);
2401 case Experiment::MULTI_VALUE
:
2402 DCHECK_GT(e
.num_choices
, 0);
2404 DCHECK(e
.choices
[0].command_line_switch
);
2405 DCHECK_EQ('\0', e
.choices
[0].command_line_switch
[0]);
2407 case Experiment::ENABLE_DISABLE_VALUE
:
2408 DCHECK_EQ(3, e
.num_choices
);
2410 DCHECK(e
.command_line_switch
);
2411 DCHECK(e
.command_line_value
);
2412 DCHECK(e
.disable_command_line_switch
);
2413 DCHECK(e
.disable_command_line_value
);
2421 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2422 // unknown, to prevent this list to become very long as experiments are added
2424 void SanitizeList(FlagsStorage
* flags_storage
) {
2425 std::set
<std::string
> known_experiments
;
2426 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2427 DCHECK(ValidateExperiment(experiments
[i
]));
2428 AddInternalName(experiments
[i
], &known_experiments
);
2431 std::set
<std::string
> enabled_experiments
= flags_storage
->GetFlags();
2433 std::set
<std::string
> new_enabled_experiments
=
2434 base::STLSetIntersection
<std::set
<std::string
> >(
2435 known_experiments
, enabled_experiments
);
2437 if (new_enabled_experiments
!= enabled_experiments
)
2438 flags_storage
->SetFlags(new_enabled_experiments
);
2441 void GetSanitizedEnabledFlags(
2442 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
2443 SanitizeList(flags_storage
);
2444 *result
= flags_storage
->GetFlags();
2447 bool SkipConditionalExperiment(const Experiment
& experiment
,
2448 FlagsStorage
* flags_storage
) {
2449 #if defined(OS_ANDROID) || defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2450 chrome::VersionInfo::Channel channel
= chrome::VersionInfo::GetChannel();
2453 #if defined(OS_ANDROID)
2454 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2455 if (!strcmp("enable-data-reduction-proxy-dev", experiment
.internal_name
) &&
2456 channel
!= chrome::VersionInfo::CHANNEL_BETA
&&
2457 channel
!= chrome::VersionInfo::CHANNEL_DEV
) {
2460 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2461 if (!strcmp("enable-data-reduction-proxy-alt", experiment
.internal_name
) &&
2462 channel
!= chrome::VersionInfo::CHANNEL_DEV
) {
2465 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and
2466 // the Canary/Dev channel.
2467 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment
.internal_name
) &&
2468 channel
!= chrome::VersionInfo::CHANNEL_DEV
&&
2469 channel
!= chrome::VersionInfo::CHANNEL_CANARY
&&
2470 channel
!= chrome::VersionInfo::CHANNEL_UNKNOWN
) {
2475 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2476 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2477 // builds and Canary/Dev channel.
2478 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2479 experiment
.internal_name
) &&
2480 channel
!= chrome::VersionInfo::CHANNEL_UNKNOWN
&&
2481 channel
!= chrome::VersionInfo::CHANNEL_CANARY
&&
2482 channel
!= chrome::VersionInfo::CHANNEL_DEV
) {
2491 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2492 // enabled on the current platform.
2493 void GetSanitizedEnabledFlagsForCurrentPlatform(
2494 FlagsStorage
* flags_storage
, std::set
<std::string
>* result
) {
2495 GetSanitizedEnabledFlags(flags_storage
, result
);
2497 // Filter out any experiments that aren't enabled on the current platform. We
2498 // don't remove these from prefs else syncing to a platform with a different
2499 // set of experiments would be lossy.
2500 std::set
<std::string
> platform_experiments
;
2501 int current_platform
= GetCurrentPlatform();
2502 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2503 if (experiments
[i
].supported_platforms
& current_platform
)
2504 AddInternalName(experiments
[i
], &platform_experiments
);
2505 #if defined(OS_CHROMEOS)
2506 if (experiments
[i
].supported_platforms
& kOsCrOSOwnerOnly
)
2507 AddInternalName(experiments
[i
], &platform_experiments
);
2511 std::set
<std::string
> new_enabled_experiments
=
2512 base::STLSetIntersection
<std::set
<std::string
> >(
2513 platform_experiments
, *result
);
2515 result
->swap(new_enabled_experiments
);
2518 // Returns the Value representing the choice data in the specified experiment.
2519 base::Value
* CreateChoiceData(
2520 const Experiment
& experiment
,
2521 const std::set
<std::string
>& enabled_experiments
) {
2522 DCHECK(experiment
.type
== Experiment::MULTI_VALUE
||
2523 experiment
.type
== Experiment::ENABLE_DISABLE_VALUE
);
2524 base::ListValue
* result
= new base::ListValue
;
2525 for (int i
= 0; i
< experiment
.num_choices
; ++i
) {
2526 base::DictionaryValue
* value
= new base::DictionaryValue
;
2527 const std::string name
= experiment
.NameForChoice(i
);
2528 value
->SetString("internal_name", name
);
2529 value
->SetString("description", experiment
.DescriptionForChoice(i
));
2530 value
->SetBoolean("selected", enabled_experiments
.count(name
) > 0);
2531 result
->Append(value
);
2538 std::string
Experiment::NameForChoice(int index
) const {
2539 DCHECK(type
== Experiment::MULTI_VALUE
||
2540 type
== Experiment::ENABLE_DISABLE_VALUE
);
2541 DCHECK_LT(index
, num_choices
);
2542 return std::string(internal_name
) + testing::kMultiSeparator
+
2543 base::IntToString(index
);
2546 base::string16
Experiment::DescriptionForChoice(int index
) const {
2547 DCHECK(type
== Experiment::MULTI_VALUE
||
2548 type
== Experiment::ENABLE_DISABLE_VALUE
);
2549 DCHECK_LT(index
, num_choices
);
2551 if (type
== Experiment::ENABLE_DISABLE_VALUE
) {
2552 const int kEnableDisableDescriptionIds
[] = {
2553 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT
,
2554 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED
,
2555 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED
,
2557 description_id
= kEnableDisableDescriptionIds
[index
];
2559 description_id
= choices
[index
].description_id
;
2561 return l10n_util::GetStringUTF16(description_id
);
2564 void ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2565 base::CommandLine
* command_line
,
2566 SentinelsMode sentinels
) {
2567 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage
,
2572 bool AreSwitchesIdenticalToCurrentCommandLine(
2573 const base::CommandLine
& new_cmdline
,
2574 const base::CommandLine
& active_cmdline
,
2575 std::set
<base::CommandLine::StringType
>* out_difference
) {
2576 std::set
<base::CommandLine::StringType
> new_flags
=
2577 ExtractFlagsFromCommandLine(new_cmdline
);
2578 std::set
<base::CommandLine::StringType
> active_flags
=
2579 ExtractFlagsFromCommandLine(active_cmdline
);
2581 bool result
= false;
2582 // Needed because std::equal doesn't check if the 2nd set is empty.
2583 if (new_flags
.size() == active_flags
.size()) {
2585 std::equal(new_flags
.begin(), new_flags
.end(), active_flags
.begin());
2588 if (out_difference
&& !result
) {
2589 std::set_symmetric_difference(
2592 active_flags
.begin(),
2594 std::inserter(*out_difference
, out_difference
->begin()));
2600 void GetFlagsExperimentsData(FlagsStorage
* flags_storage
,
2602 base::ListValue
* supported_experiments
,
2603 base::ListValue
* unsupported_experiments
) {
2604 std::set
<std::string
> enabled_experiments
;
2605 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2607 int current_platform
= GetCurrentPlatform();
2609 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2610 const Experiment
& experiment
= experiments
[i
];
2611 if (SkipConditionalExperiment(experiment
, flags_storage
))
2614 base::DictionaryValue
* data
= new base::DictionaryValue();
2615 data
->SetString("internal_name", experiment
.internal_name
);
2616 data
->SetString("name",
2617 l10n_util::GetStringUTF16(experiment
.visible_name_id
));
2618 data
->SetString("description",
2619 l10n_util::GetStringUTF16(
2620 experiment
.visible_description_id
));
2622 base::ListValue
* supported_platforms
= new base::ListValue();
2623 AddOsStrings(experiment
.supported_platforms
, supported_platforms
);
2624 data
->Set("supported_platforms", supported_platforms
);
2626 switch (experiment
.type
) {
2627 case Experiment::SINGLE_VALUE
:
2630 enabled_experiments
.count(experiment
.internal_name
) > 0);
2632 case Experiment::MULTI_VALUE
:
2633 case Experiment::ENABLE_DISABLE_VALUE
:
2634 data
->Set("choices", CreateChoiceData(experiment
, enabled_experiments
));
2640 bool supported
= (experiment
.supported_platforms
& current_platform
) != 0;
2641 #if defined(OS_CHROMEOS)
2642 if (access
== kOwnerAccessToFlags
&&
2643 (experiment
.supported_platforms
& kOsCrOSOwnerOnly
) != 0) {
2648 supported_experiments
->Append(data
);
2650 unsupported_experiments
->Append(data
);
2654 bool IsRestartNeededToCommitChanges() {
2655 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2658 void SetExperimentEnabled(FlagsStorage
* flags_storage
,
2659 const std::string
& internal_name
,
2661 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage
,
2662 internal_name
, enable
);
2665 void RemoveFlagsSwitches(
2666 std::map
<std::string
, base::CommandLine::StringType
>* switch_list
) {
2667 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list
);
2670 void ResetAllFlags(FlagsStorage
* flags_storage
) {
2671 FlagsState::GetInstance()->ResetAllFlags(flags_storage
);
2674 int GetCurrentPlatform() {
2675 #if defined(OS_MACOSX)
2677 #elif defined(OS_WIN)
2679 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2681 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2683 #elif defined(OS_ANDROID)
2686 #error Unknown platform
2690 void RecordUMAStatistics(FlagsStorage
* flags_storage
) {
2691 std::set
<std::string
> flags
= flags_storage
->GetFlags();
2692 for (const std::string
& flag
: flags
) {
2693 std::string
action("AboutFlags_");
2695 content::RecordComputedAction(action
);
2697 // Since flag metrics are recorded every startup, add a tick so that the
2698 // stats can be made meaningful.
2700 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2701 content::RecordAction(base::UserMetricsAction("StartupTick"));
2704 base::HistogramBase::Sample
GetSwitchUMAId(const std::string
& switch_name
) {
2705 return static_cast<base::HistogramBase::Sample
>(
2706 metrics::HashMetricName(switch_name
));
2709 void ReportCustomFlags(const std::string
& uma_histogram_hame
,
2710 const std::set
<std::string
>& command_line_difference
) {
2711 for (const std::string
& flag
: command_line_difference
) {
2712 int uma_id
= about_flags::testing::kBadSwitchFormatHistogramId
;
2713 if (StartsWithASCII(flag
, "--", true /* case_sensitive */)) {
2714 // Skip '--' before switch name.
2715 std::string
switch_name(flag
.substr(2));
2717 // Kill value, if any.
2718 const size_t value_pos
= switch_name
.find('=');
2719 if (value_pos
!= std::string::npos
)
2720 switch_name
.resize(value_pos
);
2722 uma_id
= GetSwitchUMAId(switch_name
);
2724 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2725 << "' has incorrect format.";
2727 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2728 << "' '" << flag
<< "', uma_id=" << uma_id
;
2730 // Sparse histogram macro does not cache the histogram, so it's safe
2731 // to use macro with non-static histogram name here.
2732 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame
, uma_id
);
2736 //////////////////////////////////////////////////////////////////////////////
2737 // FlagsState implementation.
2741 typedef std::map
<std::string
, std::pair
<std::string
, std::string
> >
2742 NameToSwitchAndValueMap
;
2744 void SetFlagToSwitchMapping(const std::string
& key
,
2745 const std::string
& switch_name
,
2746 const std::string
& switch_value
,
2747 NameToSwitchAndValueMap
* name_to_switch_map
) {
2748 DCHECK(name_to_switch_map
->end() == name_to_switch_map
->find(key
));
2749 (*name_to_switch_map
)[key
] = std::make_pair(switch_name
, switch_value
);
2752 void FlagsState::ConvertFlagsToSwitches(FlagsStorage
* flags_storage
,
2753 base::CommandLine
* command_line
,
2754 SentinelsMode sentinels
) {
2755 if (command_line
->HasSwitch(switches::kNoExperiments
))
2758 std::set
<std::string
> enabled_experiments
;
2760 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage
,
2761 &enabled_experiments
);
2763 NameToSwitchAndValueMap name_to_switch_map
;
2764 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2765 const Experiment
& e
= experiments
[i
];
2766 if (e
.type
== Experiment::SINGLE_VALUE
) {
2767 SetFlagToSwitchMapping(e
.internal_name
, e
.command_line_switch
,
2768 e
.command_line_value
, &name_to_switch_map
);
2769 } else if (e
.type
== Experiment::MULTI_VALUE
) {
2770 for (int j
= 0; j
< e
.num_choices
; ++j
) {
2771 SetFlagToSwitchMapping(e
.NameForChoice(j
),
2772 e
.choices
[j
].command_line_switch
,
2773 e
.choices
[j
].command_line_value
,
2774 &name_to_switch_map
);
2777 DCHECK_EQ(e
.type
, Experiment::ENABLE_DISABLE_VALUE
);
2778 SetFlagToSwitchMapping(e
.NameForChoice(0), std::string(), std::string(),
2779 &name_to_switch_map
);
2780 SetFlagToSwitchMapping(e
.NameForChoice(1), e
.command_line_switch
,
2781 e
.command_line_value
, &name_to_switch_map
);
2782 SetFlagToSwitchMapping(e
.NameForChoice(2), e
.disable_command_line_switch
,
2783 e
.disable_command_line_value
, &name_to_switch_map
);
2787 if (sentinels
== kAddSentinels
) {
2788 command_line
->AppendSwitch(switches::kFlagSwitchesBegin
);
2789 flags_switches_
.insert(
2790 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesBegin
,
2793 for (const std::string
& experiment_name
: enabled_experiments
) {
2794 NameToSwitchAndValueMap::const_iterator name_to_switch_it
=
2795 name_to_switch_map
.find(experiment_name
);
2796 if (name_to_switch_it
== name_to_switch_map
.end()) {
2801 const std::pair
<std::string
, std::string
>&
2802 switch_and_value_pair
= name_to_switch_it
->second
;
2804 CHECK(!switch_and_value_pair
.first
.empty());
2805 command_line
->AppendSwitchASCII(switch_and_value_pair
.first
,
2806 switch_and_value_pair
.second
);
2807 flags_switches_
[switch_and_value_pair
.first
] = switch_and_value_pair
.second
;
2809 if (sentinels
== kAddSentinels
) {
2810 command_line
->AppendSwitch(switches::kFlagSwitchesEnd
);
2811 flags_switches_
.insert(
2812 std::pair
<std::string
, std::string
>(switches::kFlagSwitchesEnd
,
2817 bool FlagsState::IsRestartNeededToCommitChanges() {
2818 return needs_restart_
;
2821 void FlagsState::SetExperimentEnabled(FlagsStorage
* flags_storage
,
2822 const std::string
& internal_name
,
2824 size_t at_index
= internal_name
.find(testing::kMultiSeparator
);
2825 if (at_index
!= std::string::npos
) {
2827 // We're being asked to enable a multi-choice experiment. Disable the
2828 // currently selected choice.
2829 DCHECK_NE(at_index
, 0u);
2830 const std::string experiment_name
= internal_name
.substr(0, at_index
);
2831 SetExperimentEnabled(flags_storage
, experiment_name
, false);
2833 // And enable the new choice, if it is not the default first choice.
2834 if (internal_name
!= experiment_name
+ "@0") {
2835 std::set
<std::string
> enabled_experiments
;
2836 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2837 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2838 flags_storage
->SetFlags(enabled_experiments
);
2843 std::set
<std::string
> enabled_experiments
;
2844 GetSanitizedEnabledFlags(flags_storage
, &enabled_experiments
);
2846 const Experiment
* e
= NULL
;
2847 for (size_t i
= 0; i
< num_experiments
; ++i
) {
2848 if (experiments
[i
].internal_name
== internal_name
) {
2849 e
= experiments
+ i
;
2855 if (e
->type
== Experiment::SINGLE_VALUE
) {
2857 needs_restart_
|= enabled_experiments
.insert(internal_name
).second
;
2859 needs_restart_
|= (enabled_experiments
.erase(internal_name
) > 0);
2862 // Enable the first choice.
2863 needs_restart_
|= enabled_experiments
.insert(e
->NameForChoice(0)).second
;
2865 // Find the currently enabled choice and disable it.
2866 for (int i
= 0; i
< e
->num_choices
; ++i
) {
2867 std::string choice_name
= e
->NameForChoice(i
);
2868 if (enabled_experiments
.find(choice_name
) !=
2869 enabled_experiments
.end()) {
2870 needs_restart_
= true;
2871 enabled_experiments
.erase(choice_name
);
2872 // Continue on just in case there's a bug and more than one
2873 // experiment for this choice was enabled.
2879 flags_storage
->SetFlags(enabled_experiments
);
2882 void FlagsState::RemoveFlagsSwitches(
2883 std::map
<std::string
, base::CommandLine::StringType
>* switch_list
) {
2884 for (const auto& entry
: flags_switches_
)
2885 switch_list
->erase(entry
.first
);
2888 void FlagsState::ResetAllFlags(FlagsStorage
* flags_storage
) {
2889 needs_restart_
= true;
2891 std::set
<std::string
> no_experiments
;
2892 flags_storage
->SetFlags(no_experiments
);
2895 void FlagsState::reset() {
2896 needs_restart_
= false;
2897 flags_switches_
.clear();
2904 // WARNING: '@' is also used in the html file. If you update this constant you
2905 // also need to update the html file.
2906 const char kMultiSeparator
[] = "@";
2908 const base::HistogramBase::Sample kBadSwitchFormatHistogramId
= 0;
2911 FlagsState::GetInstance()->reset();
2914 void SetExperiments(const Experiment
* e
, size_t count
) {
2916 experiments
= kExperiments
;
2917 num_experiments
= arraysize(kExperiments
);
2920 num_experiments
= count
;
2924 const Experiment
* GetExperiments(size_t* count
) {
2925 *count
= num_experiments
;
2929 } // namespace testing
2931 } // namespace about_flags