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