Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
blob58ff3a4c7972d5d36ae1bf7cf6b6f2c068c58c29
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 #if defined(ENABLE_EXTENSIONS)
805 {"enable-ble-advertising-in-apps",
806 IDS_FLAGS_BLE_ADVERTISING_IN_EXTENSIONS_NAME,
807 IDS_FLAGS_BLE_ADVERTISING_IN_EXTENSIONS_DESCRIPTION,
808 kOsCrOS,
809 SINGLE_VALUE_TYPE(extensions::switches::kEnableBLEAdvertising)},
810 #endif
811 {"enable-devtools-experiments",
812 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
813 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
814 kOsDesktop,
815 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)},
816 {"silent-debugger-extension-api",
817 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
818 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
819 kOsDesktop,
820 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)},
821 #if defined(ENABLE_SPELLCHECK)
822 #if defined(OS_ANDROID)
823 {"enable-android-spellchecker",
824 IDS_OPTIONS_ENABLE_SPELLCHECK,
825 IDS_OPTIONS_ENABLE_ANDROID_SPELLCHECKER_DESCRIPTION,
826 kOsAndroid,
827 SINGLE_VALUE_TYPE(switches::kEnableAndroidSpellChecker)},
828 #endif
829 {"spellcheck-autocorrect",
830 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
831 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
832 kOsWin | kOsLinux | kOsCrOS,
833 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)},
834 #endif
835 #if defined(ENABLE_SPELLCHECK) && \
836 (defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS))
837 {"enable-multilingual-spellchecker",
838 IDS_FLAGS_ENABLE_MULTILINGUAL_SPELLCHECKER_NAME,
839 IDS_FLAGS_ENABLE_MULTILINGUAL_SPELLCHECKER_DESCRIPTION,
840 kOsWin | kOsLinux | kOsCrOS,
841 SINGLE_VALUE_TYPE(switches::kEnableMultilingualSpellChecker)},
842 #endif
843 {"enable-scroll-prediction",
844 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
845 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
846 kOsDesktop,
847 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)},
848 #if defined(ENABLE_TOPCHROME_MD)
849 {"top-chrome-md",
850 IDS_FLAGS_TOP_CHROME_MD,
851 IDS_FLAGS_TOP_CHROME_MD_DESCRIPTION,
852 kOsWin | kOsLinux | kOsCrOS,
853 MULTI_VALUE_TYPE(kTopChromeMaterialDesignChoices)},
854 #endif
855 {"touch-events",
856 IDS_TOUCH_EVENTS_NAME,
857 IDS_TOUCH_EVENTS_DESCRIPTION,
858 kOsDesktop,
859 MULTI_VALUE_TYPE(kTouchEventsChoices)},
860 {"disable-touch-adjustment",
861 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
862 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
863 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
864 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)},
865 #if defined(OS_CHROMEOS)
866 {"network-portal-notification",
867 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
868 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
869 kOsCrOS,
870 ENABLE_DISABLE_VALUE_TYPE(
871 chromeos::switches::kEnableNetworkPortalNotification,
872 chromeos::switches::kDisableNetworkPortalNotification)},
873 #endif
874 {"enable-download-resumption",
875 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
876 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
877 kOsDesktop,
878 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)},
879 {"enable-download-notification",
880 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_NAME,
881 IDS_FLAGS_ENABLE_DOWNLOAD_NOTIFICATION_DESCRIPTION,
882 kOsDesktop,
883 MULTI_VALUE_TYPE(kDownloadNotificationChoices)},
884 #if defined(ENABLE_PLUGINS)
885 {"allow-nacl-socket-api",
886 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
887 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
888 kOsDesktop,
889 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")},
890 #endif
891 #if defined(OS_CHROMEOS)
892 {"allow-touchpad-three-finger-click",
893 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
894 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
895 kOsCrOS,
896 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)},
897 {"ash-enable-unified-desktop",
898 IDS_FLAGS_ASH_ENABLE_UNIFIED_DESKTOP_NAME,
899 IDS_FLAGS_ASH_ENABLE_UNIFIED_DESKTOP_DESCRIPTION,
900 kOsCrOS,
901 SINGLE_VALUE_TYPE(ash::switches::kAshEnableUnifiedDesktop)},
902 {"enable-easy-unlock-proximity-detection",
903 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_NAME,
904 IDS_FLAGS_ENABLE_EASY_UNLOCK_PROXIMITY_DETECTION_DESCRIPTION,
905 kOsCrOS,
906 SINGLE_VALUE_TYPE(proximity_auth::switches::kEnableProximityDetection)},
907 {"enable-easy-unlock-bluetooth-low-energy-detection",
908 IDS_FLAGS_ENABLE_EASY_UNLOCK_BLUETOOTH_LOW_ENERGY_DISCOVERY_NAME,
909 IDS_FLAGS_ENABLE_EASY_UNLOCK_BLUETOOTH_LOW_ENERGY_DISCOVERY_DESCRIPTION,
910 kOsCrOS,
911 SINGLE_VALUE_TYPE(
912 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)},
913 #endif
914 #if defined(USE_ASH)
915 {"disable-minimize-on-second-launcher-item-click",
916 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
917 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
918 kOsAll,
919 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)},
920 {"show-touch-hud",
921 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
922 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
923 kOsAll,
924 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
926 "enable-pinch",
927 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
928 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
929 kOsLinux | kOsWin | kOsCrOS,
930 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
932 #endif // defined(USE_ASH)
933 #if defined(OS_CHROMEOS)
935 "disable-boot-animation",
936 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
937 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
938 kOsCrOSOwnerOnly,
939 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
941 {"enable-video-player-chromecast-support",
942 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
943 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
944 kOsCrOS,
945 SINGLE_VALUE_TYPE(
946 chromeos::switches::kEnableVideoPlayerChromecastSupport)},
948 "disable-office-editing-component-app",
949 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
950 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
951 kOsCrOS,
952 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
955 "disable-display-color-calibration",
956 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
957 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
958 kOsCrOS,
959 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
962 "ash-disable-screen-orientation-lock",
963 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_NAME,
964 IDS_FLAGS_ASH_DISABLE_SCREEN_ORIENTATION_LOCK_DESCRIPTION,
965 kOsCrOS,
966 SINGLE_VALUE_TYPE(ash::switches::kAshDisableScreenOrientationLock),
968 #endif // defined(OS_CHROMEOS)
970 "disable-accelerated-video-decode",
971 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
972 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
973 kOsMac | kOsWin | kOsCrOS,
974 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
976 #if defined(USE_ASH)
978 "ash-debug-shortcuts",
979 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
980 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
981 kOsAll,
982 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
985 "ash-disable-maximize-mode-window-backdrop",
986 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME,
987 IDS_FLAGS_ASH_DISABLE_MAXIMIZE_MODE_WINDOW_BACKDROP_DESCRIPTION,
988 kOsCrOS,
989 SINGLE_VALUE_TYPE(ash::switches::kAshDisableMaximizeModeWindowBackdrop),
992 "ash-enable-touch-view-testing",
993 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
994 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
995 kOsCrOS,
996 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
999 "disable-touch-feedback",
1000 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_NAME,
1001 IDS_FLAGS_DISABLE_TOUCH_FEEDBACK_DESCRIPTION,
1002 kOsCrOS,
1003 SINGLE_VALUE_TYPE(switches::kDisableTouchFeedback),
1006 "ash-enable-mirrored-screen",
1007 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_NAME,
1008 IDS_FLAGS_ASH_ENABLE_MIRRORED_SCREEN_DESCRIPTION,
1009 kOsCrOS,
1010 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMirroredScreen),
1013 "ash-stable-overview-order",
1014 IDS_FLAGS_ASH_STABLE_OVERVIEW_ORDER_NAME,
1015 IDS_FLAGS_ASH_STABLE_OVERVIEW_ORDER_DESCRIPTION,
1016 kOsCrOS,
1017 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableStableOverviewOrder,
1018 ash::switches::kAshDisableStableOverviewOrder),
1020 #endif // defined(USE_ASH)
1021 #if defined(OS_CHROMEOS)
1022 {"material-design-ink-drop",
1023 IDS_FLAGS_MATERIAL_DESIGN_INK_DROP_NAME,
1024 IDS_FLAGS_MATERIAL_DESIGN_INK_DROP_DESCRIPTION,
1025 kOsCrOS,
1026 MULTI_VALUE_TYPE(kAshMaterialDesignInkDrop)},
1027 {"material-design-ink-drop-animation-speed",
1028 IDS_FLAGS_MATERIAL_DESIGN_INK_DROP_ANIMATION_SPEED_NAME,
1029 IDS_FLAGS_MATERIAL_DESIGN_INK_DROP_ANIMATION_SPEED_DESCRIPTION,
1030 kOsCrOS,
1031 MULTI_VALUE_TYPE(kAshMaterialDesignInkDropAnimationSpeed)},
1032 {"disable-cloud-import",
1033 IDS_FLAGS_DISABLE_CLOUD_IMPORT,
1034 IDS_FLAGS_DISABLE_CLOUD_IMPORT_DESCRIPTION,
1035 kOsCrOS,
1036 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCloudImport)},
1037 {"enable-request-tablet-site",
1038 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1039 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1040 kOsCrOS,
1041 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)},
1042 #endif
1043 {"debug-packed-apps",
1044 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1045 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1046 kOsDesktop,
1047 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)},
1048 {"enable-password-generation",
1049 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1050 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1051 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1052 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1053 autofill::switches::kDisablePasswordGeneration)},
1054 {"enable-automatic-password-saving",
1055 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1056 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1057 kOsDesktop,
1058 SINGLE_VALUE_TYPE(
1059 password_manager::switches::kEnableAutomaticPasswordSaving)},
1060 {"password-manager-reauthentication",
1061 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1062 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1063 kOsMac | kOsWin,
1064 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)},
1065 {"enable-password-change-support",
1066 IDS_FLAGS_ENABLE_PASSWORD_CHANGE_SUPPORT_NAME,
1067 IDS_FLAGS_ENABLE_PASSWORD_CHANGE_SUPPORT_DESCRIPTION,
1068 kOsMac,
1069 SINGLE_VALUE_TYPE(
1070 password_manager::switches::kEnablePasswordChangeSupport)},
1071 {"enable-password-force-saving",
1072 IDS_FLAGS_ENABLE_PASSWORD_FORCE_SAVING_NAME,
1073 IDS_FLAGS_ENABLE_PASSWORD_FORCE_SAVING_DESCRIPTION,
1074 kOsAll,
1075 SINGLE_VALUE_TYPE(password_manager::switches::kEnablePasswordForceSaving)},
1076 {"enable-password-link",
1077 IDS_FLAGS_PASSWORD_MANAGER_LINK_NAME,
1078 IDS_FLAGS_PASSWORD_MANAGER_LINK_DESCRIPTION,
1079 kOsAndroid | kOsDesktop,
1080 ENABLE_DISABLE_VALUE_TYPE(
1081 password_manager::switches::kEnablePasswordLink,
1082 password_manager::switches::kDisablePasswordLink)},
1083 {"enable-affiliation-based-matching",
1084 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_NAME,
1085 IDS_FLAGS_ENABLE_AFFILIATION_BASED_MATCHING_DESCRIPTION,
1086 kOsWin | kOsLinux | kOsCrOS | kOsMac | kOsAndroid,
1087 ENABLE_DISABLE_VALUE_TYPE(
1088 password_manager::switches::kEnableAffiliationBasedMatching,
1089 password_manager::switches::kDisableAffiliationBasedMatching)},
1090 {"wallet-service-use-sandbox",
1091 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1092 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1093 kOsAndroid | kOsDesktop,
1094 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1095 autofill::switches::kWalletServiceUseSandbox,
1096 "1",
1097 autofill::switches::kWalletServiceUseSandbox,
1098 "0")},
1099 #if defined(USE_AURA)
1100 {"overscroll-history-navigation",
1101 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1102 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1103 kOsAll,
1104 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)},
1105 #endif
1106 {"scroll-end-effect",
1107 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1108 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1109 kOsCrOS,
1110 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScrollEndEffect,
1111 "1",
1112 switches::kScrollEndEffect,
1113 "0")},
1114 {"enable-icon-ntp",
1115 IDS_FLAGS_ENABLE_ICON_NTP_NAME,
1116 IDS_FLAGS_ENABLE_ICON_NTP_DESCRIPTION,
1117 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1118 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableIconNtp,
1119 switches::kDisableIconNtp)},
1120 {"enable-touch-drag-drop",
1121 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1122 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1123 kOsWin | kOsCrOS,
1124 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1125 switches::kDisableTouchDragDrop)},
1126 {"enable-touch-editing",
1127 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1128 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1129 kOsCrOS | kOsWin | kOsLinux,
1130 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1131 switches::kDisableTouchEditing)},
1132 {"touch-selection-strategy",
1133 IDS_FLAGS_TOUCH_SELECTION_STRATEGY_NAME,
1134 IDS_FLAGS_TOUCH_SELECTION_STRATEGY_DESCRIPTION,
1135 kOsAndroid, // TODO(mfomitchev): Add CrOS/Win/Linux support soon.
1136 MULTI_VALUE_TYPE(kTouchTextSelectionStrategyChoices)},
1137 {"enable-suggestions-service",
1138 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1139 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1140 kOsAndroid | kOsCrOS,
1141 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1142 switches::kDisableSuggestionsService)},
1143 {"enable-suggestions-with-substring-match",
1144 IDS_FLAGS_ENABLE_SUGGESTIONS_WITH_SUB_STRING_MATCH_NAME,
1145 IDS_FLAGS_ENABLE_SUGGESTIONS_WITH_SUB_STRING_MATCH_DESCRIPTION,
1146 kOsAll,
1147 SINGLE_VALUE_TYPE(
1148 autofill::switches::kEnableSuggestionsWithSubstringMatch)},
1149 {"enable-supervised-user-managed-bookmarks-folder",
1150 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_NAME,
1151 IDS_FLAGS_ENABLE_SUPERVISED_USER_MANAGED_BOOKMARKS_FOLDER_DESCRIPTION,
1152 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1153 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserManagedBookmarksFolder)},
1154 #if defined(ENABLE_APP_LIST)
1155 {"enable-sync-app-list",
1156 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1157 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1158 kOsDesktop,
1159 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableSyncAppList,
1160 app_list::switches::kDisableSyncAppList)},
1161 #endif
1162 #if defined(OS_MACOSX)
1163 {"enable-avfoundation",
1164 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1165 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1166 kOsMac,
1167 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAVFoundation,
1168 switches::kForceQTKit)},
1169 #endif
1170 {"lcd-text-aa",
1171 IDS_FLAGS_LCD_TEXT_NAME,
1172 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1173 kOsDesktop,
1174 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLCDText,
1175 switches::kDisableLCDText)},
1176 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1177 {"delegated-renderer",
1178 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1179 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1180 kOsAndroid, // TODO(ccameron) Add mac support soon.
1181 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDelegatedRenderer,
1182 switches::kDisableDelegatedRenderer)},
1183 #endif
1184 {"enable-offer-store-unmasked-wallet-cards",
1185 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS,
1186 IDS_FLAGS_ENABLE_OFFER_STORE_UNMASKED_WALLET_CARDS_DESCRIPTION,
1187 kOsAll,
1188 ENABLE_DISABLE_VALUE_TYPE(
1189 autofill::switches::kEnableOfferStoreUnmaskedWalletCards,
1190 autofill::switches::kDisableOfferStoreUnmaskedWalletCards)},
1191 {"enable-offline-auto-reload",
1192 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1193 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1194 kOsAll,
1195 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1196 switches::kDisableOfflineAutoReload)},
1197 {"enable-offline-auto-reload-visible-only",
1198 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1199 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1200 kOsAll,
1201 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1202 switches::kDisableOfflineAutoReloadVisibleOnly)},
1203 {"show-saved-copy",
1204 IDS_FLAGS_SHOW_SAVED_COPY_NAME,
1205 IDS_FLAGS_SHOW_SAVED_COPY_DESCRIPTION,
1206 kOsAll,
1207 MULTI_VALUE_TYPE(kShowSavedCopyChoices)},
1208 {"default-tile-width",
1209 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1210 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1211 kOsAll,
1212 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)},
1213 {"default-tile-height",
1214 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1215 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1216 kOsAll,
1217 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)},
1218 #if defined(OS_ANDROID)
1219 {"disable-gesture-requirement-for-media-playback",
1220 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1221 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1222 kOsAndroid,
1223 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)},
1224 #endif
1225 #if defined(OS_CHROMEOS)
1226 {"enable-virtual-keyboard",
1227 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1228 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1229 kOsCrOS,
1230 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)},
1231 {"enable-virtual-keyboard-overscroll",
1232 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1233 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1234 kOsCrOS,
1235 ENABLE_DISABLE_VALUE_TYPE(
1236 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1237 keyboard::switches::kDisableVirtualKeyboardOverscroll)},
1238 {"enable-input-view",
1239 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1240 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1241 kOsCrOS,
1242 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1243 keyboard::switches::kDisableInputView)},
1244 {"disable-new-korean-ime",
1245 IDS_FLAGS_DISABLE_NEW_KOREAN_IME_NAME,
1246 IDS_FLAGS_DISABLE_NEW_KOREAN_IME_DESCRIPTION,
1247 kOsCrOS,
1248 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewKoreanIme)},
1249 {"enable-physical-keyboard-autocorrect",
1250 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_NAME,
1251 IDS_FLAGS_ENABLE_PHYSICAL_KEYBOARD_AUTOCORRECT_DESCRIPTION,
1252 kOsCrOS,
1253 ENABLE_DISABLE_VALUE_TYPE(
1254 chromeos::switches::kEnablePhysicalKeyboardAutocorrect,
1255 chromeos::switches::kDisablePhysicalKeyboardAutocorrect)},
1256 {"disable-voice-input",
1257 IDS_FLAGS_DISABLE_VOICE_INPUT_NAME,
1258 IDS_FLAGS_DISABLE_VOICE_INPUT_DESCRIPTION,
1259 kOsCrOS,
1260 SINGLE_VALUE_TYPE(keyboard::switches::kDisableVoiceInput)},
1261 {"enable-experimental-input-view-features",
1262 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1263 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1264 kOsCrOS,
1265 SINGLE_VALUE_TYPE(
1266 keyboard::switches::kEnableExperimentalInputViewFeatures)},
1267 {"floating-virtual-keyboard",
1268 IDS_FLAGS_FLOATING_VIRTUAL_KEYBOARD_NAME,
1269 IDS_FLAGS_FLOATING_VIRTUAL_KEYBOARD_DESCRIPTION,
1270 kOsCrOS,
1271 MULTI_VALUE_TYPE(kFloatingVirtualKeyboardChoices)},
1272 {"smart-virtual-keyboard",
1273 IDS_FLAGS_SMART_VIRTUAL_KEYBOARD_NAME,
1274 IDS_FLAGS_SMART_VIRTUAL_KEYBOARD_DESCRIPTION,
1275 kOsCrOS,
1276 MULTI_VALUE_TYPE(kSmartVirtualKeyboardChoices)},
1277 {"gesture-typing",
1278 IDS_FLAGS_GESTURE_TYPING_NAME,
1279 IDS_FLAGS_GESTURE_TYPING_DESCRIPTION,
1280 kOsCrOS,
1281 MULTI_VALUE_TYPE(kGestureTypingChoices)},
1282 {"gesture-editing",
1283 IDS_FLAGS_GESTURE_EDITING_NAME,
1284 IDS_FLAGS_GESTURE_EDITING_DESCRIPTION,
1285 kOsCrOS,
1286 MULTI_VALUE_TYPE(kGestureEditingChoices)},
1287 {"enable-fullscreen-app-list",
1288 IDS_FLAGS_FULLSCREEN_APP_LIST_NAME,
1289 IDS_FLAGS_FULLSCREEN_APP_LIST_DESCRIPTION,
1290 kOsCrOS,
1291 SINGLE_VALUE_TYPE(ash::switches::kAshEnableFullscreenAppList)},
1292 #endif
1293 {"enable-simple-cache-backend",
1294 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1295 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1296 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1297 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)},
1298 {"enable-tcp-fast-open",
1299 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1300 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1301 kOsLinux | kOsCrOS | kOsAndroid,
1302 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)},
1303 #if defined(ENABLE_SERVICE_DISCOVERY)
1304 {"device-discovery-notifications",
1305 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1306 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1307 kOsDesktop,
1308 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1309 switches::kDisableDeviceDiscoveryNotifications)},
1310 {"enable-print-preview-register-promos",
1311 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1312 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1313 kOsDesktop,
1314 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)},
1315 #endif // ENABLE_SERVICE_DISCOVERY
1316 #if defined(OS_WIN)
1317 {"enable-cloud-print-xps",
1318 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1319 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1320 kOsWin,
1321 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)},
1322 #endif
1323 #if defined(USE_AURA)
1324 {"tab-capture-upscale-quality",
1325 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1326 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1327 kOsAll,
1328 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)},
1329 {"tab-capture-downscale-quality",
1330 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1331 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1332 kOsAll,
1333 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)},
1334 #endif
1335 #if defined(TOOLKIT_VIEWS)
1336 {"disable-hide-inactive-stacked-tab-close-buttons",
1337 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_NAME,
1338 IDS_FLAGS_DISABLE_HIDE_INACTIVE_STACKED_TAB_CLOSE_BUTTONS_DESCRIPTION,
1339 kOsCrOS | kOsWin | kOsLinux,
1340 SINGLE_VALUE_TYPE(switches::kDisableHideInactiveStackedTabCloseButtons)},
1341 #endif
1342 #if defined(ENABLE_SPELLCHECK)
1343 {"enable-spelling-feedback-field-trial",
1344 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1345 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1346 kOsAll,
1347 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)},
1348 #endif
1349 {"enable-webgl-draft-extensions",
1350 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1351 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1352 kOsAll,
1353 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)},
1354 {"enable-new-profile-management",
1355 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1356 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1357 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1358 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1359 switches::kDisableNewProfileManagement)},
1360 {"enable-account-consistency",
1361 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1362 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1363 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1364 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1365 switches::kDisableAccountConsistency)},
1366 {"enable-iframe-based-signin",
1367 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_NAME,
1368 IDS_FLAGS_ENABLE_IFRAME_BASED_SIGNIN_DESCRIPTION,
1369 kOsMac | kOsWin | kOsLinux,
1370 SINGLE_VALUE_TYPE(switches::kEnableIframeBasedSignin)},
1371 {"enable-google-profile-info",
1372 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1373 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1374 kOsMac | kOsWin | kOsLinux,
1375 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)},
1376 #if defined(ENABLE_APP_LIST)
1377 {"reset-app-list-install-state",
1378 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1379 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1380 kOsMac | kOsWin | kOsLinux,
1381 SINGLE_VALUE_TYPE(app_list::switches::kResetAppListInstallState)},
1382 #endif
1383 #if defined(OS_ANDROID)
1384 {"enable-accessibility-tab-switcher",
1385 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1386 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1387 kOsAndroid,
1388 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)},
1389 {// TODO(dmazzoni): remove this flag when native android accessibility
1390 // ships in the stable channel. http://crbug.com/356775
1391 "enable-accessibility-script-injection",
1392 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1393 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1394 kOsAndroid,
1395 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1396 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")},
1397 #endif
1398 {"enable-zero-copy",
1399 IDS_FLAGS_ENABLE_ZERO_COPY_NAME,
1400 IDS_FLAGS_ENABLE_ZERO_COPY_DESCRIPTION,
1401 kOsAll,
1402 SINGLE_VALUE_TYPE(switches::kEnableZeroCopy)},
1403 #if defined(OS_CHROMEOS)
1404 {"enable-first-run-ui-transitions",
1405 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1406 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1407 kOsCrOS,
1408 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)},
1409 #endif
1410 {"disable-new-bookmark-apps",
1411 IDS_FLAGS_NEW_BOOKMARK_APPS_NAME,
1412 IDS_FLAGS_NEW_BOOKMARK_APPS_DESCRIPTION,
1413 kOsWin | kOsCrOS | kOsLinux | kOsMac,
1414 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewBookmarkApps,
1415 switches::kDisableNewBookmarkApps)},
1416 #if defined(OS_MACOSX)
1417 {"disable-hosted-apps-in-windows",
1418 IDS_FLAGS_HOSTED_APPS_IN_WINDOWS_NAME,
1419 IDS_FLAGS_HOSTED_APPS_IN_WINDOWS_DESCRIPTION,
1420 kOsMac,
1421 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableHostedAppsInWindows,
1422 switches::kDisableHostedAppsInWindows)},
1423 {"disable-hosted-app-shim-creation",
1424 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_NAME,
1425 IDS_FLAGS_DISABLE_HOSTED_APP_SHIM_CREATION_DESCRIPTION,
1426 kOsMac,
1427 SINGLE_VALUE_TYPE(switches::kDisableHostedAppShimCreation)},
1428 {"enable-hosted-app-quit-notification",
1429 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_NAME,
1430 IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION,
1431 kOsMac,
1432 SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
1433 #endif
1434 {"enable-ephemeral-apps-in-webstore",
1435 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
1436 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
1437 kOsAll,
1438 SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)},
1439 #if defined(OS_ANDROID)
1440 {"disable-pull-to-refresh-effect",
1441 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
1442 IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_DESCRIPTION,
1443 kOsAndroid,
1444 SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)},
1445 #endif
1446 #if defined(OS_MACOSX)
1447 {"enable-translate-new-ux",
1448 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1449 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1450 kOsMac,
1451 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTranslateNewUX,
1452 switches::kDisableTranslateNewUX)},
1453 #endif
1454 #if defined(TOOLKIT_VIEWS)
1455 {"disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1456 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1457 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1458 kOsCrOS | kOsWin | kOsLinux,
1459 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)},
1460 {"enable-link-disambiguation-popup",
1461 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_NAME,
1462 IDS_FLAGS_ENABLE_LINK_DISAMBIGUATION_POPUP_DESCRIPTION,
1463 kOsCrOS | kOsWin,
1464 SINGLE_VALUE_TYPE(switches::kEnableLinkDisambiguationPopup)},
1465 #endif
1466 #if defined(ENABLE_EXTENSIONS)
1467 {"enable-apps-show-on-first-paint",
1468 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1469 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1470 kOsDesktop,
1471 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)},
1472 #endif
1473 {"enhanced-bookmarks-experiment",
1474 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1475 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1476 kOsDesktop | kOsAndroid,
1477 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kEnhancedBookmarksExperiment,
1478 "1",
1479 switches::kEnhancedBookmarksExperiment,
1480 "0")},
1481 #if defined(OS_ANDROID)
1482 {"reader-mode-heuristics",
1483 IDS_FLAGS_READER_MODE_HEURISTICS_NAME,
1484 IDS_FLAGS_READER_MODE_HEURISTICS_DESCRIPTION,
1485 kOsAndroid,
1486 MULTI_VALUE_TYPE(kReaderModeHeuristicsChoices)},
1487 {"enable-reader-mode-toolbar-icon",
1488 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1489 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1490 kOsAndroid,
1491 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)},
1492 {"enable-dom-distiller-button-animation",
1493 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION,
1494 IDS_FLAGS_READER_MODE_BUTTON_ANIMATION_DESCRIPTION,
1495 kOsAndroid,
1496 SINGLE_VALUE_TYPE(switches::kEnableDomDistillerButtonAnimation)},
1497 #endif
1498 {"num-raster-threads",
1499 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1500 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1501 kOsAll,
1502 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)},
1503 {"enable-single-click-autofill",
1504 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_NAME,
1505 IDS_FLAGS_ENABLE_SINGLE_CLICK_AUTOFILL_DESCRIPTION,
1506 kOsCrOS | kOsMac | kOsWin | kOsLinux | kOsAndroid,
1507 ENABLE_DISABLE_VALUE_TYPE(
1508 autofill::switches::kEnableSingleClickAutofill,
1509 autofill::switches::kDisableSingleClickAutofill)},
1510 {"enable-site-engagement-service",
1511 IDS_FLAGS_ENABLE_SITE_ENGAGEMENT_SERVICE_NAME,
1512 IDS_FLAGS_ENABLE_SITE_ENGAGEMENT_SERVICE_DESCRIPTION,
1513 kOsAll,
1514 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSiteEngagementService,
1515 switches::kDisableSiteEngagementService)},
1516 {"enable-session-crashed-bubble",
1517 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1518 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1519 kOsWin | kOsLinux,
1520 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1521 switches::kDisableSessionCrashedBubble)},
1522 {"enable-pdf-material-ui",
1523 IDS_FLAGS_PDF_MATERIAL_UI_NAME,
1524 IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
1525 kOsDesktop,
1526 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePdfMaterialUI,
1527 switches::kDisablePdfMaterialUI)},
1528 {"disable-cast-streaming-hw-encoding",
1529 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_NAME,
1530 IDS_FLAGS_DISABLE_CAST_STREAMING_HW_ENCODING_DESCRIPTION,
1531 kOsAll,
1532 SINGLE_VALUE_TYPE(switches::kDisableCastStreamingHWEncoding)},
1533 #if defined(OS_ANDROID)
1534 {"prefetch-search-results",
1535 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1536 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1537 kOsAndroid,
1538 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)},
1539 #endif
1540 #if defined(ENABLE_APP_LIST)
1541 {"enable-experimental-app-list",
1542 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1543 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1544 kOsWin | kOsLinux | kOsCrOS,
1545 ENABLE_DISABLE_VALUE_TYPE(
1546 app_list::switches::kEnableExperimentalAppList,
1547 app_list::switches::kDisableExperimentalAppList)},
1548 {"enable-centered-app-list",
1549 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1550 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1551 kOsWin | kOsLinux | kOsCrOS,
1552 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)},
1553 {"enable-new-app-list-mixer",
1554 IDS_FLAGS_ENABLE_NEW_APP_LIST_MIXER_NAME,
1555 IDS_FLAGS_ENABLE_NEW_APP_LIST_MIXER_DESCRIPTION,
1556 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1557 ENABLE_DISABLE_VALUE_TYPE(app_list::switches::kEnableNewAppListMixer,
1558 app_list::switches::kDisableNewAppListMixer)},
1559 #endif
1560 {"disable-threaded-scrolling",
1561 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1562 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1563 kOsWin | kOsLinux | kOsCrOS | kOsAndroid | kOsMac,
1564 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)},
1565 {"invert-viewport-scroll-order",
1566 IDS_FLAGS_INVERT_VIEWPORT_SCROLL_ORDER_NAME,
1567 IDS_FLAGS_INVERT_VIEWPORT_SCROLL_ORDER_DESCRIPTION,
1568 kOsAll,
1569 SINGLE_VALUE_TYPE(switches::kInvertViewportScrollOrder)},
1570 {"bleeding-edge-renderer-mode",
1571 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1572 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1573 kOsAndroid,
1574 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)},
1575 {"enable-settings-window",
1576 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1577 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1578 kOsDesktop,
1579 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSettingsWindow,
1580 switches::kDisableSettingsWindow)},
1581 {"enable-save-password-bubble",
1582 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1583 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1584 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1585 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1586 switches::kDisableSavePasswordBubble)},
1587 {"enable-apps-file-associations",
1588 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1589 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1590 kOsMac,
1591 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)},
1592 #if defined(OS_ANDROID)
1593 {"enable-embeddedsearch-api",
1594 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1595 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1596 kOsAndroid,
1597 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)},
1598 #endif
1599 {"distance-field-text",
1600 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1601 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1602 kOsAll,
1603 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
1604 switches::kDisableDistanceFieldText)},
1605 {"extension-content-verification",
1606 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1607 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1608 kOsDesktop,
1609 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)},
1610 #if defined(ENABLE_EXTENSIONS)
1611 {"extension-active-script-permission",
1612 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1613 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1614 kOsAll,
1615 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)},
1616 #endif
1617 #if defined(OS_ANDROID)
1618 {"enable-data-reduction-proxy-dev",
1619 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1620 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1621 kOsAndroid,
1622 ENABLE_DISABLE_VALUE_TYPE(
1623 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1624 data_reduction_proxy::switches::kDisableDataReductionProxyDev)},
1625 {"enable-data-reduction-proxy-carrier-test",
1626 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_CARRIER_TEST_NAME,
1627 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_CARRIER_TEST_DESCRIPTION,
1628 kOsAndroid,
1629 SINGLE_VALUE_TYPE(
1630 data_reduction_proxy::switches::kEnableDataReductionProxyCarrierTest)},
1631 #endif
1632 {"enable-hotword-hardware",
1633 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_NAME,
1634 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORD_HARDWARE_DESCRIPTION,
1635 kOsCrOS,
1636 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwordHardware)},
1637 #if defined(ENABLE_EXTENSIONS)
1638 {"enable-embedded-extension-options",
1639 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1640 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1641 kOsDesktop,
1642 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)},
1643 #endif
1644 #if defined(USE_ASH)
1645 {"enable-web-app-frame",
1646 IDS_FLAGS_ENABLE_WEB_APP_FRAME_NAME,
1647 IDS_FLAGS_ENABLE_WEB_APP_FRAME_DESCRIPTION,
1648 kOsWin | kOsCrOS,
1649 SINGLE_VALUE_TYPE(switches::kEnableWebAppFrame)},
1650 #endif
1651 {"enable-drop-sync-credential",
1652 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1653 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1654 kOsAll,
1655 ENABLE_DISABLE_VALUE_TYPE(
1656 password_manager::switches::kEnableDropSyncCredential,
1657 password_manager::switches::kDisableDropSyncCredential)},
1658 #if defined(ENABLE_EXTENSIONS)
1659 {"enable-extension-action-redesign",
1660 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1661 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1662 kOsDesktop,
1663 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)},
1664 #endif
1665 {"autofill-sync-credential",
1666 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1667 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1668 kOsAll,
1669 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)},
1670 #if !defined(OS_ANDROID)
1671 {"enable-message-center-always-scroll-up-upon-notification-removal",
1672 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1673 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1674 kOsDesktop,
1675 SINGLE_VALUE_TYPE(
1676 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)},
1677 #endif
1678 #if !defined(OS_ANDROID) && !defined(OS_IOS)
1679 {"enable-md-settings",
1680 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_NAME,
1681 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_SETTINGS_DESCRIPTION,
1682 kOsDesktop,
1683 SINGLE_VALUE_TYPE(switches::kEnableMaterialDesignSettings)},
1684 #endif
1685 #if defined(OS_CHROMEOS)
1686 {"memory-pressure-thresholds",
1687 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_NAME,
1688 IDS_FLAGS_MEMORY_PRESSURE_THRESHOLD_DESCRIPTION,
1689 kOsCrOS,
1690 MULTI_VALUE_TYPE(kMemoryPressureThresholdChoices)},
1691 {"wake-on-packets",
1692 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1693 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1694 kOsCrOSOwnerOnly,
1695 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)},
1696 #endif // OS_CHROMEOS
1697 {"enable-tab-audio-muting",
1698 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
1699 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
1700 kOsDesktop,
1701 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)},
1702 {"enable-credential-manager-api",
1703 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
1704 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
1705 kOsAll,
1706 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)},
1707 {"reduced-referrer-granularity",
1708 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME,
1709 IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION,
1710 kOsAll,
1711 SINGLE_VALUE_TYPE(switches::kReducedReferrerGranularity)},
1712 #if defined(ENABLE_PLUGINS)
1713 {"enable-plugin-power-saver",
1714 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
1715 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
1716 kOsDesktop,
1717 ENABLE_DISABLE_VALUE_TYPE(plugins::switches::kEnablePluginPowerSaver,
1718 plugins::switches::kDisablePluginPowerSaver)},
1719 #endif
1720 #if defined(OS_CHROMEOS)
1721 {"disable-new-zip-unpacker",
1722 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_NAME,
1723 IDS_FLAGS_DISABLE_NEW_ZIP_UNPACKER_DESCRIPTION,
1724 kOsCrOS,
1725 SINGLE_VALUE_TYPE(chromeos::switches::kDisableNewZIPUnpacker)},
1726 #endif // defined(OS_CHROMEOS)
1727 {"enable-credit-card-scan",
1728 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_NAME,
1729 IDS_FLAGS_ENABLE_CREDIT_CARD_SCAN_DESCRIPTION,
1730 kOsAndroid,
1731 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableCreditCardScan,
1732 autofill::switches::kDisableCreditCardScan)},
1733 #if defined(OS_CHROMEOS)
1734 {"disable-captive-portal-bypass-proxy",
1735 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_NAME,
1736 IDS_FLAGS_DISABLE_CAPTIVE_PORTAL_BYPASS_PROXY_DESCRIPTION,
1737 kOsCrOS,
1738 SINGLE_VALUE_TYPE(chromeos::switches::kDisableCaptivePortalBypassProxy)},
1739 #endif // defined(OS_CHROMEOS)
1740 #if defined(OS_ANDROID)
1741 {"enable-seccomp-filter-sandbox",
1742 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_NAME,
1743 IDS_FLAGS_ENABLE_SECCOMP_FILTER_SANDBOX_ANDROID_DESCRIPTION,
1744 kOsAndroid,
1745 SINGLE_VALUE_TYPE(switches::kEnableSeccompFilterSandbox)},
1746 #endif
1747 {"enable-touch-hover",
1748 IDS_FLAGS_ENABLE_TOUCH_HOVER_NAME,
1749 IDS_FLAGS_ENABLE_TOUCH_HOVER_DESCRIPTION,
1750 kOsAndroid,
1751 SINGLE_VALUE_TYPE("enable-touch-hover")},
1752 {"enable-fill-on-account-select",
1753 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
1754 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
1755 kOsAll,
1756 MULTI_VALUE_TYPE(kFillOnAccountSelectChoices)},
1757 #if defined(OS_CHROMEOS)
1758 {"enable-wifi-credential-sync", // FLAGS:RECORD_UMA
1759 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
1760 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
1761 kOsCrOS,
1762 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)},
1763 {"enable-potentially-annoying-security-features",
1764 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_NAME,
1765 IDS_FLAGS_EXPERIMENTAL_SECURITY_FEATURES_DESCRIPTION,
1766 kOsAll,
1767 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)},
1768 #endif
1769 {"disable-delay-agnostic-aec",
1770 IDS_FLAGS_DISABLE_DELAY_AGNOSTIC_AEC_NAME,
1771 IDS_FLAGS_DISABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
1772 kOsWin | kOsLinux | kOsCrOS,
1773 SINGLE_VALUE_TYPE(switches::kDisableDelayAgnosticAec)},
1774 {"enable-delay-agnostic-aec",
1775 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
1776 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
1777 kOsMac,
1778 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)},
1779 {"mark-non-secure-as", // FLAGS:RECORD_UMA
1780 IDS_MARK_NON_SECURE_AS_NAME,
1781 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
1782 kOsAll,
1783 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)},
1784 {"enable-site-per-process",
1785 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
1786 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
1787 kOsAll,
1788 SINGLE_VALUE_TYPE(switches::kSitePerProcess)},
1789 #if defined(OS_MACOSX)
1790 {"enable-harfbuzz-rendertext",
1791 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
1792 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
1793 kOsMac,
1794 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)},
1795 #endif // defined(OS_MACOSX)
1796 #if defined(OS_CHROMEOS)
1797 {"disable-timezone-tracking",
1798 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
1799 IDS_FLAGS_DISABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
1800 kOsCrOS,
1801 SINGLE_VALUE_TYPE(chromeos::switches::kDisableTimeZoneTrackingOption)},
1802 #endif // defined(OS_CHROMEOS)
1803 {"data-reduction-proxy-lo-fi",
1804 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_NAME,
1805 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION,
1806 kOsAll,
1807 MULTI_VALUE_TYPE(kDataReductionProxyLoFiChoices)},
1808 {"clear-data-reduction-proxy-data-savings",
1809 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME,
1810 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION,
1811 kOsAll,
1812 SINGLE_VALUE_TYPE(
1813 data_reduction_proxy::switches::kClearDataReductionProxyDataSavings)},
1814 {"enable-data-reduction-proxy-config-client",
1815 IDS_FLAGS_DATA_REDUCTION_PROXY_CONFIG_CLIENT_NAME,
1816 IDS_FLAGS_DATA_REDUCTION_PROXY_CONFIG_CLIENT_DESCRIPTION,
1817 kOsAll,
1818 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
1819 kEnableDataReductionProxyConfigClient)},
1820 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
1821 {"enable-data-reduction-proxy-bypass-warnings",
1822 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
1823 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
1824 kOsAndroid,
1825 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
1826 kEnableDataReductionProxyBypassWarning)},
1827 #endif
1828 {"allow-insecure-localhost",
1829 IDS_ALLOW_INSECURE_LOCALHOST,
1830 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION,
1831 kOsAll,
1832 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)},
1833 {"enable-add-to-shelf",
1834 IDS_FLAGS_ENABLE_ADD_TO_SHELF_NAME,
1835 IDS_FLAGS_ENABLE_ADD_TO_SHELF_DESCRIPTION,
1836 kOsDesktop,
1837 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAddToShelf,
1838 switches::kDisableAddToShelf)},
1839 {"bypass-app-banner-engagement-checks",
1840 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_NAME,
1841 IDS_FLAGS_BYPASS_APP_BANNER_ENGAGEMENT_CHECKS_DESCRIPTION,
1842 kOsAll,
1843 SINGLE_VALUE_TYPE(switches::kBypassAppBannerEngagementChecks)},
1844 {"use-sync-sandbox",
1845 IDS_FLAGS_SYNC_SANDBOX_NAME,
1846 IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION,
1847 kOsAll,
1848 SINGLE_VALUE_TYPE_AND_VALUE(
1849 switches::kSyncServiceURL,
1850 "https://chrome-sync.sandbox.google.com/chrome-sync/alpha")},
1851 {"enable-child-account-detection",
1852 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_NAME,
1853 IDS_FLAGS_CHILD_ACCOUNT_DETECTION_DESCRIPTION,
1854 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1855 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableChildAccountDetection,
1856 switches::kDisableChildAccountDetection)},
1857 #if defined(OS_CHROMEOS) && defined(USE_OZONE)
1858 {"ozone-test-single-overlay-support",
1859 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY,
1860 IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION,
1861 kOsCrOS,
1862 SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport)},
1863 #endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
1864 {"v8-pac-mojo-out-of-process",
1865 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME,
1866 IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION,
1867 kOsDesktop,
1868 ENABLE_DISABLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess,
1869 switches::kDisableOutOfProcessPac)},
1870 #if defined(ENABLE_MEDIA_ROUTER)
1871 {"enable-media-router",
1872 IDS_FLAGS_ENABLE_MEDIA_ROUTER_NAME,
1873 IDS_FLAGS_ENABLE_MEDIA_ROUTER_DESCRIPTION,
1874 kOsAll,
1875 SINGLE_VALUE_TYPE(switches::kEnableMediaRouter)},
1876 #endif // defined(ENABLE_MEDIA_ROUTER)
1877 // Since Drive Search is not available when app list is disabled, flag guard
1878 // enable-drive-search-in-chrome-launcher flag.
1879 #if defined(ENABLE_APP_LIST)
1880 {"enable-drive-search-in-app-launcher",
1881 IDS_FLAGS_ENABLE_DRIVE_SEARCH_IN_CHROME_LAUNCHER,
1882 IDS_FLAGS_ENABLE_DRIVE_SEARCH_IN_CHROME_LAUNCHER_DESCRIPTION,
1883 kOsCrOS,
1884 ENABLE_DISABLE_VALUE_TYPE(
1885 app_list::switches::kEnableDriveSearchInChromeLauncher,
1886 app_list::switches::kDisableDriveSearchInChromeLauncher)},
1887 #endif // defined(ENABLE_APP_LIST)
1888 #if defined(OS_CHROMEOS)
1889 {"disable-mtp-write-support",
1890 IDS_FLAG_DISABLE_MTP_WRITE_SUPPORT_NAME,
1891 IDS_FLAG_DISABLE_MTP_WRITE_SUPPORT_DESCRIPTION,
1892 kOsCrOS,
1893 SINGLE_VALUE_TYPE(chromeos::switches::kDisableMtpWriteSupport)},
1894 #endif // defined(OS_CHROMEOS)
1895 #if defined(OS_CHROMEOS)
1896 {"enable-datasaver-prompt",
1897 IDS_FLAGS_DATASAVER_PROMPT_NAME,
1898 IDS_FLAGS_DATASAVER_PROMPT_DESCRIPTION,
1899 kOsCrOS,
1900 MULTI_VALUE_TYPE(kDataSaverPromptChoices)},
1901 #endif // defined(OS_CHROMEOS)
1902 {"supervised-user-safesites",
1903 IDS_FLAGS_SUPERVISED_USER_SAFESITES_NAME,
1904 IDS_FLAGS_SUPERVISED_USER_SAFESITES_DESCRIPTION,
1905 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1906 MULTI_VALUE_TYPE(kSupervisedUserSafeSitesChoices)},
1907 #if defined(OS_ANDROID)
1908 {"enable-autofill-keyboard-accessory-view",
1909 IDS_FLAGS_AUTOFILL_ACCESSORY_VIEW_NAME,
1910 IDS_FLAGS_AUTOFILL_ACCESSORY_VIEW_DESCRIPTION,
1911 kOsAndroid,
1912 ENABLE_DISABLE_VALUE_TYPE(
1913 autofill::switches::kEnableAccessorySuggestionView,
1914 autofill::switches::kDisableAccessorySuggestionView)},
1915 #endif // defined(OS_ANDROID)
1916 {"disable-new-video-renderer",
1917 IDS_FLAGS_DISABLE_NEW_VIDEO_RENDERER_NAME,
1918 IDS_FLAGS_DISABLE_NEW_VIDEO_RENDERER_DESCRIPTION,
1919 kOsAll,
1920 SINGLE_VALUE_TYPE(switches::kDisableNewVideoRenderer)},
1921 // Temporary flag to ease the transition to standard-compliant scrollTop
1922 // behavior. Will be removed shortly after http://crbug.com/157855 ships.
1923 {"scroll-top-left-interop",
1924 IDS_FLAGS_SCROLL_TOP_LEFT_INTEROP_NAME,
1925 IDS_FLAGS_SCROLL_TOP_LEFT_INTEROP_DESCRIPTION,
1926 kOsAll,
1927 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kEnableBlinkFeatures,
1928 "ScrollTopLeftInterop",
1929 switches::kDisableBlinkFeatures,
1930 "ScrollTopLeftInterop")},
1931 #if defined(OS_WIN)
1932 {"try-supported-channel-layouts",
1933 IDS_FLAGS_TRY_SUPPORTED_CHANNEL_LAYOUTS_NAME,
1934 IDS_FLAGS_TRY_SUPPORTED_CHANNEL_LAYOUTS_DESCRIPTION,
1935 kOsWin,
1936 SINGLE_VALUE_TYPE(switches::kTrySupportedChannelLayouts)},
1937 #endif
1938 {"emphasize-titles-in-omnibox-dropdown",
1939 IDS_FLAGS_EMPHASIZE_TITLES_IN_OMNIBOX_DROPDOWN_NAME,
1940 IDS_FLAGS_EMPHASIZE_TITLES_IN_OMNIBOX_DROPDOWN_DESCRIPTION,
1941 kOsAll,
1942 SINGLE_VALUE_TYPE(switches::kEmphasizeTitlesInOmniboxDropdown)},
1943 #if defined(ENABLE_WEBRTC)
1944 {"enable-webrtc-dtls12",
1945 IDS_FLAGS_ENABLE_WEBRTC_DTLS12_NAME,
1946 IDS_FLAGS_ENABLE_WEBRTC_DTLS12_DESCRIPTION,
1947 kOsAll,
1948 SINGLE_VALUE_TYPE(switches::kEnableWebRtcDtls12)},
1949 #endif
1950 #if defined(OS_MACOSX)
1951 {"app-info-dialog",
1952 IDS_FLAGS_APP_INFO_DIALOG_NAME,
1953 IDS_FLAGS_APP_INFO_DIALOG_DESCRIPTION,
1954 kOsMac,
1955 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAppInfoDialogMac,
1956 switches::kDisableAppInfoDialogMac)},
1957 {"mac-views-native-app-windows",
1958 IDS_FLAGS_MAC_VIEWS_NATIVE_APP_WINDOWS_NAME,
1959 IDS_FLAGS_MAC_VIEWS_NATIVE_APP_WINDOWS_DESCRIPTION,
1960 kOsMac,
1961 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMacViewsNativeAppWindows,
1962 switches::kDisableMacViewsNativeAppWindows)},
1963 {"app-window-cycling",
1964 IDS_FLAGS_APP_WINDOW_CYCLING_NAME,
1965 IDS_FLAGS_APP_WINDOW_CYCLING_DESCRIPTION,
1966 kOsMac,
1967 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAppWindowCycling,
1968 switches::kDisableAppWindowCycling)},
1969 {"mac-views-dialogs",
1970 IDS_FLAGS_MAC_VIEWS_DIALOGS_NAME,
1971 IDS_FLAGS_MAC_VIEWS_DIALOGS_DESCRIPTION,
1972 kOsMac,
1973 SINGLE_VALUE_TYPE(switches::kEnableMacViewsDialogs)},
1974 #endif
1975 #if defined(ENABLE_WEBVR)
1976 {"enable-webvr",
1977 IDS_FLAGS_ENABLE_WEBVR_NAME,
1978 IDS_FLAGS_ENABLE_WEBVR_DESCRIPTION,
1979 kOsAll,
1980 SINGLE_VALUE_TYPE(switches::kEnableWebVR)},
1981 #endif
1982 #if defined(OS_CHROMEOS)
1983 {"disable-accelerated-mjpeg-decode",
1984 IDS_FLAGS_DISABLE_ACCELERATED_MJPEG_DECODE_NAME,
1985 IDS_FLAGS_DISABLE_ACCELERATED_MJPEG_DECODE_DESCRIPTION,
1986 kOsCrOS,
1987 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
1988 #endif // OS_CHROMEOS
1989 {"v8-cache-options",
1990 IDS_FLAGS_V8_CACHE_OPTIONS_NAME,
1991 IDS_FLAGS_V8_CACHE_OPTIONS_DESCRIPTION,
1992 kOsAll,
1993 MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
1994 #if !defined(OS_ANDROID) && !defined(OS_IOS)
1995 {"enable-md-downloads",
1996 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_DOWNLOADS_NAME,
1997 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_DOWNLOADS_DESCRIPTION,
1998 kOsDesktop,
1999 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMaterialDesignDownloads,
2000 switches::kDisableMaterialDesignDownloads)},
2001 #endif
2002 #if defined(OS_WIN) || defined(OS_MACOSX)
2003 {"enable-tab-discarding",
2004 IDS_FLAGS_ENABLE_TAB_DISCARDING_NAME,
2005 IDS_FLAGS_ENABLE_TAB_DISCARDING_DESCRIPTION,
2006 kOsWin | kOsMac,
2007 SINGLE_VALUE_TYPE(switches::kEnableTabDiscarding)},
2008 #endif
2009 {"enable-clear-browsing-data-counters",
2010 IDS_FLAGS_ENABLE_CLEAR_BROWSING_DATA_COUNTERS_NAME,
2011 IDS_FLAGS_ENABLE_CLEAR_BROWSING_DATA_COUNTERS_DESCRIPTION,
2012 kOsAll,
2013 SINGLE_VALUE_TYPE(switches::kEnableClearBrowsingDataCounters)
2015 #if defined(ENABLE_TASK_MANAGER)
2016 {"disable-new-task-manager",
2017 IDS_FLAGS_DISABLE_NEW_TASK_MANAGER_NAME,
2018 IDS_FLAGS_DISABLE_NEW_TASK_MANAGER_DESCRIPTION,
2019 kOsDesktop,
2020 SINGLE_VALUE_TYPE(switches::kDisableNewTaskManager)
2022 #endif // defined(ENABLE_TASK_MANAGER)
2023 {"simplified-fullscreen-ui",
2024 IDS_FLAGS_SIMPLIFIED_FULLSCREEN_UI_NAME,
2025 IDS_FLAGS_SIMPLIFIED_FULLSCREEN_UI_DESCRIPTION,
2026 kOsDesktop,
2027 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSimplifiedFullscreenUI,
2028 switches::kDisableSimplifiedFullscreenUI)
2030 #if defined(OS_ANDROID)
2031 {"progress-bar-animation",
2032 IDS_FLAGS_PROGRESS_BAR_ANIMATION_NAME,
2033 IDS_FLAGS_PROGRESS_BAR_ANIMATION_DESCRIPTION,
2034 kOsAndroid,
2035 MULTI_VALUE_TYPE(kProgressBarAnimationChoices)},
2036 #endif // defined(OS_ANDROID)
2037 #if defined(OS_ANDROID)
2038 {"offline-pages",
2039 IDS_FLAGS_OFFLINE_PAGES_NAME,
2040 IDS_FLAGS_OFFLINE_PAGES_DESCRIPTION,
2041 kOsAndroid,
2042 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflinePages,
2043 switches::kDisableOfflinePages)},
2044 #endif // defined(OS_ANDROID)
2045 {"low-priority-iframes",
2046 IDS_FLAGS_LOW_PRIORITY_IFRAMES_UI_NAME,
2047 IDS_FLAGS_LOW_PRIORITY_IFRAMES_UI_DESCRIPTION,
2048 kOsAll,
2049 // NOTE: if we want to add additional experiment entries for other
2050 // features controlled by kBlinkSettings, we'll need to add logic to
2051 // merge the flag values.
2052 SINGLE_VALUE_TYPE_AND_VALUE(
2053 switches::kBlinkSettings, "lowPriorityIframes=true")},
2054 #if defined(OS_ANDROID)
2055 {"enable-ntp-popular-sites",
2056 IDS_FLAGS_NTP_POPULAR_SITES_NAME,
2057 IDS_FLAGS_NTP_POPULAR_SITES_DESCRIPTION,
2058 kOsAndroid,
2059 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNTPPopularSites,
2060 switches::kDisableNTPPopularSites)},
2061 #endif // defined(OS_ANDROID)
2062 #if defined(OS_WIN)
2063 {"trace-export-events-to-etw",
2064 IDS_FLAGS_TRACE_EXPORT_EVENTS_TO_ETW_NAME,
2065 IDS_FLAGS_TRACE_EXPORT_EVENTS_TO_ETW_DESRIPTION,
2066 kOsWin,
2067 SINGLE_VALUE_TYPE(switches::kTraceExportEventsToETW)},
2068 #endif // defined(OS_WIN)
2069 #if defined(ENABLE_BACKGROUND)
2070 {"enable-push-api-background-mode",
2071 IDS_FLAGS_ENABLE_PUSH_API_BACKGROUND_MODE_NAME,
2072 IDS_FLAGS_ENABLE_PUSH_API_BACKGROUND_MODE_DESCRIPTION,
2073 kOsMac | kOsWin | kOsLinux,
2074 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePushApiBackgroundMode,
2075 switches::kDisablePushApiBackgroundMode)},
2076 #endif // defined(ENABLE_BACKGROUND)
2077 #if !defined(OS_ANDROID) && !defined(OS_IOS)
2078 {"enable-webusb-notifications",
2079 IDS_FLAGS_ENABLE_WEBUSB_NOTIFICATIONS_NAME,
2080 IDS_FLAGS_ENABLE_WEBUSB_NOTIFICATIONS_DESCRIPTION,
2081 kOsDesktop,
2082 SINGLE_VALUE_TYPE(switches::kEnableWebUsbNotifications)},
2083 #endif
2084 // NOTE: Adding new command-line switches requires adding corresponding
2085 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2086 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2089 const Experiment* experiments = kExperiments;
2090 size_t num_experiments = arraysize(kExperiments);
2092 // Stores and encapsulates the little state that about:flags has.
2093 class FlagsState {
2094 public:
2095 FlagsState() : needs_restart_(false) {}
2096 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2097 base::CommandLine* command_line,
2098 SentinelsMode sentinels);
2099 bool IsRestartNeededToCommitChanges();
2100 void SetExperimentEnabled(
2101 FlagsStorage* flags_storage,
2102 const std::string& internal_name,
2103 bool enable);
2104 void RemoveFlagsSwitches(
2105 std::map<std::string, base::CommandLine::StringType>* switch_list);
2106 void ResetAllFlags(FlagsStorage* flags_storage);
2107 void reset();
2109 // Returns the singleton instance of this class
2110 static FlagsState* GetInstance() {
2111 return Singleton<FlagsState>::get();
2114 private:
2115 bool needs_restart_;
2116 std::map<std::string, std::string> flags_switches_;
2118 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2121 // Adds the internal names for the specified experiment to |names|.
2122 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2123 if (e.type == Experiment::SINGLE_VALUE ||
2124 e.type == Experiment::SINGLE_DISABLE_VALUE) {
2125 names->insert(e.internal_name);
2126 } else {
2127 DCHECK(e.type == Experiment::MULTI_VALUE ||
2128 e.type == Experiment::ENABLE_DISABLE_VALUE);
2129 for (int i = 0; i < e.num_choices; ++i)
2130 names->insert(e.NameForChoice(i));
2134 // Confirms that an experiment is valid, used in a DCHECK in
2135 // SanitizeList below.
2136 bool ValidateExperiment(const Experiment& e) {
2137 switch (e.type) {
2138 case Experiment::SINGLE_VALUE:
2139 case Experiment::SINGLE_DISABLE_VALUE:
2140 DCHECK_EQ(0, e.num_choices);
2141 DCHECK(!e.choices);
2142 break;
2143 case Experiment::MULTI_VALUE:
2144 DCHECK_GT(e.num_choices, 0);
2145 DCHECK(e.choices);
2146 DCHECK(e.choices[0].command_line_switch);
2147 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
2148 break;
2149 case Experiment::ENABLE_DISABLE_VALUE:
2150 DCHECK_EQ(3, e.num_choices);
2151 DCHECK(!e.choices);
2152 DCHECK(e.command_line_switch);
2153 DCHECK(e.command_line_value);
2154 DCHECK(e.disable_command_line_switch);
2155 DCHECK(e.disable_command_line_value);
2156 break;
2157 default:
2158 NOTREACHED();
2160 return true;
2163 // Removes all experiments from prefs::kEnabledLabsExperiments that are
2164 // unknown, to prevent this list to become very long as experiments are added
2165 // and removed.
2166 void SanitizeList(FlagsStorage* flags_storage) {
2167 std::set<std::string> known_experiments;
2168 for (size_t i = 0; i < num_experiments; ++i) {
2169 DCHECK(ValidateExperiment(experiments[i]));
2170 AddInternalName(experiments[i], &known_experiments);
2173 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2175 std::set<std::string> new_enabled_experiments =
2176 base::STLSetIntersection<std::set<std::string> >(
2177 known_experiments, enabled_experiments);
2179 if (new_enabled_experiments != enabled_experiments)
2180 flags_storage->SetFlags(new_enabled_experiments);
2183 void GetSanitizedEnabledFlags(
2184 FlagsStorage* flags_storage, std::set<std::string>* result) {
2185 SanitizeList(flags_storage);
2186 *result = flags_storage->GetFlags();
2189 bool SkipConditionalExperiment(const Experiment& experiment) {
2190 version_info::Channel channel = chrome::GetChannel();
2192 #if defined(OS_ANDROID)
2193 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2194 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2195 channel != version_info::Channel::BETA &&
2196 channel != version_info::Channel::DEV) {
2197 return true;
2199 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2200 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2201 channel != version_info::Channel::DEV) {
2202 return true;
2204 // enable-data-reduction-proxy-carrier-test is only available for Chromium
2205 // builds and the Canary/Dev channel.
2206 if (!strcmp("enable-data-reduction-proxy-carrier-test",
2207 experiment.internal_name) &&
2208 channel != version_info::Channel::DEV &&
2209 channel != version_info::Channel::CANARY &&
2210 channel != version_info::Channel::UNKNOWN) {
2211 return true;
2213 #endif
2215 // data-reduction-proxy-lo-fi is only available for Chromium builds and
2216 // the Canary/Dev/Beta channels.
2217 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) &&
2218 channel != version_info::Channel::BETA &&
2219 channel != version_info::Channel::DEV &&
2220 channel != version_info::Channel::CANARY &&
2221 channel != version_info::Channel::UNKNOWN) {
2222 return true;
2225 // enable-data-reduction-proxy-config-client is only available for Chromium
2226 // builds and the Canary/Dev channels.
2227 if (!strcmp("enable-data-reduction-proxy-config-client",
2228 experiment.internal_name) &&
2229 channel != version_info::Channel::DEV &&
2230 channel != version_info::Channel::CANARY &&
2231 channel != version_info::Channel::UNKNOWN) {
2232 return true;
2235 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2236 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2237 // builds and Canary/Dev channel.
2238 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2239 experiment.internal_name) &&
2240 channel != version_info::Channel::UNKNOWN &&
2241 channel != version_info::Channel::CANARY &&
2242 channel != version_info::Channel::DEV) {
2243 return true;
2245 #endif
2247 return false;
2251 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2252 // enabled on the current platform.
2253 void GetSanitizedEnabledFlagsForCurrentPlatform(
2254 FlagsStorage* flags_storage, std::set<std::string>* result) {
2255 GetSanitizedEnabledFlags(flags_storage, result);
2257 // Filter out any experiments that aren't enabled on the current platform. We
2258 // don't remove these from prefs else syncing to a platform with a different
2259 // set of experiments would be lossy.
2260 std::set<std::string> platform_experiments;
2261 int current_platform = GetCurrentPlatform();
2262 for (size_t i = 0; i < num_experiments; ++i) {
2263 if (experiments[i].supported_platforms & current_platform)
2264 AddInternalName(experiments[i], &platform_experiments);
2265 #if defined(OS_CHROMEOS)
2266 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2267 AddInternalName(experiments[i], &platform_experiments);
2268 #endif
2271 std::set<std::string> new_enabled_experiments =
2272 base::STLSetIntersection<std::set<std::string> >(
2273 platform_experiments, *result);
2275 result->swap(new_enabled_experiments);
2278 // Returns true if none of this experiment's options have been enabled.
2279 bool IsDefaultValue(
2280 const Experiment& experiment,
2281 const std::set<std::string>& enabled_experiments) {
2282 switch (experiment.type) {
2283 case Experiment::SINGLE_VALUE:
2284 case Experiment::SINGLE_DISABLE_VALUE:
2285 return enabled_experiments.count(experiment.internal_name) == 0;
2286 case Experiment::MULTI_VALUE:
2287 case Experiment::ENABLE_DISABLE_VALUE:
2288 for (int i = 0; i < experiment.num_choices; ++i) {
2289 if (enabled_experiments.count(experiment.NameForChoice(i)) > 0)
2290 return false;
2292 break;
2293 default:
2294 NOTREACHED();
2296 return true;
2299 // Returns the Value representing the choice data in the specified experiment.
2300 base::Value* CreateChoiceData(
2301 const Experiment& experiment,
2302 const std::set<std::string>& enabled_experiments) {
2303 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2304 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2305 base::ListValue* result = new base::ListValue;
2306 for (int i = 0; i < experiment.num_choices; ++i) {
2307 base::DictionaryValue* value = new base::DictionaryValue;
2308 const std::string name = experiment.NameForChoice(i);
2309 value->SetString("internal_name", name);
2310 value->SetString("description", experiment.DescriptionForChoice(i));
2311 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2312 result->Append(value);
2314 return result;
2317 } // namespace
2319 std::string Experiment::NameForChoice(int index) const {
2320 DCHECK(type == Experiment::MULTI_VALUE ||
2321 type == Experiment::ENABLE_DISABLE_VALUE);
2322 DCHECK_LT(index, num_choices);
2323 return std::string(internal_name) + testing::kMultiSeparator +
2324 base::IntToString(index);
2327 base::string16 Experiment::DescriptionForChoice(int index) const {
2328 DCHECK(type == Experiment::MULTI_VALUE ||
2329 type == Experiment::ENABLE_DISABLE_VALUE);
2330 DCHECK_LT(index, num_choices);
2331 int description_id;
2332 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2333 const int kEnableDisableDescriptionIds[] = {
2334 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2335 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2336 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2338 description_id = kEnableDisableDescriptionIds[index];
2339 } else {
2340 description_id = choices[index].description_id;
2342 return l10n_util::GetStringUTF16(description_id);
2345 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2346 base::CommandLine* command_line,
2347 SentinelsMode sentinels) {
2348 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2349 command_line,
2350 sentinels);
2353 bool AreSwitchesIdenticalToCurrentCommandLine(
2354 const base::CommandLine& new_cmdline,
2355 const base::CommandLine& active_cmdline,
2356 std::set<base::CommandLine::StringType>* out_difference) {
2357 std::set<base::CommandLine::StringType> new_flags =
2358 ExtractFlagsFromCommandLine(new_cmdline);
2359 std::set<base::CommandLine::StringType> active_flags =
2360 ExtractFlagsFromCommandLine(active_cmdline);
2362 bool result = false;
2363 // Needed because std::equal doesn't check if the 2nd set is empty.
2364 if (new_flags.size() == active_flags.size()) {
2365 result =
2366 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2369 if (out_difference && !result) {
2370 std::set_symmetric_difference(
2371 new_flags.begin(),
2372 new_flags.end(),
2373 active_flags.begin(),
2374 active_flags.end(),
2375 std::inserter(*out_difference, out_difference->begin()));
2378 return result;
2381 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2382 FlagAccess access,
2383 base::ListValue* supported_experiments,
2384 base::ListValue* unsupported_experiments) {
2385 std::set<std::string> enabled_experiments;
2386 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2388 int current_platform = GetCurrentPlatform();
2390 for (size_t i = 0; i < num_experiments; ++i) {
2391 const Experiment& experiment = experiments[i];
2392 if (SkipConditionalExperiment(experiment))
2393 continue;
2395 base::DictionaryValue* data = new base::DictionaryValue();
2396 data->SetString("internal_name", experiment.internal_name);
2397 data->SetString("name",
2398 l10n_util::GetStringUTF16(experiment.visible_name_id));
2399 data->SetString("description",
2400 l10n_util::GetStringUTF16(
2401 experiment.visible_description_id));
2403 base::ListValue* supported_platforms = new base::ListValue();
2404 AddOsStrings(experiment.supported_platforms, supported_platforms);
2405 data->Set("supported_platforms", supported_platforms);
2406 // True if the switch is not currently passed.
2407 bool is_default_value = IsDefaultValue(experiment, enabled_experiments);
2408 data->SetBoolean("is_default", is_default_value);
2410 switch (experiment.type) {
2411 case Experiment::SINGLE_VALUE:
2412 case Experiment::SINGLE_DISABLE_VALUE:
2413 data->SetBoolean(
2414 "enabled",
2415 (!is_default_value &&
2416 experiment.type == Experiment::SINGLE_VALUE) ||
2417 (is_default_value &&
2418 experiment.type == Experiment::SINGLE_DISABLE_VALUE));
2419 break;
2420 case Experiment::MULTI_VALUE:
2421 case Experiment::ENABLE_DISABLE_VALUE:
2422 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2423 break;
2424 default:
2425 NOTREACHED();
2428 bool supported = (experiment.supported_platforms & current_platform) != 0;
2429 #if defined(OS_CHROMEOS)
2430 if (access == kOwnerAccessToFlags &&
2431 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2432 supported = true;
2434 #endif
2435 if (supported)
2436 supported_experiments->Append(data);
2437 else
2438 unsupported_experiments->Append(data);
2442 bool IsRestartNeededToCommitChanges() {
2443 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2446 void SetExperimentEnabled(FlagsStorage* flags_storage,
2447 const std::string& internal_name,
2448 bool enable) {
2449 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2450 internal_name, enable);
2453 void RemoveFlagsSwitches(
2454 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2455 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2458 void ResetAllFlags(FlagsStorage* flags_storage) {
2459 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2462 int GetCurrentPlatform() {
2463 #if defined(OS_MACOSX)
2464 return kOsMac;
2465 #elif defined(OS_WIN)
2466 return kOsWin;
2467 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2468 return kOsCrOS;
2469 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2470 return kOsLinux;
2471 #elif defined(OS_ANDROID)
2472 return kOsAndroid;
2473 #else
2474 #error Unknown platform
2475 #endif
2478 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2479 std::set<std::string> flags = flags_storage->GetFlags();
2480 for (const std::string& flag : flags) {
2481 std::string action("AboutFlags_");
2482 action += flag;
2483 content::RecordComputedAction(action);
2485 // Since flag metrics are recorded every startup, add a tick so that the
2486 // stats can be made meaningful.
2487 if (flags.size())
2488 content::RecordAction(base::UserMetricsAction("AboutFlags_StartupTick"));
2489 content::RecordAction(base::UserMetricsAction("StartupTick"));
2492 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2493 return static_cast<base::HistogramBase::Sample>(
2494 metrics::HashMetricName(switch_name));
2497 void ReportCustomFlags(const std::string& uma_histogram_hame,
2498 const std::set<std::string>& command_line_difference) {
2499 for (const std::string& flag : command_line_difference) {
2500 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId;
2501 if (base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) {
2502 // Skip '--' before switch name.
2503 std::string switch_name(flag.substr(2));
2505 // Kill value, if any.
2506 const size_t value_pos = switch_name.find('=');
2507 if (value_pos != std::string::npos)
2508 switch_name.resize(value_pos);
2510 uma_id = GetSwitchUMAId(switch_name);
2511 } else {
2512 NOTREACHED() << "ReportCustomFlags(): flag '" << flag
2513 << "' has incorrect format.";
2515 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2516 << "' '" << flag << "', uma_id=" << uma_id;
2518 // Sparse histogram macro does not cache the histogram, so it's safe
2519 // to use macro with non-static histogram name here.
2520 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2524 //////////////////////////////////////////////////////////////////////////////
2525 // FlagsState implementation.
2527 namespace {
2529 typedef std::map<std::string, std::pair<std::string, std::string> >
2530 NameToSwitchAndValueMap;
2532 void SetFlagToSwitchMapping(const std::string& key,
2533 const std::string& switch_name,
2534 const std::string& switch_value,
2535 NameToSwitchAndValueMap* name_to_switch_map) {
2536 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2537 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2540 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2541 base::CommandLine* command_line,
2542 SentinelsMode sentinels) {
2543 if (command_line->HasSwitch(switches::kNoExperiments))
2544 return;
2546 std::set<std::string> enabled_experiments;
2548 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2549 &enabled_experiments);
2551 NameToSwitchAndValueMap name_to_switch_map;
2552 for (size_t i = 0; i < num_experiments; ++i) {
2553 const Experiment& e = experiments[i];
2554 if (e.type == Experiment::SINGLE_VALUE ||
2555 e.type == Experiment::SINGLE_DISABLE_VALUE) {
2556 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2557 e.command_line_value, &name_to_switch_map);
2558 } else if (e.type == Experiment::MULTI_VALUE) {
2559 for (int j = 0; j < e.num_choices; ++j) {
2560 SetFlagToSwitchMapping(e.NameForChoice(j),
2561 e.choices[j].command_line_switch,
2562 e.choices[j].command_line_value,
2563 &name_to_switch_map);
2565 } else {
2566 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2567 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2568 &name_to_switch_map);
2569 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2570 e.command_line_value, &name_to_switch_map);
2571 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2572 e.disable_command_line_value, &name_to_switch_map);
2576 if (sentinels == kAddSentinels) {
2577 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2578 flags_switches_.insert(
2579 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2580 std::string()));
2582 for (const std::string& experiment_name : enabled_experiments) {
2583 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2584 name_to_switch_map.find(experiment_name);
2585 if (name_to_switch_it == name_to_switch_map.end()) {
2586 NOTREACHED();
2587 continue;
2590 const std::pair<std::string, std::string>&
2591 switch_and_value_pair = name_to_switch_it->second;
2593 CHECK(!switch_and_value_pair.first.empty());
2594 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2595 switch_and_value_pair.second);
2596 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2598 if (sentinels == kAddSentinels) {
2599 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2600 flags_switches_.insert(
2601 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2602 std::string()));
2606 bool FlagsState::IsRestartNeededToCommitChanges() {
2607 return needs_restart_;
2610 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2611 const std::string& internal_name,
2612 bool enable) {
2613 size_t at_index = internal_name.find(testing::kMultiSeparator);
2614 if (at_index != std::string::npos) {
2615 DCHECK(enable);
2616 // We're being asked to enable a multi-choice experiment. Disable the
2617 // currently selected choice.
2618 DCHECK_NE(at_index, 0u);
2619 const std::string experiment_name = internal_name.substr(0, at_index);
2620 SetExperimentEnabled(flags_storage, experiment_name, false);
2622 // And enable the new choice, if it is not the default first choice.
2623 if (internal_name != experiment_name + "@0") {
2624 std::set<std::string> enabled_experiments;
2625 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2626 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2627 flags_storage->SetFlags(enabled_experiments);
2629 return;
2632 std::set<std::string> enabled_experiments;
2633 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2635 const Experiment* e = NULL;
2636 for (size_t i = 0; i < num_experiments; ++i) {
2637 if (experiments[i].internal_name == internal_name) {
2638 e = experiments + i;
2639 break;
2642 DCHECK(e);
2644 if (e->type == Experiment::SINGLE_VALUE) {
2645 if (enable)
2646 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2647 else
2648 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2649 } else if (e->type == Experiment::SINGLE_DISABLE_VALUE) {
2650 if (!enable)
2651 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2652 else
2653 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2654 } else {
2655 if (enable) {
2656 // Enable the first choice.
2657 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2658 } else {
2659 // Find the currently enabled choice and disable it.
2660 for (int i = 0; i < e->num_choices; ++i) {
2661 std::string choice_name = e->NameForChoice(i);
2662 if (enabled_experiments.find(choice_name) !=
2663 enabled_experiments.end()) {
2664 needs_restart_ = true;
2665 enabled_experiments.erase(choice_name);
2666 // Continue on just in case there's a bug and more than one
2667 // experiment for this choice was enabled.
2673 flags_storage->SetFlags(enabled_experiments);
2676 void FlagsState::RemoveFlagsSwitches(
2677 std::map<std::string, base::CommandLine::StringType>* switch_list) {
2678 for (const auto& entry : flags_switches_)
2679 switch_list->erase(entry.first);
2682 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2683 needs_restart_ = true;
2685 std::set<std::string> no_experiments;
2686 flags_storage->SetFlags(no_experiments);
2689 void FlagsState::reset() {
2690 needs_restart_ = false;
2691 flags_switches_.clear();
2694 } // namespace
2696 namespace testing {
2698 // WARNING: '@' is also used in the html file. If you update this constant you
2699 // also need to update the html file.
2700 const char kMultiSeparator[] = "@";
2702 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2704 void ClearState() {
2705 FlagsState::GetInstance()->reset();
2708 void SetExperiments(const Experiment* e, size_t count) {
2709 if (!e) {
2710 experiments = kExperiments;
2711 num_experiments = arraysize(kExperiments);
2712 } else {
2713 experiments = e;
2714 num_experiments = count;
2718 const Experiment* GetExperiments(size_t* count) {
2719 *count = num_experiments;
2720 return experiments;
2723 } // namespace testing
2725 } // namespace about_flags