Convert browser_tests to Swarming.
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blob65c98d229164ce2f538c6678a18cf06147440b0f
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/about_flags.h"
7 #include <iterator>
8 #include <map>
9 #include <set>
10 #include <utility>
12 #include "base/command_line.h"
13 #include "base/memory/singleton.h"
14 #include "base/metrics/sparse_histogram.h"
15 #include "base/stl_util.h"
16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h"
19 #include "base/values.h"
20 #include "cc/base/switches.h"
21 #include "chrome/browser/flags_storage.h"
22 #include "chrome/common/chrome_content_client.h"
23 #include "chrome/common/chrome_switches.h"
24 #include "chrome/common/chrome_version_info.h"
25 #include "chrome/grit/chromium_strings.h"
26 #include "chrome/grit/generated_resources.h"
27 #include "chrome/grit/google_chrome_strings.h"
28 #include "components/autofill/core/common/autofill_switches.h"
29 #include "components/cloud_devices/common/cloud_devices_switches.h"
30 #include "components/dom_distiller/core/dom_distiller_switches.h"
31 #include "components/metrics/metrics_hashes.h"
32 #include "components/nacl/common/nacl_switches.h"
33 #include "components/omnibox/omnibox_switches.h"
34 #include "components/plugins/common/plugins_switches.h"
35 #include "components/proximity_auth/switches.h"
36 #include "components/search/search_switches.h"
37 #include "content/public/browser/user_metrics.h"
38 #include "media/base/media_switches.h"
39 #include "ui/base/l10n/l10n_util.h"
40 #include "ui/base/ui_base_switches.h"
41 #include "ui/display/display_switches.h"
42 #include "ui/events/event_switches.h"
43 #include "ui/gfx/switches.h"
44 #include "ui/gl/gl_switches.h"
45 #include "ui/keyboard/keyboard_switches.h"
46 #include "ui/native_theme/native_theme_switches.h"
47 #include "ui/views/views_switches.h"
49 #if defined(OS_ANDROID)
50 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
51 #else
52 #include "ui/message_center/message_center_switches.h"
53 #endif
55 #if defined(USE_ASH)
56 #include "ash/ash_switches.h"
57 #endif
59 #if defined(OS_CHROMEOS)
60 #include "chromeos/chromeos_switches.h"
61 #include "third_party/cros_system_api/switches/chrome_switches.h"
62 #endif
64 #if defined(ENABLE_APP_LIST)
65 #include "ui/app_list/app_list_switches.h"
66 #endif
68 #if defined(ENABLE_EXTENSIONS)
69 #include "extensions/common/switches.h"
70 #endif
72 #if defined(USE_OZONE)
73 #include "ui/ozone/public/ozone_switches.h"
74 #endif
76 namespace about_flags {
78 // Macros to simplify specifying the type.
79 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
80 Experiment::SINGLE_VALUE, \
81 command_line_switch, switch_value, NULL, NULL, NULL, 0
82 #define SINGLE_VALUE_TYPE(command_line_switch) \
83 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
84 #define SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
85 Experiment::SINGLE_DISABLE_VALUE, \
86 command_line_switch, switch_value, NULL, NULL, NULL, 0
87 #define SINGLE_DISABLE_VALUE_TYPE(command_line_switch) \
88 SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
89 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
90 disable_switch, disable_value) \
91 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
92 disable_switch, disable_value, NULL, 3
93 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
94 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
95 #define MULTI_VALUE_TYPE(choices) \
96 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
98 namespace {
100 // Enumeration of OSs.
101 enum {
102 kOsMac = 1 << 0,
103 kOsWin = 1 << 1,
104 kOsLinux = 1 << 2,
105 kOsCrOS = 1 << 3,
106 kOsAndroid = 1 << 4,
107 kOsCrOSOwnerOnly = 1 << 5
110 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
111 const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
113 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
114 // whether the experiment is available on that platform.
115 void AddOsStrings(unsigned bitmask, base::ListValue* list) {
116 struct {
117 unsigned bit;
118 const char* const name;
119 } kBitsToOs[] = {
120 {kOsMac, "Mac"},
121 {kOsWin, "Windows"},
122 {kOsLinux, "Linux"},
123 {kOsCrOS, "Chrome OS"},
124 {kOsAndroid, "Android"},
125 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
127 for (size_t i = 0; i < arraysize(kBitsToOs); ++i) {
128 if (bitmask & kBitsToOs[i].bit)
129 list->Append(new base::StringValue(kBitsToOs[i].name));
133 // Convert switch constants to proper CommandLine::StringType strings.
134 base::CommandLine::StringType GetSwitchString(const std::string& flag) {
135 base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM);
136 cmd_line.AppendSwitch(flag);
137 DCHECK_EQ(2U, cmd_line.argv().size());
138 return cmd_line.argv()[1];
141 // Scoops flags from a command line.
142 std::set<base::CommandLine::StringType> ExtractFlagsFromCommandLine(
143 const base::CommandLine& cmdline) {
144 std::set<base::CommandLine::StringType> flags;
145 // First do the ones between --flag-switches-begin and --flag-switches-end.
146 base::CommandLine::StringVector::const_iterator first =
147 std::find(cmdline.argv().begin(), cmdline.argv().end(),
148 GetSwitchString(switches::kFlagSwitchesBegin));
149 base::CommandLine::StringVector::const_iterator last =
150 std::find(cmdline.argv().begin(), cmdline.argv().end(),
151 GetSwitchString(switches::kFlagSwitchesEnd));
152 if (first != cmdline.argv().end() && last != cmdline.argv().end())
153 flags.insert(first + 1, last);
154 #if defined(OS_CHROMEOS)
155 // Then add those between --policy-switches-begin and --policy-switches-end.
156 first = std::find(cmdline.argv().begin(), cmdline.argv().end(),
157 GetSwitchString(chromeos::switches::kPolicySwitchesBegin));
158 last = std::find(cmdline.argv().begin(), cmdline.argv().end(),
159 GetSwitchString(chromeos::switches::kPolicySwitchesEnd));
160 if (first != cmdline.argv().end() && last != cmdline.argv().end())
161 flags.insert(first + 1, last);
162 #endif
163 return flags;
166 const Experiment::Choice kTouchEventsChoices[] = {
167 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
168 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
169 switches::kTouchEvents,
170 switches::kTouchEventsEnabled },
171 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
172 switches::kTouchEvents,
173 switches::kTouchEventsDisabled }
176 #if defined(USE_AURA)
177 const Experiment::Choice kOverscrollHistoryNavigationChoices[] = {
178 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, "", "" },
179 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
180 switches::kOverscrollHistoryNavigation,
181 "0" },
182 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI,
183 switches::kOverscrollHistoryNavigation,
184 "2" }
186 #endif
188 const Experiment::Choice kTouchTextSelectionStrategyChoices[] = {
189 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
190 { IDS_TOUCH_SELECTION_STRATEGY_CHARACTER,
191 switches::kTouchTextSelectionStrategy,
192 "character" },
193 { IDS_TOUCH_SELECTION_STRATEGY_DIRECTION,
194 switches::kTouchTextSelectionStrategy,
195 "direction" }
198 #if !defined(DISABLE_NACL)
199 const Experiment::Choice kNaClDebugMaskChoices[] = {
200 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
201 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
202 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
203 // so by default we want to avoid debugging that.
204 // NOTE: As the default value must be the empty string, the mask excluding
205 // the PNaCl translator and secure shell is substituted elsewhere.
206 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
207 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
208 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
209 switches::kNaClDebugMask, "*://*/*debug.nmf" }
211 #endif
213 const Experiment::Choice kMarkNonSecureAsChoices[] = {
214 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
215 { IDS_MARK_NON_SECURE_AS_NEUTRAL,
216 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNeutral},
217 { IDS_MARK_NON_SECURE_AS_NON_SECURE,
218 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsNonSecure},
219 { IDS_MARK_NON_SECURE_AS_DUBIOUS,
220 switches::kMarkNonSecureAs, switches::kMarkNonSecureAsDubious}
223 const Experiment::Choice kDataReductionProxyLoFiChoices[] = {
224 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
225 { IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_ALWAYS_ON,
226 data_reduction_proxy::switches::kDataReductionProxyLoFi,
227 data_reduction_proxy::switches::kDataReductionProxyLoFiValueAlwaysOn},
228 { IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_CELLULAR_ONLY,
229 data_reduction_proxy::switches::kDataReductionProxyLoFi,
230 data_reduction_proxy::switches::
231 kDataReductionProxyLoFiValueCellularOnly},
232 { IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_DISABLED,
233 data_reduction_proxy::switches::kDataReductionProxyLoFi,
234 data_reduction_proxy::switches::kDataReductionProxyLoFiValueDisabled}
237 const Experiment::Choice kShowSavedCopyChoices[] = {
238 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
239 { IDS_FLAGS_ENABLE_SHOW_SAVED_COPY_PRIMARY,
240 switches::kShowSavedCopy, switches::kEnableShowSavedCopyPrimary },
241 { IDS_FLAGS_ENABLE_SHOW_SAVED_COPY_SECONDARY,
242 switches::kShowSavedCopy, switches::kEnableShowSavedCopySecondary },
243 { IDS_FLAGS_DISABLE_SHOW_SAVED_COPY,
244 switches::kShowSavedCopy, switches::kDisableShowSavedCopy }
247 const Experiment::Choice kDefaultTileWidthChoices[] = {
248 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
249 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
250 switches::kDefaultTileWidth, "128"},
251 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
252 switches::kDefaultTileWidth, "256"},
253 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
254 switches::kDefaultTileWidth, "512"},
255 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
256 switches::kDefaultTileWidth, "1024"}
259 const Experiment::Choice kDefaultTileHeightChoices[] = {
260 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
261 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
262 switches::kDefaultTileHeight, "128"},
263 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
264 switches::kDefaultTileHeight, "256"},
265 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
266 switches::kDefaultTileHeight, "512"},
267 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
268 switches::kDefaultTileHeight, "1024"}
271 const Experiment::Choice kSimpleCacheBackendChoices[] = {
272 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
273 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
274 switches::kUseSimpleCacheBackend, "off" },
275 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
276 switches::kUseSimpleCacheBackend, "on"}
279 #if defined(USE_AURA)
280 const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
281 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
282 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
283 switches::kTabCaptureUpscaleQuality, "fast" },
284 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
285 switches::kTabCaptureUpscaleQuality, "good" },
286 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
287 switches::kTabCaptureUpscaleQuality, "best" },
290 const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
291 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
292 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
293 switches::kTabCaptureDownscaleQuality, "fast" },
294 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
295 switches::kTabCaptureDownscaleQuality, "good" },
296 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
297 switches::kTabCaptureDownscaleQuality, "best" },
299 #endif
301 #if defined(OS_ANDROID)
302 const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
303 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
304 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
305 switches::kEnableZeroSuggestMostVisited, ""},
306 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED_WITHOUT_SERP,
307 switches::kEnableZeroSuggestMostVisitedWithoutSerp, ""},
308 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
309 switches::kDisableZeroSuggest, ""}
312 const Experiment::Choice kReaderModeHeuristicsChoices[] = {
313 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
314 { IDS_FLAGS_READER_MODE_HEURISTICS_MARKUP,
315 switches::kReaderModeHeuristics,
316 switches::reader_mode_heuristics::kOGArticle },
317 { IDS_FLAGS_READER_MODE_HEURISTICS_ADABOOST,
318 switches::kReaderModeHeuristics,
319 switches::reader_mode_heuristics::kAdaBoost },
320 { IDS_FLAGS_READER_MODE_HEURISTICS_ALWAYS_ON,
321 switches::kReaderModeHeuristics,
322 switches::reader_mode_heuristics::kAlwaysTrue },
323 { IDS_FLAGS_READER_MODE_HEURISTICS_ALWAYS_OFF,
324 switches::kReaderModeHeuristics,
325 switches::reader_mode_heuristics::kNone },
327 #endif
329 const Experiment::Choice kNumRasterThreadsChoices[] = {
330 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
331 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
332 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
333 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
334 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
337 const Experiment::Choice kGpuRasterizationMSAASampleCountChoices[] = {
338 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
340 "" },
341 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_ZERO,
342 switches::kGpuRasterizationMSAASampleCount, "0" },
343 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_TWO,
344 switches::kGpuRasterizationMSAASampleCount, "2" },
345 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_FOUR,
346 switches::kGpuRasterizationMSAASampleCount, "4" },
347 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_EIGHT,
348 switches::kGpuRasterizationMSAASampleCount, "8" },
349 { IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_SIXTEEN,
350 switches::kGpuRasterizationMSAASampleCount, "16" },
353 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
354 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
355 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
356 switches::kEnableGpuRasterization, "" },
357 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
358 switches::kDisableGpuRasterization, "" },
359 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
360 switches::kForceGpuRasterization, "" },
363 #if defined(OS_CHROMEOS)
364 const Experiment::Choice kMemoryPressureThresholdChoices[] = {
365 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
366 { IDS_FLAGS_CONSERVATIVE_THRESHOLDS,
367 chromeos::switches::kMemoryPressureThresholds,
368 chromeos::switches::kConservativeThreshold },
369 { IDS_FLAGS_AGGRESSIVE_CACHE_DISCARD_THRESHOLDS,
370 chromeos::switches::kMemoryPressureThresholds,
371 chromeos::switches::kAggressiveCacheDiscardThreshold },
372 { IDS_FLAGS_AGGRESSIVE_TAB_DISCARD_THRESHOLDS,
373 chromeos::switches::kMemoryPressureThresholds,
374 chromeos::switches::kAggressiveTabDiscardThreshold },
375 { IDS_FLAGS_AGGRESSIVE_THRESHOLDS,
376 chromeos::switches::kMemoryPressureThresholds,
377 chromeos::switches::kAggressiveThreshold },
379 #endif
381 const Experiment::Choice kExtensionContentVerificationChoices[] = {
382 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
383 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
384 switches::kExtensionContentVerification,
385 switches::kExtensionContentVerificationBootstrap },
386 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
387 switches::kExtensionContentVerification,
388 switches::kExtensionContentVerificationEnforce },
389 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
390 switches::kExtensionContentVerification,
391 switches::kExtensionContentVerificationEnforceStrict },
394 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
395 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
396 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
397 password_manager::switches::kAllowAutofillSyncCredential, ""},
398 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
399 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
400 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
401 password_manager::switches::kDisallowAutofillSyncCredential, ""},
404 const Experiment::Choice kFillOnAccountSelectChoices[] = {
405 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
406 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
407 autofill::switches::kDisableFillOnAccountSelect, "" },
408 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_HIGHLIGHTING,
409 autofill::switches::kEnableFillOnAccountSelect, "" },
410 { IDS_FLAGS_FILL_ON_ACCOUNT_SELECT_ENABLE_NO_HIGHLIGHTING,
411 autofill::switches::kEnableFillOnAccountSelectNoHighlighting, "" },
414 #if defined(USE_ASH)
415 const Experiment::Choice kAshScreenRotationAnimationChoices[] = {
416 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
417 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
418 ash::switches::kAshEnableScreenRotationAnimation,
419 "none" },
420 { IDS_ASH_SCREEN_ROTATION_ANIMATION_PARTIAL_ROTATION,
421 ash::switches::kAshEnableScreenRotationAnimation,
422 "partial-rotation" },
423 { IDS_ASH_SCREEN_ROTATION_ANIMATION_FULL_ROTATION,
424 ash::switches::kAshEnableScreenRotationAnimation,
425 "full-rotation" }
427 #endif
429 #if defined(OS_CHROMEOS)
430 const Experiment::Choice kDataSaverPromptChoices[] = {
431 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
432 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
433 chromeos::switches::kDisableDataSaverPrompt, "" },
434 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
435 chromeos::switches::kEnableDataSaverPrompt, "" },
436 { IDS_FLAGS_DATASAVER_PROMPT_DEMO_MODE,
437 chromeos::switches::kEnableDataSaverPrompt,
438 chromeos::switches::kDataSaverPromptDemoMode },
441 const Experiment::Choice kFloatingVirtualKeyboardChoices[] = {
442 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
443 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
444 keyboard::switches::kFloatingVirtualKeyboard,
445 keyboard::switches::kFloatingVirtualKeyboardDisabled},
446 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
447 keyboard::switches::kFloatingVirtualKeyboard,
448 keyboard::switches::kFloatingVirtualKeyboardEnabled},
451 const Experiment::Choice kSmartVirtualKeyboardChoices[] = {
452 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
453 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
454 keyboard::switches::kSmartVirtualKeyboard,
455 keyboard::switches::kSmartVirtualKeyboardDisabled},
456 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
457 keyboard::switches::kSmartVirtualKeyboard,
458 keyboard::switches::kSmartVirtualKeyboardEnabled},
461 const Experiment::Choice kGestureTypingChoices[] = {
462 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
463 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
464 keyboard::switches::kGestureTyping,
465 keyboard::switches::kGestureTypingDisabled},
466 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
467 keyboard::switches::kGestureTyping,
468 keyboard::switches::kGestureTypingEnabled},
471 const Experiment::Choice kGestureEditingChoices[] = {
472 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
473 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
474 keyboard::switches::kGestureEditing,
475 keyboard::switches::kGestureEditingDisabled},
476 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
477 keyboard::switches::kGestureEditing,
478 keyboard::switches::kGestureEditingEnabled},
480 #endif
482 const Experiment::Choice kSupervisedUserSafeSitesChoices[] = {
483 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
484 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
485 switches::kSupervisedUserSafeSites,
486 "enabled" },
487 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
488 switches::kSupervisedUserSafeSites,
489 "disabled" },
490 { IDS_SUPERVISED_USER_SAFESITES_BLACKLIST_ONLY,
491 switches::kSupervisedUserSafeSites,
492 "blacklist-only" },
493 { IDS_SUPERVISED_USER_SAFESITES_ONLINE_CHECK_ONLY,
494 switches::kSupervisedUserSafeSites,
495 "online-check-only" }
498 // RECORDING USER METRICS FOR FLAGS:
499 // -----------------------------------------------------------------------------
500 // The first line of the experiment is the internal name. If you'd like to
501 // gather statistics about the usage of your flag, you should append a marker
502 // comment to the end of the feature name, like so:
503 // "my-special-feature", // FLAGS:RECORD_UMA
505 // After doing that, run
506 // tools/metrics/actions/extract_actions.py
507 // to add the metric to actions.xml (which will enable UMA to record your
508 // feature flag), then update the <owner>s and <description> sections. Make sure
509 // to include the actions.xml file when you upload your code for review!
511 // After your feature has shipped under a flag, you can locate the metrics under
512 // the action name AboutFlags_internal-action-name. Actions are recorded once
513 // per startup, so you should divide this number by AboutFlags_StartupTick to
514 // get a sense of usage. Note that this will not be the same as number of users
515 // with a given feature enabled because users can quit and relaunch the
516 // application multiple times over a given time interval. The dashboard also
517 // shows you how many (metrics reporting) users have enabled the flag over the
518 // last seven days. However, note that this is not the same as the number of
519 // users who have the flag enabled, since enabling the flag happens once,
520 // whereas running with the flag enabled happens until the user flips the flag
521 // again.
523 // To add a new experiment add to the end of kExperiments. There are two
524 // distinct types of experiments:
525 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
526 // macro for this type supplying the command line to the macro.
527 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
528 // deactivated state for this lab (i.e. no command line option). To specify
529 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
530 // array of choices.
531 // See the documentation of Experiment for details on the fields.
533 // Command-line switches must have entries in enum "LoginCustomFlags" in
534 // histograms.xml. See note in histograms.xml and don't forget to run
535 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
537 // When adding a new choice, add it to the end of the list.
538 const Experiment kExperiments[] = {
539 {"ignore-gpu-blacklist",
540 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
541 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
542 kOsAll,
543 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)},
544 #if defined(OS_WIN)
545 {"disable-direct-write",
546 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
547 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
548 kOsWin,
549 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)},
550 #endif
551 {"enable-experimental-canvas-features",
552 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
553 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
554 kOsAll,
555 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)},
556 {"disable-accelerated-2d-canvas",
557 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
558 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
559 kOsAll,
560 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)},
561 {"enable-display-list-2d-canvas",
562 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
563 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
564 kOsAll,
565 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDisplayList2dCanvas,
566 switches::kDisableDisplayList2dCanvas)},
567 {"composited-layer-borders",
568 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
569 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
570 kOsAll,
571 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)},
572 {"show-fps-counter",
573 IDS_FLAGS_SHOW_FPS_COUNTER,
574 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
575 kOsAll,
576 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)},
577 {"disable-webgl",
578 IDS_FLAGS_DISABLE_WEBGL_NAME,
579 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
580 kOsAll,
581 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)},
582 {"disable-webrtc",
583 IDS_FLAGS_DISABLE_WEBRTC_NAME,
584 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
585 kOsAndroid,
586 #if defined(OS_ANDROID)
587 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
588 #else
589 SINGLE_VALUE_TYPE("")
590 #endif
592 #if defined(ENABLE_WEBRTC)
593 {"disable-webrtc-hw-decoding",
594 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
595 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
596 kOsAndroid | kOsCrOS,
597 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
598 {"disable-webrtc-hw-encoding",
599 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
600 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
601 kOsAndroid | kOsCrOS,
602 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
603 {"enable-webrtc-stun-origin",
604 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_NAME,
605 IDS_FLAGS_ENABLE_WEBRTC_STUN_ORIGIN_DESCRIPTION,
606 kOsAll,
607 SINGLE_VALUE_TYPE(switches::kEnableWebRtcStunOrigin)},
608 #endif
609 #if defined(OS_ANDROID)
610 {"disable-webaudio",
611 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
612 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
613 kOsAndroid,
614 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)},
615 #endif
616 // Native client is compiled out when DISABLE_NACL is defined.
617 #if !defined(DISABLE_NACL)
618 {"enable-nacl", // FLAGS:RECORD_UMA
619 IDS_FLAGS_ENABLE_NACL_NAME,
620 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
621 kOsAll,
622 SINGLE_VALUE_TYPE(switches::kEnableNaCl)},
623 {"enable-nacl-debug", // FLAGS:RECORD_UMA
624 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
625 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
626 kOsDesktop,
627 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)},
628 {"nacl-debug-mask", // FLAGS:RECORD_UMA
629 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
630 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
631 kOsDesktop,
632 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)},
633 #endif
634 #if defined(ENABLE_EXTENSIONS)
635 {"extension-apis", // FLAGS:RECORD_UMA
636 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
637 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
638 kOsDesktop,
639 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)},
640 {"extensions-on-chrome-urls",
641 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
642 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
643 kOsAll,
644 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)},
645 #endif
646 {"enable-fast-unload",
647 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
648 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
649 kOsAll,
650 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)},
651 #if defined(ENABLE_EXTENSIONS)
652 {"enable-app-window-controls",
653 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
654 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
655 kOsDesktop,
656 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)},
657 #endif
658 {"disable-hyperlink-auditing",
659 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
660 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
661 kOsAll,
662 SINGLE_VALUE_TYPE(switches::kNoPings)},
663 #if defined(OS_ANDROID)
664 {"contextual-search",
665 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
666 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
667 kOsAndroid,
668 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
669 switches::kDisableContextualSearch)},
670 #endif
671 {"show-autofill-type-predictions",
672 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
673 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
674 kOsAll,
675 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)},
676 {"enable-smooth-scrolling", // FLAGS:RECORD_UMA
677 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
678 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
679 // Can't expose the switch unless the code is compiled in.
680 // On by default for the Mac (different implementation in WebKit).
681 kOsLinux | kOsWin,
682 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)},
683 #if defined(USE_AURA) || defined(OS_LINUX)
684 {"overlay-scrollbars",
685 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
686 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
687 // Uses the system preference on Mac (a different implementation).
688 // On Android, this is always enabled.
689 kOsLinux | kOsCrOS | kOsWin,
690 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOverlayScrollbar,
691 switches::kDisableOverlayScrollbar)},
692 #endif
693 {"enable-panels",
694 IDS_FLAGS_ENABLE_PANELS_NAME,
695 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
696 kOsDesktop,
697 SINGLE_VALUE_TYPE(switches::kEnablePanels)},
698 {// See http://crbug.com/120416 for how to remove this flag.
699 "save-page-as-mhtml", // FLAGS:RECORD_UMA
700 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
701 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
702 kOsMac | kOsWin | kOsLinux,
703 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)},
704 {"enable-quic",
705 IDS_FLAGS_ENABLE_QUIC_NAME,
706 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
707 kOsAll,
708 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic, switches::kDisableQuic)},
709 {"disable-media-source",
710 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
711 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
712 kOsAll,
713 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)},
714 {"disable-encrypted-media",
715 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
716 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
717 kOsAll,
718 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)},
719 {"disable-prefixed-encrypted-media",
720 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
721 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
722 kOsAll,
723 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)},
724 {"disable-javascript-harmony-shipping",
725 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_NAME,
726 IDS_FLAGS_DISABLE_JAVASCRIPT_HARMONY_SHIPPING_DESCRIPTION,
727 kOsAll,
728 SINGLE_VALUE_TYPE(switches::kDisableJavaScriptHarmonyShipping)},
729 {"enable-javascript-harmony",
730 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
731 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
732 kOsAll,
733 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)},
734 {"disable-software-rasterizer",
735 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
736 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
737 #if defined(ENABLE_SWIFTSHADER)
738 kOsAll,
739 #else
741 #endif
742 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)},
743 {"enable-gpu-rasterization",
744 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
745 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
746 kOsAll,
747 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)},
748 {"gpu-rasterization-msaa-sample-count",
749 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_NAME,
750 IDS_FLAGS_GPU_RASTERIZATION_MSAA_SAMPLE_COUNT_DESCRIPTION,
751 kOsAll,
752 MULTI_VALUE_TYPE(kGpuRasterizationMSAASampleCountChoices)},
753 {"disable-slimming-paint",
754 IDS_FLAGS_DISABLE_SLIMMING_PAINT_NAME,
755 IDS_FLAGS_DISABLE_SLIMMING_PAINT_DESCRIPTION,
756 kOsAll,
757 SINGLE_VALUE_TYPE(switches::kDisableSlimmingPaint)},
758 {"enable-slimming-paint",
759 IDS_FLAGS_ENABLE_SLIMMING_PAINT_NAME,
760 IDS_FLAGS_ENABLE_SLIMMING_PAINT_DESCRIPTION,
761 kOsAll,
762 SINGLE_VALUE_TYPE(switches::kEnableSlimmingPaint)},
763 {"enable-experimental-web-platform-features",
764 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
765 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
766 kOsAll,
767 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)},
768 {"enable-web-bluetooth",
769 IDS_FLAGS_WEB_BLUETOOTH_NAME,
770 IDS_FLAGS_WEB_BLUETOOTH_DESCRIPTION,
771 kOsAll,
772 SINGLE_VALUE_TYPE(switches::kEnableWebBluetooth)},
773 {"enable-devtools-experiments",
774 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
775 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
776 kOsDesktop,
777 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)},
778 {"silent-debugger-extension-api",
779 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
780 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
781 kOsDesktop,
782 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)},
783 #if defined(ENABLE_SPELLCHECK)
784 {"spellcheck-autocorrect",
785 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
786 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
787 kOsWin | kOsLinux | kOsCrOS,
788 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)},
789 #endif
790 {"enable-scroll-prediction",
791 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
792 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
793 kOsDesktop,
794 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)},
795 #if defined(ENABLE_TOPCHROME_MD)
796 {"top-chrome-md",
797 IDS_FLAGS_TOP_CHROME_MD,
798 IDS_FLAGS_TOP_CHROME_MD_DESCRIPTION,
799 kOsWin | kOsCrOS,
800 ENABLE_DISABLE_VALUE_TYPE(switches::kTopChromeMDEnabled,
801 switches::kTopChromeMDDisabled)},
802 #endif
803 {"touch-events",
804 IDS_TOUCH_EVENTS_NAME,
805 IDS_TOUCH_EVENTS_DESCRIPTION,
806 kOsDesktop,
807 MULTI_VALUE_TYPE(kTouchEventsChoices)},
808 {"disable-touch-adjustment",
809 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
810 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
811 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
812 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)},
813 #if defined(OS_CHROMEOS)
814 {"network-portal-notification",
815 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
816 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
817 kOsCrOS,
818 ENABLE_DISABLE_VALUE_TYPE(
819 chromeos::switches::kEnableNetworkPortalNotification,
820 chromeos::switches::kDisableNetworkPortalNotification)},
821 #endif
822 {"enable-download-resumption",
823 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
824 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
825 kOsDesktop,
826 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)},
827 {"enable-download-notification",
828 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_NAME,
829 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_DESCRIPTION,
830 kOsDesktop,
831 SINGLE_VALUE_TYPE(switches::kEnableDownloadNotification)},
832 #if defined(ENABLE_PLUGINS)
833 {"allow-nacl-socket-api",
834 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
835 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
836 kOsDesktop,
837 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")},
838 #endif
839 #if defined(OS_CHROMEOS)
840 {"allow-touchpad-three-finger-click",
841 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
842 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
843 kOsCrOS,
844 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)},
845 {"ash-enable-unified-desktop",
846 IDS_FLAGS_ASH_ENABLE_UNIFIED_DESKTOP_NAME,
847 IDS_FLAGS_ASH_ENABLE_UNIFIED_DESKTOP_DESCRIPTION,
848 kOsCrOS,
849 SINGLE_VALUE_TYPE(ash::switches::kAshEnableUnifiedDesktop)},
850 {"disable-easy-unlock",
851 IDS_FLAGS_DISABLE_EASY_UNLOCK_NAME,
852 IDS_FLAGS_DISABLE_EASY_UNLOCK_DESCRIPTION,
853 kOsCrOS,
854 SINGLE_VALUE_TYPE(proximity_auth::switches::kDisableEasyUnlock)},
855 {"enable-easy-unlock-proximity-detection",
856 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
857 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
858 kOsCrOS,
859 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)},
860 {"enable-easy-unlock-bluetooth-low-energy-detection",
861 IDS_FLAGS_ENABLE_EASY_UNLOCK_BLUETOOTH_LOW_ENERGY_DISCOVERY_NAME,
862 IDS_FLAGS_ENABLE_EASY_UNLOCK_BLUETOOTH_LOW_ENERGY_DISCOVERY_DESCRIPTION,
863 kOsCrOS,
864 SINGLE_VALUE_TYPE(
865 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)},
866 #endif
867 #if defined(USE_ASH)
868 {"disable-minimize-on-second-launcher-item-click",
869 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
870 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
871 kOsAll,
872 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)},
873 {"show-touch-hud",
874 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
875 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
876 kOsAll,
877 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
879 "enable-pinch",
880 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
881 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
882 kOsLinux | kOsWin | kOsCrOS,
883 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
885 #endif // defined(USE_ASH)
887 "enable-viewport-meta",
888 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
889 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
890 kOsLinux | kOsWin | kOsCrOS | kOsMac,
891 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
893 #if defined(OS_CHROMEOS)
895 "disable-boot-animation",
896 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
897 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
898 kOsCrOSOwnerOnly,
899 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
901 {"enable-video-player-chromecast-support",
902 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
903 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
904 kOsCrOS,
905 SINGLE_VALUE_TYPE(
906 chromeos::switches::kEnableVideoPlayerChromecastSupport)},
908 "disable-office-editing-component-app",
909 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
910 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
911 kOsCrOS,
912 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
915 "disable-display-color-calibration",
916 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
917 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
918 kOsCrOS,
919 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
922 "ash-disable-screen-orientation-lock",
923 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
924 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
925 kOsCrOS,
926 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
928 #endif // defined(OS_CHROMEOS)
930 "disable-accelerated-video-decode",
931 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
932 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
933 kOsMac | kOsWin | kOsCrOS,
934 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
936 #if defined(USE_ASH)
938 "ash-debug-shortcuts",
939 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
940 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
941 kOsAll,
942 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
945 "ash-disable-maximize-mode-window-backdrop",
946 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME,
947 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_DESCRIPTION,
948 kOsCrOS,
949 SINGLE_VALUE_TYPE(ash::switches::kAshDisableMaximizeModeWindowBackdrop),
952 "ash-enable-touch-view-testing",
953 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
954 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
955 kOsCrOS,
956 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
959 "disable-touch-feedback",
960 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
961 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
962 kOsCrOS,
963 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
966 "ash-enable-mirrored-screen",
967 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
968 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
969 kOsCrOS,
970 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
972 {"ash-enable-screen-rotation-animations",
973 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_NAME,
974 IDS_FLAGS_ASH_ENABLE_SCREEN_ROTATION_ANIMATION_DESCRIPTION,
975 kOsCrOS,
976 MULTI_VALUE_TYPE(kAshScreenRotationAnimationChoices)},
978 "ash-stable-overview-order",
979 IDS_FLAGS_ASH_STABLE_OVERVIEW_ORDER_NAME,
980 IDS_FLAGS_ASH_STABLE_OVERVIEW_ORDER_DESCRIPTION,
981 kOsCrOS,
982 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableStableOverviewOrder,
983 ash::switches::kAshDisableStableOverviewOrder),
985 #endif // defined(USE_ASH)
986 #if defined(OS_CHROMEOS)
987 {"disable-cloud-import",
988 IDS_FLAGS_DISABLE_CLOUD_IMPORT,
989 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION,
990 kOsCrOS,
991 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport)},
992 {"enable-request-tablet-site",
993 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
994 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
995 kOsCrOS,
996 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)},
997 #endif
998 {"debug-packed-apps",
999 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1000 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1001 kOsDesktop,
1002 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)},
1003 {"enable-password-generation",
1004 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1005 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1006 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1007 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1008 autofill::switches::kDisablePasswordGeneration)},
1009 {"enable-automatic-password-saving",
1010 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1011 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1012 kOsDesktop,
1013 SINGLE_VALUE_TYPE(
1014 password_manager::switches::kEnableAutomaticPasswordSaving)},
1015 {"password-manager-reauthentication",
1016 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1017 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1018 kOsMac | kOsWin,
1019 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)},
1020 {"enable-password-force-saving",
1021 IDS_FLAGS_ENABLE_PASSWORD_FORCE_SAVING_NAME,
1022 IDS_FLAGS_ENABLE_PASSWORD_FORCE_SAVING_DESCRIPTION,
1023 kOsAll,
1024 SINGLE_VALUE_TYPE(password_manager::switches::kEnablePasswordForceSaving)},
1025 {"enable-password-link",
1026 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1027 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1028 kOsAndroid | kOsDesktop,
1029 ENABLE_DISABLE_VALUE_TYPE(
1030 password_manager::switches::kEnablePasswordLink,
1031 password_manager::switches::kDisablePasswordLink)},
1032 {"enable-affiliation-based-matching",
1033 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME,
1034 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION,
1035 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1036 ENABLE_DISABLE_VALUE_TYPE(
1037 password_manager::switches::kEnableAffiliationBasedMatching,
1038 password_manager::switches::kDisableAffiliationBasedMatching)},
1039 {"wallet-service-use-sandbox",
1040 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1041 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1042 kOsAndroid | kOsDesktop,
1043 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1044 autofill::switches::kWalletServiceUseSandbox,
1045 "1",
1046 autofill::switches::kWalletServiceUseSandbox,
1047 "0")},
1048 #if defined(USE_AURA)
1049 {"overscroll-history-navigation",
1050 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1051 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1052 kOsAll,
1053 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)},
1054 #endif
1055 {"scroll-end-effect",
1056 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1057 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1058 kOsCrOS,
1059 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScrollEndEffect,
1060 "1",
1061 switches::kScrollEndEffect,
1062 "0")},
1063 {"enable-icon-ntp",
1064 IDS_FLAGS_ENABLE_ICON_NTP_NAME,
1065 IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION,
1066 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1067 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIconNtp,
1068 switches::kDisableIconNtp)},
1069 {"enable-touch-drag-drop",
1070 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1071 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1072 kOsWin | kOsCrOS,
1073 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1074 switches::kDisableTouchDragDrop)},
1075 {"enable-touch-editing",
1076 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1077 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1078 kOsCrOS | kOsWin | kOsLinux,
1079 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1080 switches::kDisableTouchEditing)},
1081 {"touch-selection-strategy",
1082 IDS_FLAGS_TOUCH_SELECTION_STRATEGY_NAME,
1083 IDS_FLAGS_TOUCH_SELECTION_STRATEGY_DESCRIPTION,
1084 kOsAndroid, // TODO(mfomitchev): Add CrOS/Win/Linux support soon.
1085 MULTI_VALUE_TYPE(kTouchTextSelectionStrategyChoices)},
1086 {"enable-stale-while-revalidate",
1087 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME,
1088 IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION,
1089 kOsAll,
1090 SINGLE_VALUE_TYPE(switches::kEnableStaleWhileRevalidate)},
1091 {"enable-suggestions-service",
1092 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1093 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1094 kOsAndroid | kOsCrOS,
1095 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1096 switches::kDisableSuggestionsService)},
1097 {"enable-supervised-user-managed-bookmarks-folder",
1098 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME,
1099 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION,
1100 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1101 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder)},
1102 #if defined(ENABLE_APP_LIST)
1103 {"enable-sync-app-list",
1104 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1105 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1106 kOsDesktop,
1107 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1108 app_list::switches::kDisableSyncAppList)},
1109 #endif
1110 #if defined(OS_MACOSX)
1111 {"enable-avfoundation",
1112 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1113 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1114 kOsMac,
1115 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1116 switches::kForceQTKit)},
1117 #endif
1118 {"lcd-text-aa",
1119 IDS_FLAGS_LCD_TEXT_NAME,
1120 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1121 kOsDesktop,
1122 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1123 switches::kDisableLCDText)},
1124 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1125 {"delegated-renderer",
1126 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1127 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1128 kOsAndroid, // TODO(ccameron) Add mac support soon.
1129 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1130 switches::kDisableDelegatedRenderer)},
1131 #endif
1132 {"enable-offer-store-unmasked-wallet-cards",
1133 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS,
1134 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION,
1135 kOsAll,
1136 ENABLE_DISABLE_VALUE_TYPE(
1137 autofill::switches::kEnableOfferStoreUnmaskedWalletCards,
1138 autofill::switches::kDisableOfferStoreUnmaskedWalletCards)},
1139 {"enable-offline-auto-reload",
1140 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1141 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1142 kOsAll,
1143 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1144 switches::kDisableOfflineAutoReload)},
1145 {"enable-offline-auto-reload-visible-only",
1146 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1147 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1148 kOsAll,
1149 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1150 switches::kDisableOfflineAutoReloadVisibleOnly)},
1151 {"show-saved-copy",
1152 IDS_FLAGS_SHOW_SAVED_COPY_NAME,
1153 IDS_FLAGS_SHOW_SAVED_COPY_DESCRIPTION,
1154 kOsAll,
1155 MULTI_VALUE_TYPE(kShowSavedCopyChoices)},
1156 {"default-tile-width",
1157 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1158 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1159 kOsAll,
1160 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)},
1161 {"default-tile-height",
1162 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1163 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1164 kOsAll,
1165 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)},
1166 #if defined(OS_ANDROID)
1167 {"disable-gesture-requirement-for-media-playback",
1168 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1169 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1170 kOsAndroid,
1171 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)},
1172 #endif
1173 #if defined(OS_CHROMEOS)
1174 {"enable-virtual-keyboard",
1175 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1176 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1177 kOsCrOS,
1178 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)},
1179 {"enable-virtual-keyboard-overscroll",
1180 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1181 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1182 kOsCrOS,
1183 ENABLE_DISABLE_VALUE_TYPE(
1184 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1185 keyboard::switches::kDisableVirtualKeyboardOverscroll)},
1186 {"enable-input-view",
1187 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1188 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1189 kOsCrOS,
1190 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1191 keyboard::switches::kDisableInputView)},
1192 {"disable-new-korean-ime",
1193 IDS_FLAGS_DISABLE_NEW_KOREAN_IME_NAME,
1194 IDS_FLAGS_DISABLE_NEW_KOREAN_IME_DESCRIPTION,
1195 kOsCrOS,
1196 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewKoreanIme)},
1197 {"disable-new-md-input-view",
1198 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_NAME,
1199 IDS_FLAGS_DISABLE_NEW_MD_INPUT_VIEW_DESCRIPTION,
1200 kOsCrOS,
1201 SINGLE_VALUE_TYPE(keyboard::switches::kDisableNewMDInputView)},
1202 {"enable-physical-keyboard-autocorrect",
1203 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1204 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1205 kOsCrOS,
1206 ENABLE_DISABLE_VALUE_TYPE(
1207 chromeos::switches::kEnablePhysicalKeyboardAutocorrect,
1208 chromeos::switches::kDisablePhysicalKeyboardAutocorrect)},
1209 {"disable-voice-input",
1210 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME,
1211 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION,
1212 kOsCrOS,
1213 SINGLE_VALUE_TYPE(keyboard::switches::kDisableVoiceInput)},
1214 {"enable-experimental-input-view-features",
1215 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1216 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1217 kOsCrOS,
1218 SINGLE_VALUE_TYPE(
1219 keyboard::switches::kEnableExperimentalInputViewFeatures)},
1220 {"floating-virtual-keyboard",
1221 IDS_FLAGS_FLOATING_VIRTUAL_KEYBOARD_NAME,
1222 IDS_FLAGS_FLOATING_VIRTUAL_KEYBOARD_DESCRIPTION,
1223 kOsCrOS,
1224 MULTI_VALUE_TYPE(kFloatingVirtualKeyboardChoices)},
1225 {"smart-virtual-keyboard",
1226 IDS_FLAGS_SMART_VIRTUAL_KEYBOARD_NAME,
1227 IDS_FLAGS_SMART_VIRTUAL_KEYBOARD_DESCRIPTION,
1228 kOsCrOS,
1229 MULTI_VALUE_TYPE(kSmartVirtualKeyboardChoices)},
1230 {"gesture-typing",
1231 IDS_FLAGS_GESTURE_TYPING_NAME,
1232 IDS_FLAGS_GESTURE_TYPING_DESCRIPTION,
1233 kOsCrOS,
1234 MULTI_VALUE_TYPE(kGestureTypingChoices)},
1235 {"gesture-editing",
1236 IDS_FLAGS_GESTURE_EDITING_NAME,
1237 IDS_FLAGS_GESTURE_EDITING_DESCRIPTION,
1238 kOsCrOS,
1239 MULTI_VALUE_TYPE(kGestureEditingChoices)},
1240 {"enable-fullscreen-app-list",
1241 IDS_FLAGS_FULLSCREEN_APP_LIST_NAME,
1242 IDS_FLAGS_FULLSCREEN_APP_LIST_DESCRIPTION,
1243 kOsCrOS,
1244 SINGLE_VALUE_TYPE(ash::switches::kAshEnableFullscreenAppList)},
1245 #endif
1246 {"enable-simple-cache-backend",
1247 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1248 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1249 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1250 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)},
1251 {"enable-tcp-fast-open",
1252 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1253 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1254 kOsLinux | kOsCrOS | kOsAndroid,
1255 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)},
1256 #if defined(ENABLE_SERVICE_DISCOVERY)
1257 {"device-discovery-notifications",
1258 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1259 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1260 kOsDesktop,
1261 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1262 switches::kDisableDeviceDiscoveryNotifications)},
1263 {"enable-print-preview-register-promos",
1264 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1265 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1266 kOsDesktop,
1267 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)},
1268 #endif // ENABLE_SERVICE_DISCOVERY
1269 #if defined(OS_WIN)
1270 {"enable-cloud-print-xps",
1271 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1272 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1273 kOsWin,
1274 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)},
1275 #endif
1276 #if defined(USE_AURA)
1277 {"tab-capture-upscale-quality",
1278 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1279 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1280 kOsAll,
1281 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)},
1282 {"tab-capture-downscale-quality",
1283 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1284 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1285 kOsAll,
1286 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)},
1287 #endif
1288 #if defined(TOOLKIT_VIEWS)
1289 {"disable-hide-inactive-stacked-tab-close-buttons",
1290 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_NAME,
1291 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_DESCRIPTION,
1292 kOsCrOS | kOsWin | kOsLinux,
1293 SINGLE_VALUE_TYPE(switches::kDisableHideInactiveStackedTabCloseButtons)},
1294 #endif
1295 #if defined(ENABLE_SPELLCHECK)
1296 {"enable-spelling-feedback-field-trial",
1297 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1298 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1299 kOsAll,
1300 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)},
1301 #endif
1302 {"enable-webgl-draft-extensions",
1303 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1304 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1305 kOsAll,
1306 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)},
1307 {"enable-new-profile-management",
1308 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1309 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1310 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1311 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1312 switches::kDisableNewProfileManagement)},
1313 {"enable-account-consistency",
1314 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1315 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1316 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1317 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1318 switches::kDisableAccountConsistency)},
1319 {"enable-iframe-based-signin",
1320 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME,
1321 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION,
1322 kOsMac | kOsWin | kOsLinux,
1323 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin)},
1324 {"enable-google-profile-info",
1325 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1326 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1327 kOsMac | kOsWin | kOsLinux,
1328 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)},
1329 {"reset-app-list-install-state",
1330 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1331 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1332 kOsMac | kOsWin | kOsLinux,
1333 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)},
1334 #if defined(ENABLE_APP_LIST)
1335 #if defined(OS_LINUX)
1336 {// This is compiled out on non-Linux platforms because otherwise it would
1337 // be
1338 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1339 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1340 "enable-app-list",
1341 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1342 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1343 kOsLinux,
1344 SINGLE_VALUE_TYPE(switches::kEnableAppList)},
1345 #endif
1346 #if defined(ENABLE_EXTENSIONS)
1347 {"enable-surface-worker",
1348 IDS_FLAGS_ENABLE_SURFACE_WORKER_NAME,
1349 IDS_FLAGS_ENABLE_SURFACE_WORKER_DESCRIPTION,
1350 kOsDesktop,
1351 SINGLE_VALUE_TYPE(extensions::switches::kEnableSurfaceWorker)},
1352 #endif
1353 {"disable-drive-apps-in-app-list",
1354 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1355 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1356 kOsCrOS,
1357 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)},
1358 #endif
1359 #if defined(OS_ANDROID)
1360 {"enable-accessibility-tab-switcher",
1361 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1362 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1363 kOsAndroid,
1364 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)},
1365 {// TODO(dmazzoni): remove this flag when native android accessibility
1366 // ships in the stable channel. http://crbug.com/356775
1367 "enable-accessibility-script-injection",
1368 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1369 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1370 kOsAndroid,
1371 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1372 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")},
1373 #endif
1374 {"disable-one-copy",
1375 IDS_FLAGS_DISABLE_ONE_COPY_NAME,
1376 IDS_FLAGS_DISABLE_ONE_COPY_DESCRIPTION,
1377 kOsAll,
1378 SINGLE_VALUE_TYPE(switches::kDisableOneCopy)},
1379 {"enable-zero-copy",
1380 IDS_FLAGS_ENABLE_ZERO_COPY_NAME,
1381 IDS_FLAGS_ENABLE_ZERO_COPY_DESCRIPTION,
1382 kOsAll,
1383 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)},
1384 #if defined(OS_CHROMEOS)
1385 {"enable-first-run-ui-transitions",
1386 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1387 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1388 kOsCrOS,
1389 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)},
1390 #endif
1391 {"disable-new-bookmark-apps",
1392 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME,
1393 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION,
1394 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1395 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps,
1396 switches::kDisableNewBookmarkApps)},
1397 #if defined(OS_MACOSX)
1398 {"disable-hosted-app-shim-creation",
1399 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME,
1400 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION,
1401 kOsMac,
1402 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation)},
1403 {"enable-hosted-app-quit-notification",
1404 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME,
1405 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION,
1406 kOsMac,
1407 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
1408 #endif
1409 {"enable-ephemeral-apps-in-webstore",
1410 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
1411 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
1412 kOsAll,
1413 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)},
1414 {"enable-linkable-ephemeral-apps",
1415 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1416 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1417 kOsAll,
1418 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)},
1419 {"enable-service-worker-sync",
1420 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1421 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1422 kOsAll,
1423 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)},
1424 #if defined(OS_ANDROID)
1425 {"disable-click-delay",
1426 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1427 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1428 kOsAndroid,
1429 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1430 SINGLE_VALUE_TYPE("disable-click-delay")},
1431 {"disable-pull-to-refresh-effect",
1432 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1433 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1434 kOsAndroid,
1435 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)},
1436 #endif
1437 #if defined(OS_MACOSX)
1438 {"enable-translate-new-ux",
1439 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1440 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1441 kOsMac,
1442 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)},
1443 #endif
1444 #if defined(TOOLKIT_VIEWS)
1445 {"disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1446 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1447 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1448 kOsCrOS | kOsWin | kOsLinux,
1449 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)},
1450 {"enable-link-disambiguation-popup",
1451 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1452 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1453 kOsCrOS | kOsWin,
1454 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)},
1455 #endif
1456 #if defined(ENABLE_EXTENSIONS)
1457 {"enable-apps-show-on-first-paint",
1458 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1459 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1460 kOsDesktop,
1461 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)},
1462 #endif
1463 {"enhanced-bookmarks-experiment",
1464 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1465 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1466 kOsDesktop | kOsAndroid,
1467 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kEnhancedBookmarksExperiment,
1468 "1",
1469 switches::kEnhancedBookmarksExperiment,
1470 "0")},
1471 #if defined(OS_ANDROID)
1472 {"enable-zero-suggest-experiment",
1473 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1474 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1475 kOsAndroid,
1476 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)},
1477 {"reader-mode-heuristics",
1478 IDS_FLAGS_READER_MODE_HEURISTICS_NAME,
1479 IDS_FLAGS_READER_MODE_HEURISTICS_DESCRIPTION,
1480 kOsAndroid,
1481 MULTI_VALUE_TYPE(kReaderModeHeuristicsChoices)},
1482 {"enable-reader-mode-toolbar-icon",
1483 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1484 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1485 kOsAndroid,
1486 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)},
1487 {"enable-dom-distiller-button-animation",
1488 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION,
1489 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION_DESCRIPTION,
1490 kOsAndroid,
1491 SINGLE_VALUE_TYPE(switches::kEnableDomDistillerButtonAnimation)},
1492 #endif
1493 {"num-raster-threads",
1494 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1495 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1496 kOsAll,
1497 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)},
1498 {"enable-single-click-autofill",
1499 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1500 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1501 kOsCrOS | kOsMac | kOsWin | kOsLinux | kOsAndroid,
1502 ENABLE_DISABLE_VALUE_TYPE(
1503 autofill::switches::kEnableSingleClickAutofill,
1504 autofill::switches::kDisableSingleClickAutofill)},
1505 {"enable-permissions-bubbles",
1506 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1507 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1508 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1509 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1510 switches::kDisablePermissionsBubbles)},
1511 {"enable-site-engagement-service",
1512 IDS_FLAGS_ENABLE_SITE_ENGAGEMENT_SERVICE_NAME,
1513 IDS_FLAGS_ENABLE_SITE_ENGAGEMENT_SERVICE_DESCRIPTION,
1514 kOsAll,
1515 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSiteEngagementService,
1516 switches::kDisableSiteEngagementService)},
1517 {"enable-session-crashed-bubble",
1518 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1519 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1520 kOsWin | kOsLinux,
1521 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1522 switches::kDisableSessionCrashedBubble)},
1523 {"enable-pdf-material-ui",
1524 IDS_FLAGS_PDF_MATERIAL_UI_NAME,
1525 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
1526 kOsDesktop,
1527 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI,
1528 switches::kDisablePdfMaterialUI)},
1529 {"disable-cast-streaming-hw-encoding",
1530 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1531 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1532 kOsAll,
1533 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)},
1534 #if defined(OS_ANDROID)
1535 {"disable-cast",
1536 IDS_FLAGS_DISABLE_CAST_NAME,
1537 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1538 kOsAndroid,
1539 SINGLE_VALUE_TYPE(switches::kDisableCast)},
1540 {"prefetch-search-results",
1541 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1542 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1543 kOsAndroid,
1544 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)},
1545 #endif
1546 #if defined(ENABLE_APP_LIST)
1547 {"enable-experimental-app-list",
1548 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1549 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1550 kOsWin | kOsLinux | kOsCrOS,
1551 ENABLE_DISABLE_VALUE_TYPE(
1552 app_list::switches::kEnableExperimentalAppList,
1553 app_list::switches::kDisableExperimentalAppList)},
1554 {"enable-centered-app-list",
1555 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1556 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1557 kOsWin | kOsLinux | kOsCrOS,
1558 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)},
1559 {"enable-new-app-list-mixer",
1560 IDS_FLAGS_ENABLE_NEW_APP_LIST_MIXER_NAME,
1561 IDS_FLAGS_ENABLE_NEW_APP_LIST_MIXER_DESCRIPTION,
1562 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1563 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableNewAppListMixer,
1564 app_list::switches::kDisableNewAppListMixer)},
1565 #endif
1566 {"disable-threaded-scrolling",
1567 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1568 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1569 kOsWin | kOsLinux | kOsCrOS | kOsAndroid | kOsMac,
1570 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)},
1571 {"invert-viewport-scroll-order",
1572 IDS_FLAGS_INVERT_VIEWPORT_SCROLL_ORDER_NAME,
1573 IDS_FLAGS_INVERT_VIEWPORT_SCROLL_ORDER_DESCRIPTION,
1574 kOsAll,
1575 SINGLE_VALUE_TYPE(switches::kInvertViewportScrollOrder)},
1576 {"bleeding-edge-renderer-mode",
1577 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1578 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1579 kOsAndroid,
1580 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)},
1581 {"enable-settings-window",
1582 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1583 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1584 kOsDesktop,
1585 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1586 switches::kDisableSettingsWindow)},
1587 #if defined(OS_ANDROID)
1588 {"enable-instant-search-clicks",
1589 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1590 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1591 kOsAndroid,
1592 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)},
1593 #endif
1594 {"enable-save-password-bubble",
1595 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1596 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1597 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1598 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1599 switches::kDisableSavePasswordBubble)},
1600 {"enable-apps-file-associations",
1601 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1602 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1603 kOsMac,
1604 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)},
1605 #if defined(OS_ANDROID)
1606 {"enable-embeddedsearch-api",
1607 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1608 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1609 kOsAndroid,
1610 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)},
1611 #endif
1612 {"distance-field-text",
1613 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1614 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1615 kOsAll,
1616 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1617 switches::kDisableDistanceFieldText)},
1618 {"extension-content-verification",
1619 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1620 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1621 kOsDesktop,
1622 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)},
1623 #if defined(ENABLE_EXTENSIONS)
1624 {"extension-active-script-permission",
1625 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1626 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1627 kOsAll,
1628 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)},
1629 #endif
1630 {"answers-in-suggest",
1631 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1632 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1633 kOsAndroid | kOsDesktop,
1634 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAnswersInSuggest,
1635 switches::kDisableAnswersInSuggest)},
1636 #if defined(OS_ANDROID)
1637 {"enable-data-reduction-proxy-dev",
1638 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1639 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1640 kOsAndroid,
1641 ENABLE_DISABLE_VALUE_TYPE(
1642 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1643 data_reduction_proxy::switches::kDisableDataReductionProxyDev)},
1644 {"enable-data-reduction-proxy-alt",
1645 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1646 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1647 kOsAndroid,
1648 SINGLE_VALUE_TYPE(
1649 data_reduction_proxy::switches::kEnableDataReductionProxyAlt)},
1650 {"enable-data-reduction-proxy-carrier-test",
1651 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_CARRIER_TEST_NAME,
1652 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_CARRIER_TEST_DESCRIPTION,
1653 kOsAndroid,
1654 SINGLE_VALUE_TYPE(
1655 data_reduction_proxy::switches::kEnableDataReductionProxyCarrierTest)},
1656 #endif
1657 {"enable-hotword-hardware",
1658 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1659 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1660 kOsCrOS,
1661 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)},
1662 #if defined(ENABLE_EXTENSIONS)
1663 {"enable-embedded-extension-options",
1664 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1665 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1666 kOsDesktop,
1667 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)},
1668 #endif
1669 #if defined(USE_ASH)
1670 {"enable-web-app-frame",
1671 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME,
1672 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION,
1673 kOsWin | kOsCrOS,
1674 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)},
1675 #endif
1676 {"enable-drop-sync-credential",
1677 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1678 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1679 kOsAll,
1680 ENABLE_DISABLE_VALUE_TYPE(
1681 password_manager::switches::kEnableDropSyncCredential,
1682 password_manager::switches::kDisableDropSyncCredential)},
1683 #if defined(ENABLE_EXTENSIONS)
1684 {"enable-extension-action-redesign",
1685 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1686 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1687 kOsDesktop,
1688 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)},
1689 #endif
1690 {"autofill-sync-credential",
1691 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1692 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1693 kOsAll,
1694 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)},
1695 #if !defined(OS_ANDROID)
1696 {"enable-message-center-always-scroll-up-upon-notification-removal",
1697 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1698 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1699 kOsDesktop,
1700 SINGLE_VALUE_TYPE(
1701 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)},
1702 {"enable-md-settings",
1703 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME,
1704 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION,
1705 kOsDesktop,
1706 SINGLE_VALUE_TYPE(switches::kEnableMaterialDesignSettings)},
1707 #endif
1708 #if defined(OS_CHROMEOS)
1709 {"memory-pressure-thresholds",
1710 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME,
1711 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION,
1712 kOsCrOS,
1713 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices)},
1714 {"wake-on-packets",
1715 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1716 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1717 kOsCrOSOwnerOnly,
1718 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)},
1719 #endif // OS_CHROMEOS
1720 {"enable-tab-audio-muting",
1721 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
1722 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
1723 kOsDesktop,
1724 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)},
1725 {"enable-credential-manager-api",
1726 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
1727 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
1728 kOsAll,
1729 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)},
1730 {"reduced-referrer-granularity",
1731 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
1732 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
1733 kOsAll,
1734 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)},
1735 #if defined(ENABLE_PLUGINS)
1736 {"enable-plugin-power-saver",
1737 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
1738 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
1739 kOsDesktop,
1740 ENABLE_DISABLE_VALUE_TYPE(plugins::switches::kEnablePluginPowerSaver,
1741 plugins::switches::kDisablePluginPowerSaver)},
1742 #endif
1743 #if defined(OS_CHROMEOS)
1744 {"disable-new-zip-unpacker",
1745 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
1746 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
1747 kOsCrOS,
1748 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)},
1749 #endif // defined(OS_CHROMEOS)
1750 {"enable-credit-card-scan",
1751 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
1752 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
1753 kOsAndroid,
1754 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan,
1755 autofill::switches::kDisableCreditCardScan)},
1756 #if defined(OS_CHROMEOS)
1757 {"disable-captive-portal-bypass-proxy",
1758 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
1759 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
1760 kOsCrOS,
1761 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCaptivePortalBypassProxy)},
1762 #endif // defined(OS_CHROMEOS)
1763 #if defined(OS_ANDROID)
1764 {"enable-seccomp-filter-sandbox",
1765 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
1766 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
1767 kOsAndroid,
1768 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)},
1769 #endif
1770 {"enable-touch-hover",
1771 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME,
1772 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION,
1773 kOsAndroid,
1774 SINGLE_VALUE_TYPE("enable-touch-hover")},
1775 {"enable-fill-on-account-select",
1776 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
1777 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
1778 kOsAll,
1779 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices)},
1780 #if defined(OS_CHROMEOS)
1781 {"enable-wifi-credential-sync", // FLAGS:RECORD_UMA
1782 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
1783 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
1784 kOsCrOS,
1785 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)},
1786 {"enable-potentially-annoying-security-features",
1787 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME,
1788 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION,
1789 kOsAll,
1790 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)},
1791 #endif
1792 {"disable-delay-agnostic-aec",
1793 IDS_FLAGS_DISABLE_DELAY_AGNOSTIC_AEC_NAME,
1794 IDS_FLAGS_DISABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
1795 kOsDesktop,
1796 SINGLE_VALUE_TYPE(switches::kDisableDelayAgnosticAec)},
1797 {"enable-delay-agnostic-aec",
1798 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
1799 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
1800 kOsDesktop,
1801 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)},
1802 {"mark-non-secure-as", // FLAGS:RECORD_UMA
1803 IDS_MARK_NON_SECURE_AS_NAME,
1804 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
1805 kOsAll,
1806 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)},
1807 {"enable-site-per-process",
1808 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
1809 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
1810 kOsAll,
1811 SINGLE_VALUE_TYPE(switches::kSitePerProcess)},
1812 #if defined(OS_MACOSX)
1813 {"enable-harfbuzz-rendertext",
1814 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
1815 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
1816 kOsMac,
1817 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)},
1818 #endif // defined(OS_MACOSX)
1819 #if defined(OS_CHROMEOS)
1820 {"disable-timezone-tracking",
1821 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
1822 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
1823 kOsCrOS,
1824 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption)},
1825 {"disable-webview-signin-flow",
1826 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_NAME,
1827 IDS_FLAGS_DISABLE_WEBVIEW_SIGNIN_FLOW_DESCRIPTION,
1828 kOsCrOS,
1829 SINGLE_VALUE_TYPE(chromeos::switches::kDisableWebviewSigninFlow)},
1830 #endif // defined(OS_CHROMEOS)
1831 {"data-reduction-proxy-lo-fi",
1832 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_NAME,
1833 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION,
1834 kOsAll,
1835 MULTI_VALUE_TYPE(kDataReductionProxyLoFiChoices)},
1836 {"clear-data-reduction-proxy-data-savings",
1837 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME,
1838 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION,
1839 kOsAll,
1840 SINGLE_VALUE_TYPE(
1841 data_reduction_proxy::switches::kClearDataReductionProxyDataSavings)},
1842 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
1843 {"enable-data-reduction-proxy-bypass-warnings",
1844 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
1845 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
1846 kOsAndroid,
1847 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
1848 kEnableDataReductionProxyBypassWarning)},
1849 #endif
1850 {"allow-insecure-localhost",
1851 IDS_ALLOW_INSECURE_LOCALHOST,
1852 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION,
1853 kOsAll,
1854 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)},
1855 {"enable-add-to-shelf",
1856 IDS_FLAGS_ENABLE_ADD_TO_SHELF_NAME,
1857 IDS_FLAGS_ENABLE_ADD_TO_SHELF_DESCRIPTION,
1858 kOsDesktop,
1859 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAddToShelf,
1860 switches::kDisableAddToShelf)},
1861 {"bypass-app-banner-engagement-checks",
1862 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME,
1863 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION,
1864 kOsAll,
1865 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks)},
1866 {"use-sync-sandbox",
1867 IDS_FLAGS_SYNC_SANDBOX_NAME,
1868 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
1869 kOsAll,
1870 SINGLE_VALUE_TYPE_AND_VALUE(
1871 switches::kSyncServiceURL,
1872 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
1873 {"enable-child-account-detection",
1874 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_NAME,
1875 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_DESCRIPTION,
1876 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1877 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableChildAccountDetection,
1878 switches::kDisableChildAccountDetection)},
1879 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
1880 {"ozone-test-single-overlay-support",
1881 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY,
1882 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION,
1883 kOsCrOS,
1884 SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport)},
1885 #endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
1886 {"v8-pac-mojo-out-of-process",
1887 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME,
1888 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION,
1889 kOsDesktop,
1890 ENABLE_DISABLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess,
1891 switches::kDisableOutOfProcessPac)},
1892 #if defined(ENABLE_MEDIA_ROUTER)
1893 {"enable-media-router",
1894 IDS_FLAGS_ENABLE_MEDIA_ROUTER_NAME,
1895 IDS_FLAGS_ENABLE_MEDIA_ROUTER_DESCRIPTION,
1896 kOsAll,
1897 SINGLE_VALUE_TYPE(switches::kEnableMediaRouter)},
1898 #endif // defined(ENABLE_MEDIA_ROUTER)
1899 // Since kEnableLauncherSearchProviderApi is not available when app list is
1900 // disabled, flag guard enable-launcher-search-provider-api.
1901 #if defined(ENABLE_APP_LIST)
1902 {"enable-launcher-search-provider-api",
1903 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API,
1904 IDS_FLAGS_ENABLE_LAUNCHER_SEARCH_PROVIDER_API_DESCRIPTION,
1905 kOsCrOS,
1906 SINGLE_VALUE_TYPE(app_list::switches::kEnableLauncherSearchProviderApi)},
1907 #endif // defined(ENABLE_APP_LIST)
1908 #if defined(OS_CHROMEOS)
1909 {"disable-mtp-write-support",
1910 IDS_FLAG_DISABLE_MTP_WRITE_SUPPORT_NAME,
1911 IDS_FLAG_DISABLE_MTP_WRITE_SUPPORT_DESCRIPTION,
1912 kOsCrOS,
1913 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMtpWriteSupport)},
1914 #endif // defined(OS_CHROMEOS)
1915 #if defined(OS_CHROMEOS)
1916 {"enable-datasaver-prompt",
1917 IDS_FLAGS_DATASAVER_PROMPT_NAME,
1918 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION,
1919 kOsCrOS,
1920 MULTI_VALUE_TYPE(kDataSaverPromptChoices)},
1921 #endif // defined(OS_CHROMEOS)
1922 {"supervised-user-safesites",
1923 IDS_FLAGS_SUPERVISED_USER_SAFESITES_NAME,
1924 IDS_FLAGS_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1925 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1926 MULTI_VALUE_TYPE(kSupervisedUserSafeSitesChoices)},
1927 #if defined(OS_ANDROID)
1928 {"enable-autofill-keyboard-accessory-view",
1929 IDS_FLAGS_AUTOFILL_ACCESSORY_VIEW_NAME,
1930 IDS_FLAGS_AUTOFILL_ACCESSORY_VIEW_DESCRIPTION,
1931 kOsAndroid,
1932 SINGLE_VALUE_TYPE(autofill::switches::kEnableAccessorySuggestionView)},
1933 #endif // defined(OS_ANDROID)
1934 {"disable-new-video-renderer",
1935 IDS_FLAGS_DISABLE_NEW_VIDEO_RENDERER_NAME,
1936 IDS_FLAGS_DISABLE_NEW_VIDEO_RENDERER_DESCRIPTION,
1937 kOsAll,
1938 SINGLE_VALUE_TYPE(switches::kDisableNewVideoRenderer)},
1939 #if defined(OS_CHROMEOS)
1940 {"enable-printer-app-search",
1941 IDS_FLAGS_PRINTER_PROVIDER_SEARCH_APP_NAME,
1942 IDS_FLAGS_PRINTER_PROVIDER_SEARCH_APP_DESCRIPTION,
1943 kOsCrOS,
1944 SINGLE_VALUE_TYPE(chromeos::switches::kEnablePrinterAppSearch)},
1945 #endif // OS_CHROMEOS
1946 // Temporary flag to ease the transition to standard-compliant scrollTop
1947 // behavior. Will be removed shortly after http://crbug.com/157855 ships.
1948 {"scroll-top-left-interop",
1949 IDS_FLAGS_SCROLL_TOP_LEFT_INTEROP_NAME,
1950 IDS_FLAGS_SCROLL_TOP_LEFT_INTEROP_DESCRIPTION,
1951 kOsAll,
1952 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kEnableBlinkFeatures,
1953 "ScrollTopLeftInterop",
1954 switches::kDisableBlinkFeatures,
1955 "ScrollTopLeftInterop")},
1956 #if defined(OS_WIN)
1957 {"try-supported-channel-layouts",
1958 IDS_FLAGS_TRY_SUPPORTED_CHANNEL_LAYOUTS_NAME,
1959 IDS_FLAGS_TRY_SUPPORTED_CHANNEL_LAYOUTS_DESCRIPTION,
1960 kOsWin,
1961 SINGLE_VALUE_TYPE(switches::kTrySupportedChannelLayouts)},
1962 #endif
1963 {"emphasize-titles-in-omnibox-dropdown",
1964 IDS_FLAGS_EMPHASIZE_TITLES_IN_OMNIBOX_DROPDOWN_NAME,
1965 IDS_FLAGS_EMPHASIZE_TITLES_IN_OMNIBOX_DROPDOWN_DESCRIPTION,
1966 kOsAll,
1967 SINGLE_VALUE_TYPE(switches::kEmphasizeTitlesInOmniboxDropdown)},
1968 #if defined(ENABLE_WEBRTC)
1969 {"enable-webrtc-dtls12",
1970 IDS_FLAGS_ENABLE_WEBRTC_DTLS12_NAME,
1971 IDS_FLAGS_ENABLE_WEBRTC_DTLS12_DESCRIPTION,
1972 kOsAll,
1973 SINGLE_VALUE_TYPE(switches::kEnableWebRtcDtls12)},
1974 #endif
1975 #if defined(OS_MACOSX)
1976 {"app-info-dialog",
1977 IDS_FLAGS_APP_INFO_DIALOG_NAME,
1978 IDS_FLAGS_APP_INFO_DIALOG_DESCRIPTION,
1979 kOsMac,
1980 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAppInfoDialogMac,
1981 switches::kDisableAppInfoDialogMac)},
1982 {"mac-views-native-app-windows",
1983 IDS_FLAGS_MAC_VIEWS_NATIVE_APP_WINDOWS_NAME,
1984 IDS_FLAGS_MAC_VIEWS_NATIVE_APP_WINDOWS_DESCRIPTION,
1985 kOsMac,
1986 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMacViewsNativeAppWindows,
1987 switches::kDisableMacViewsNativeAppWindows)},
1988 #endif
1989 #if defined(ENABLE_WEBVR)
1990 {"enable-webvr",
1991 IDS_FLAGS_ENABLE_WEBVR_NAME,
1992 IDS_FLAGS_ENABLE_WEBVR_DESCRIPTION,
1993 kOsAll,
1994 SINGLE_VALUE_TYPE(switches::kEnableWebVR)},
1995 #endif
1996 // NOTE: Adding new command-line switches requires adding corresponding
1997 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
1998 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2001 const Experiment* experiments = kExperiments;
2002 size_t num_experiments = arraysize(kExperiments);
2004 // Stores and encapsulates the little state that about:flags has.
2005 class FlagsState {
2006 public:
2007 FlagsState() : needs_restart_(false) {}
2008 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2009 base::CommandLine* command_line,
2010 SentinelsMode sentinels);
2011 bool IsRestartNeededToCommitChanges();
2012 void SetExperimentEnabled(
2013 FlagsStorage* flags_storage,
2014 const std::string& internal_name,
2015 bool enable);
2016 void RemoveFlagsSwitches(
2017 std::map<std::string, base::CommandLine::StringType>* switch_list);
2018 void ResetAllFlags(FlagsStorage* flags_storage);
2019 void reset();
2021 // Returns the singleton instance of this class
2022 static FlagsState* GetInstance() {
2023 return Singleton<FlagsState>::get();
2026 private:
2027 bool needs_restart_;
2028 std::map<std::string, std::string> flags_switches_;
2030 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2033 // Adds the internal names for the specified experiment to |names|.
2034 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2035 if (e.type == Experiment::SINGLE_VALUE ||
2036 e.type == Experiment::SINGLE_DISABLE_VALUE) {
2037 names->insert(e.internal_name);
2038 } else {
2039 DCHECK(e.type == Experiment::MULTI_VALUE ||
2040 e.type == Experiment::ENABLE_DISABLE_VALUE);
2041 for (int i = 0; i < e.num_choices; ++i)
2042 names->insert(e.NameForChoice(i));
2046 // Confirms that an experiment is valid, used in a DCHECK in
2047 // SanitizeList below.
2048 bool ValidateExperiment(const Experiment& e) {
2049 switch (e.type) {
2050 case Experiment::SINGLE_VALUE:
2051 case Experiment::SINGLE_DISABLE_VALUE:
2052 DCHECK_EQ(0, e.num_choices);
2053 DCHECK(!e.choices);
2054 break;
2055 case Experiment::MULTI_VALUE:
2056 DCHECK_GT(e.num_choices, 0);
2057 DCHECK(e.choices);
2058 DCHECK(e.choices[0].command_line_switch);
2059 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2060 break;
2061 case Experiment::ENABLE_DISABLE_VALUE:
2062 DCHECK_EQ(3, e.num_choices);
2063 DCHECK(!e.choices);
2064 DCHECK(e.command_line_switch);
2065 DCHECK(e.command_line_value);
2066 DCHECK(e.disable_command_line_switch);
2067 DCHECK(e.disable_command_line_value);
2068 break;
2069 default:
2070 NOTREACHED();
2072 return true;
2075 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2076 // unknown, to prevent this list to become very long as experiments are added
2077 // and removed.
2078 void SanitizeList(FlagsStorage* flags_storage) {
2079 std::set<std::string> known_experiments;
2080 for (size_t i = 0; i < num_experiments; ++i) {
2081 DCHECK(ValidateExperiment(experiments[i]));
2082 AddInternalName(experiments[i], &known_experiments);
2085 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2087 std::set<std::string> new_enabled_experiments =
2088 base::STLSetIntersection<std::set<std::string> >(
2089 known_experiments, enabled_experiments);
2091 if (new_enabled_experiments != enabled_experiments)
2092 flags_storage->SetFlags(new_enabled_experiments);
2095 void GetSanitizedEnabledFlags(
2096 FlagsStorage* flags_storage, std::set<std::string>* result) {
2097 SanitizeList(flags_storage);
2098 *result = flags_storage->GetFlags();
2101 bool SkipConditionalExperiment(const Experiment& experiment,
2102 FlagsStorage* flags_storage) {
2103 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2105 #if defined(OS_ANDROID)
2106 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2107 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2108 channel != chrome::VersionInfo::CHANNEL_BETA &&
2109 channel != chrome::VersionInfo::CHANNEL_DEV) {
2110 return true;
2112 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2113 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2114 channel != chrome::VersionInfo::CHANNEL_DEV) {
2115 return true;
2117 // enable-data-reduction-proxy-carrier-test is only available for Chromium
2118 // builds and the Canary/Dev channel.
2119 if (!strcmp("enable-data-reduction-proxy-carrier-test",
2120 experiment.internal_name) &&
2121 channel != chrome::VersionInfo::CHANNEL_DEV &&
2122 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2123 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2124 return true;
2126 #endif
2128 // data-reduction-proxy-lo-fi is only available for Chromium builds and
2129 // the Canary/Dev channel.
2130 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) &&
2131 channel != chrome::VersionInfo::CHANNEL_DEV &&
2132 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2133 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2134 return true;
2137 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2138 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2139 // builds and Canary/Dev channel.
2140 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2141 experiment.internal_name) &&
2142 channel != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2143 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2144 channel != chrome::VersionInfo::CHANNEL_DEV) {
2145 return true;
2147 #endif
2149 return false;
2153 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2154 // enabled on the current platform.
2155 void GetSanitizedEnabledFlagsForCurrentPlatform(
2156 FlagsStorage* flags_storage, std::set<std::string>* result) {
2157 GetSanitizedEnabledFlags(flags_storage, result);
2159 // Filter out any experiments that aren't enabled on the current platform. We
2160 // don't remove these from prefs else syncing to a platform with a different
2161 // set of experiments would be lossy.
2162 std::set<std::string> platform_experiments;
2163 int current_platform = GetCurrentPlatform();
2164 for (size_t i = 0; i < num_experiments; ++i) {
2165 if (experiments[i].supported_platforms & current_platform)
2166 AddInternalName(experiments[i], &platform_experiments);
2167 #if defined(OS_CHROMEOS)
2168 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2169 AddInternalName(experiments[i], &platform_experiments);
2170 #endif
2173 std::set<std::string> new_enabled_experiments =
2174 base::STLSetIntersection<std::set<std::string> >(
2175 platform_experiments, *result);
2177 result->swap(new_enabled_experiments);
2180 // Returns true if none of this experiment's options have been enabled.
2181 bool IsDefaultValue(
2182 const Experiment& experiment,
2183 const std::set<std::string>& enabled_experiments) {
2184 switch (experiment.type) {
2185 case Experiment::SINGLE_VALUE:
2186 case Experiment::SINGLE_DISABLE_VALUE:
2187 return enabled_experiments.count(experiment.internal_name) == 0;
2188 case Experiment::MULTI_VALUE:
2189 case Experiment::ENABLE_DISABLE_VALUE:
2190 for (int i = 0; i < experiment.num_choices; ++i) {
2191 if (enabled_experiments.count(experiment.NameForChoice(i)) > 0)
2192 return false;
2194 break;
2195 default:
2196 NOTREACHED();
2198 return true;
2201 // Returns the Value representing the choice data in the specified experiment.
2202 base::Value* CreateChoiceData(
2203 const Experiment& experiment,
2204 const std::set<std::string>& enabled_experiments) {
2205 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2206 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2207 base::ListValue* result = new base::ListValue;
2208 for (int i = 0; i < experiment.num_choices; ++i) {
2209 base::DictionaryValue* value = new base::DictionaryValue;
2210 const std::string name = experiment.NameForChoice(i);
2211 value->SetString("internal_name", name);
2212 value->SetString("description", experiment.DescriptionForChoice(i));
2213 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2214 result->Append(value);
2216 return result;
2219 } // namespace
2221 std::string Experiment::NameForChoice(int index) const {
2222 DCHECK(type == Experiment::MULTI_VALUE ||
2223 type == Experiment::ENABLE_DISABLE_VALUE);
2224 DCHECK_LT(index, num_choices);
2225 return std::string(internal_name) + testing::kMultiSeparator +
2226 base::IntToString(index);
2229 base::string16 Experiment::DescriptionForChoice(int index) const {
2230 DCHECK(type == Experiment::MULTI_VALUE ||
2231 type == Experiment::ENABLE_DISABLE_VALUE);
2232 DCHECK_LT(index, num_choices);
2233 int description_id;
2234 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2235 const int kEnableDisableDescriptionIds[] = {
2236 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2237 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2238 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2240 description_id = kEnableDisableDescriptionIds[index];
2241 } else {
2242 description_id = choices[index].description_id;
2244 return l10n_util::GetStringUTF16(description_id);
2247 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2248 base::CommandLine* command_line,
2249 SentinelsMode sentinels) {
2250 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2251 command_line,
2252 sentinels);
2255 bool AreSwitchesIdenticalToCurrentCommandLine(
2256 const base::CommandLine& new_cmdline,
2257 const base::CommandLine& active_cmdline,
2258 std::set<base::CommandLine::StringType>* out_difference) {
2259 std::set<base::CommandLine::StringType> new_flags =
2260 ExtractFlagsFromCommandLine(new_cmdline);
2261 std::set<base::CommandLine::StringType> active_flags =
2262 ExtractFlagsFromCommandLine(active_cmdline);
2264 bool result = false;
2265 // Needed because std::equal doesn't check if the 2nd set is empty.
2266 if (new_flags.size() == active_flags.size()) {
2267 result =
2268 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2271 if (out_difference && !result) {
2272 std::set_symmetric_difference(
2273 new_flags.begin(),
2274 new_flags.end(),
2275 active_flags.begin(),
2276 active_flags.end(),
2277 std::inserter(*out_difference, out_difference->begin()));
2280 return result;
2283 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2284 FlagAccess access,
2285 base::ListValue* supported_experiments,
2286 base::ListValue* unsupported_experiments) {
2287 std::set<std::string> enabled_experiments;
2288 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2290 int current_platform = GetCurrentPlatform();
2292 for (size_t i = 0; i < num_experiments; ++i) {
2293 const Experiment& experiment = experiments[i];
2294 if (SkipConditionalExperiment(experiment, flags_storage))
2295 continue;
2297 base::DictionaryValue* data = new base::DictionaryValue();
2298 data->SetString("internal_name", experiment.internal_name);
2299 data->SetString("name",
2300 l10n_util::GetStringUTF16(experiment.visible_name_id));
2301 data->SetString("description",
2302 l10n_util::GetStringUTF16(
2303 experiment.visible_description_id));
2305 base::ListValue* supported_platforms = new base::ListValue();
2306 AddOsStrings(experiment.supported_platforms, supported_platforms);
2307 data->Set("supported_platforms", supported_platforms);
2308 // True if the switch is not currently passed.
2309 bool is_default_value = IsDefaultValue(experiment, enabled_experiments);
2310 data->SetBoolean("is_default", is_default_value);
2312 switch (experiment.type) {
2313 case Experiment::SINGLE_VALUE:
2314 case Experiment::SINGLE_DISABLE_VALUE:
2315 data->SetBoolean(
2316 "enabled",
2317 (!is_default_value &&
2318 experiment.type == Experiment::SINGLE_VALUE) ||
2319 (is_default_value &&
2320 experiment.type == Experiment::SINGLE_DISABLE_VALUE));
2321 break;
2322 case Experiment::MULTI_VALUE:
2323 case Experiment::ENABLE_DISABLE_VALUE:
2324 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2325 break;
2326 default:
2327 NOTREACHED();
2330 bool supported = (experiment.supported_platforms & current_platform) != 0;
2331 #if defined(OS_CHROMEOS)
2332 if (access == kOwnerAccessToFlags &&
2333 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2334 supported = true;
2336 #endif
2337 if (supported)
2338 supported_experiments->Append(data);
2339 else
2340 unsupported_experiments->Append(data);
2344 bool IsRestartNeededToCommitChanges() {
2345 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2348 void SetExperimentEnabled(FlagsStorage* flags_storage,
2349 const std::string& internal_name,
2350 bool enable) {
2351 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2352 internal_name, enable);
2355 void RemoveFlagsSwitches(
2356 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2357 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2360 void ResetAllFlags(FlagsStorage* flags_storage) {
2361 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2364 int GetCurrentPlatform() {
2365 #if defined(OS_MACOSX)
2366 return kOsMac;
2367 #elif defined(OS_WIN)
2368 return kOsWin;
2369 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2370 return kOsCrOS;
2371 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2372 return kOsLinux;
2373 #elif defined(OS_ANDROID)
2374 return kOsAndroid;
2375 #else
2376 #error Unknown platform
2377 #endif
2380 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2381 std::set<std::string> flags = flags_storage->GetFlags();
2382 for (const std::string& flag : flags) {
2383 std::string action("AboutFlags_");
2384 action += flag;
2385 content::RecordComputedAction(action);
2387 // Since flag metrics are recorded every startup, add a tick so that the
2388 // stats can be made meaningful.
2389 if (flags.size())
2390 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2391 content::RecordAction(base::UserMetricsAction("StartupTick"));
2394 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2395 return static_cast<base::HistogramBase::Sample>(
2396 metrics::HashMetricName(switch_name));
2399 void ReportCustomFlags(const std::string& uma_histogram_hame,
2400 const std::set<std::string>& command_line_difference) {
2401 for (const std::string& flag : command_line_difference) {
2402 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2403 if (base::StartsWithASCII(flag, "--", true /* case_sensitive */)) {
2404 // Skip '--' before switch name.
2405 std::string switch_name(flag.substr(2));
2407 // Kill value, if any.
2408 const size_t value_pos = switch_name.find('=');
2409 if (value_pos != std::string::npos)
2410 switch_name.resize(value_pos);
2412 uma_id = GetSwitchUMAId(switch_name);
2413 } else {
2414 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2415 << "' has incorrect format.";
2417 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2418 << "' '" << flag << "', uma_id=" << uma_id;
2420 // Sparse histogram macro does not cache the histogram, so it's safe
2421 // to use macro with non-static histogram name here.
2422 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2426 //////////////////////////////////////////////////////////////////////////////
2427 // FlagsState implementation.
2429 namespace {
2431 typedef std::map<std::string, std::pair<std::string, std::string> >
2432 NameToSwitchAndValueMap;
2434 void SetFlagToSwitchMapping(const std::string& key,
2435 const std::string& switch_name,
2436 const std::string& switch_value,
2437 NameToSwitchAndValueMap* name_to_switch_map) {
2438 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2439 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2442 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2443 base::CommandLine* command_line,
2444 SentinelsMode sentinels) {
2445 if (command_line->HasSwitch(switches::kNoExperiments))
2446 return;
2448 std::set<std::string> enabled_experiments;
2450 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2451 &enabled_experiments);
2453 NameToSwitchAndValueMap name_to_switch_map;
2454 for (size_t i = 0; i < num_experiments; ++i) {
2455 const Experiment& e = experiments[i];
2456 if (e.type == Experiment::SINGLE_VALUE ||
2457 e.type == Experiment::SINGLE_DISABLE_VALUE) {
2458 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2459 e.command_line_value, &name_to_switch_map);
2460 } else if (e.type == Experiment::MULTI_VALUE) {
2461 for (int j = 0; j < e.num_choices; ++j) {
2462 SetFlagToSwitchMapping(e.NameForChoice(j),
2463 e.choices[j].command_line_switch,
2464 e.choices[j].command_line_value,
2465 &name_to_switch_map);
2467 } else {
2468 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2469 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2470 &name_to_switch_map);
2471 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2472 e.command_line_value, &name_to_switch_map);
2473 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2474 e.disable_command_line_value, &name_to_switch_map);
2478 if (sentinels == kAddSentinels) {
2479 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2480 flags_switches_.insert(
2481 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2482 std::string()));
2484 for (const std::string& experiment_name : enabled_experiments) {
2485 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2486 name_to_switch_map.find(experiment_name);
2487 if (name_to_switch_it == name_to_switch_map.end()) {
2488 NOTREACHED();
2489 continue;
2492 const std::pair<std::string, std::string>&
2493 switch_and_value_pair = name_to_switch_it->second;
2495 CHECK(!switch_and_value_pair.first.empty());
2496 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2497 switch_and_value_pair.second);
2498 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2500 if (sentinels == kAddSentinels) {
2501 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2502 flags_switches_.insert(
2503 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2504 std::string()));
2508 bool FlagsState::IsRestartNeededToCommitChanges() {
2509 return needs_restart_;
2512 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2513 const std::string& internal_name,
2514 bool enable) {
2515 size_t at_index = internal_name.find(testing::kMultiSeparator);
2516 if (at_index != std::string::npos) {
2517 DCHECK(enable);
2518 // We're being asked to enable a multi-choice experiment. Disable the
2519 // currently selected choice.
2520 DCHECK_NE(at_index, 0u);
2521 const std::string experiment_name = internal_name.substr(0, at_index);
2522 SetExperimentEnabled(flags_storage, experiment_name, false);
2524 // And enable the new choice, if it is not the default first choice.
2525 if (internal_name != experiment_name + "@0") {
2526 std::set<std::string> enabled_experiments;
2527 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2528 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2529 flags_storage->SetFlags(enabled_experiments);
2531 return;
2534 std::set<std::string> enabled_experiments;
2535 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2537 const Experiment* e = NULL;
2538 for (size_t i = 0; i < num_experiments; ++i) {
2539 if (experiments[i].internal_name == internal_name) {
2540 e = experiments + i;
2541 break;
2544 DCHECK(e);
2546 if (e->type == Experiment::SINGLE_VALUE) {
2547 if (enable)
2548 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2549 else
2550 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2551 } else if (e->type == Experiment::SINGLE_DISABLE_VALUE) {
2552 if (!enable)
2553 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2554 else
2555 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2556 } else {
2557 if (enable) {
2558 // Enable the first choice.
2559 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2560 } else {
2561 // Find the currently enabled choice and disable it.
2562 for (int i = 0; i < e->num_choices; ++i) {
2563 std::string choice_name = e->NameForChoice(i);
2564 if (enabled_experiments.find(choice_name) !=
2565 enabled_experiments.end()) {
2566 needs_restart_ = true;
2567 enabled_experiments.erase(choice_name);
2568 // Continue on just in case there's a bug and more than one
2569 // experiment for this choice was enabled.
2575 flags_storage->SetFlags(enabled_experiments);
2578 void FlagsState::RemoveFlagsSwitches(
2579 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2580 for (const auto& entry : flags_switches_)
2581 switch_list->erase(entry.first);
2584 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2585 needs_restart_ = true;
2587 std::set<std::string> no_experiments;
2588 flags_storage->SetFlags(no_experiments);
2591 void FlagsState::reset() {
2592 needs_restart_ = false;
2593 flags_switches_.clear();
2596 } // namespace
2598 namespace testing {
2600 // WARNING: '@' is also used in the html file. If you update this constant you
2601 // also need to update the html file.
2602 const char kMultiSeparator[] = "@";
2604 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2606 void ClearState() {
2607 FlagsState::GetInstance()->reset();
2610 void SetExperiments(const Experiment* e, size_t count) {
2611 if (!e) {
2612 experiments = kExperiments;
2613 num_experiments = arraysize(kExperiments);
2614 } else {
2615 experiments = e;
2616 num_experiments = count;
2620 const Experiment* GetExperiments(size_t* count) {
2621 *count = num_experiments;
2622 return experiments;
2625 } // namespace testing
2627 } // namespace about_flags