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