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