Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / browser / about_flags.cc
bloba1d3a56a8e87c6d6eb82b2bb92ccaec66f6be38c
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/numerics/safe_conversions.h"
16 #include "base/stl_util.h"
17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h"
20 #include "base/values.h"
21 #include "cc/base/switches.h"
22 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
23 #include "chrome/browser/flags_storage.h"
24 #include "chrome/common/chrome_content_client.h"
25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/grit/generated_resources.h"
27 #include "components/autofill/core/common/autofill_switches.h"
28 #include "components/cloud_devices/common/cloud_devices_switches.h"
29 #include "components/metrics/metrics_hashes.h"
30 #include "components/nacl/common/nacl_switches.h"
31 #include "components/search/search_switches.h"
32 #include "content/public/browser/user_metrics.h"
33 #include "extensions/common/switches.h"
34 #include "media/base/media_switches.h"
35 #include "ui/base/l10n/l10n_util.h"
36 #include "ui/base/ui_base_switches.h"
37 #include "ui/display/display_switches.h"
38 #include "ui/events/event_switches.h"
39 #include "ui/gfx/switches.h"
40 #include "ui/gl/gl_switches.h"
41 #include "ui/keyboard/keyboard_switches.h"
42 #include "ui/native_theme/native_theme_switches.h"
43 #include "ui/views/views_switches.h"
45 #if defined(OS_ANDROID)
46 #include "chrome/common/chrome_version_info.h"
47 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h"
48 #include "components/omnibox/omnibox_switches.h"
49 #else
50 #include "ui/message_center/message_center_switches.h"
51 #endif
53 #if defined(USE_ASH)
54 #include "ash/ash_switches.h"
55 #endif
57 #if defined(OS_CHROMEOS)
58 #include "chromeos/chromeos_switches.h"
59 #include "third_party/cros_system_api/switches/chrome_switches.h"
60 #endif
62 #if defined(ENABLE_APP_LIST)
63 #include "ui/app_list/app_list_switches.h"
64 #endif
66 using base::UserMetricsAction;
68 namespace about_flags {
70 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
72 // Macros to simplify specifying the type.
73 #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
74 Experiment::SINGLE_VALUE, \
75 command_line_switch, switch_value, NULL, NULL, NULL, 0
76 #define SINGLE_VALUE_TYPE(command_line_switch) \
77 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
78 #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
79 disable_switch, disable_value) \
80 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
81 disable_switch, disable_value, NULL, 3
82 #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
83 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
84 #define MULTI_VALUE_TYPE(choices) \
85 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
87 namespace {
89 const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
90 const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
92 // Adds a |StringValue| to |list| for each platform where |bitmask| indicates
93 // whether the experiment is available on that platform.
94 void AddOsStrings(unsigned bitmask, base::ListValue* list) {
95 struct {
96 unsigned bit;
97 const char* const name;
98 } kBitsToOs[] = {
99 {kOsMac, "Mac"},
100 {kOsWin, "Windows"},
101 {kOsLinux, "Linux"},
102 {kOsCrOS, "Chrome OS"},
103 {kOsAndroid, "Android"},
104 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
106 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
107 if (bitmask & kBitsToOs[i].bit)
108 list->Append(new base::StringValue(kBitsToOs[i].name));
111 // Convert switch constants to proper CommandLine::StringType strings.
112 CommandLine::StringType GetSwitchString(const std::string& flag) {
113 CommandLine cmd_line(CommandLine::NO_PROGRAM);
114 cmd_line.AppendSwitch(flag);
115 DCHECK_EQ(2U, cmd_line.argv().size());
116 return cmd_line.argv()[1];
119 // Scoops flags from a command line.
120 std::set<CommandLine::StringType> ExtractFlagsFromCommandLine(
121 const CommandLine& cmdline) {
122 std::set<CommandLine::StringType> flags;
123 // First do the ones between --flag-switches-begin and --flag-switches-end.
124 CommandLine::StringVector::const_iterator first =
125 std::find(cmdline.argv().begin(), cmdline.argv().end(),
126 GetSwitchString(switches::kFlagSwitchesBegin));
127 CommandLine::StringVector::const_iterator last =
128 std::find(cmdline.argv().begin(), cmdline.argv().end(),
129 GetSwitchString(switches::kFlagSwitchesEnd));
130 if (first != cmdline.argv().end() && last != cmdline.argv().end())
131 flags.insert(first + 1, last);
132 #if defined(OS_CHROMEOS)
133 // Then add those between --policy-switches-begin and --policy-switches-end.
134 first = std::find(cmdline.argv().begin(), cmdline.argv().end(),
135 GetSwitchString(chromeos::switches::kPolicySwitchesBegin));
136 last = std::find(cmdline.argv().begin(), cmdline.argv().end(),
137 GetSwitchString(chromeos::switches::kPolicySwitchesEnd));
138 if (first != cmdline.argv().end() && last != cmdline.argv().end())
139 flags.insert(first + 1, last);
140 #endif
141 return flags;
144 const Experiment::Choice kEnableDisplayList2DcanvasChoices[] = {
145 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
146 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
147 switches::kEnableDisplayList2dCanvas, ""},
148 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
149 switches::kDisableDisplayList2dCanvas, ""},
152 const Experiment::Choice kEnableCompositingForTransitionChoices[] = {
153 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
154 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
155 switches::kEnableCompositingForTransition, ""},
156 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
157 switches::kDisableCompositingForTransition, ""},
160 const Experiment::Choice kTouchEventsChoices[] = {
161 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
162 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
163 switches::kTouchEvents,
164 switches::kTouchEventsEnabled },
165 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
166 switches::kTouchEvents,
167 switches::kTouchEventsDisabled }
170 #if defined(USE_AURA)
171 const Experiment::Choice kOverscrollHistoryNavigationChoices[] = {
172 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, "", "" },
173 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
174 switches::kOverscrollHistoryNavigation,
175 "0" },
176 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI,
177 switches::kOverscrollHistoryNavigation,
178 "2" }
180 #endif
181 #if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_LINUX)
182 const Experiment::Choice kDeviceScaleFactorChoices[] = {
183 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
184 { IDS_DEVICE_SCALE_FACTOR_1_1, switches::kForceDeviceScaleFactor, "1.1"},
185 { IDS_DEVICE_SCALE_FACTOR_1_2, switches::kForceDeviceScaleFactor, "1.2"},
186 { IDS_DEVICE_SCALE_FACTOR_1_25, switches::kForceDeviceScaleFactor, "1.25"},
187 { IDS_DEVICE_SCALE_FACTOR_1_3, switches::kForceDeviceScaleFactor, "1.3"},
188 { IDS_DEVICE_SCALE_FACTOR_1_4, switches::kForceDeviceScaleFactor, "1.4"},
189 { IDS_DEVICE_SCALE_FACTOR_2, switches::kForceDeviceScaleFactor, "2"},
191 #endif
193 #if !defined(DISABLE_NACL)
194 const Experiment::Choice kNaClDebugMaskChoices[] = {
195 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
196 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
197 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
198 // so by default we want to avoid debugging that.
199 // NOTE: As the default value must be the empty string, the mask excluding
200 // the PNaCl translator and secure shell is substituted elsewhere.
201 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
202 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
203 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
204 switches::kNaClDebugMask, "*://*/*debug.nmf" }
206 #endif
208 const Experiment::Choice kImplSidePaintingChoices[] = {
209 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
210 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
211 switches::kEnableImplSidePainting, ""},
212 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
213 switches::kDisableImplSidePainting, ""}
216 const Experiment::Choice kLCDTextChoices[] = {
217 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
218 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, switches::kEnableLCDText, ""},
219 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kDisableLCDText, ""}
222 const Experiment::Choice kDistanceFieldTextChoices[] = {
223 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
224 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
225 switches::kEnableDistanceFieldText, "" },
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
227 switches::kDisableDistanceFieldText, "" }
230 #ifndef USE_AURA
231 const Experiment::Choice kDelegatedRendererChoices[] = {
232 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
233 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
234 switches::kEnableDelegatedRenderer, ""},
235 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
236 switches::kDisableDelegatedRenderer, ""}
238 #endif
240 const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
241 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
242 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
243 cc::switches::kMaxTilesForInterestArea, "64"},
244 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
245 cc::switches::kMaxTilesForInterestArea, "128"},
246 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
247 cc::switches::kMaxTilesForInterestArea, "256"},
248 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
249 cc::switches::kMaxTilesForInterestArea, "512"}
252 const Experiment::Choice kDefaultTileWidthChoices[] = {
253 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
254 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
255 switches::kDefaultTileWidth, "128"},
256 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
257 switches::kDefaultTileWidth, "256"},
258 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
259 switches::kDefaultTileWidth, "512"},
260 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
261 switches::kDefaultTileWidth, "1024"}
264 const Experiment::Choice kDefaultTileHeightChoices[] = {
265 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
266 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
267 switches::kDefaultTileHeight, "128"},
268 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
269 switches::kDefaultTileHeight, "256"},
270 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
271 switches::kDefaultTileHeight, "512"},
272 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
273 switches::kDefaultTileHeight, "1024"}
276 const Experiment::Choice kSimpleCacheBackendChoices[] = {
277 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
278 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
279 switches::kUseSimpleCacheBackend, "off" },
280 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
281 switches::kUseSimpleCacheBackend, "on"}
284 #if defined(USE_AURA)
285 const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
286 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
287 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
288 switches::kTabCaptureUpscaleQuality, "fast" },
289 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
290 switches::kTabCaptureUpscaleQuality, "good" },
291 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
292 switches::kTabCaptureUpscaleQuality, "best" },
295 const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
296 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
297 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
298 switches::kTabCaptureDownscaleQuality, "fast" },
299 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
300 switches::kTabCaptureDownscaleQuality, "good" },
301 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
302 switches::kTabCaptureDownscaleQuality, "best" },
304 #endif
306 #if defined(USE_AURA) || defined(OS_LINUX)
307 const Experiment::Choice kOverlayScrollbarChoices[] = {
308 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
309 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
310 switches::kEnableOverlayScrollbar, ""},
311 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
312 switches::kDisableOverlayScrollbar, ""}
314 #endif
316 const Experiment::Choice kZeroCopyChoices[] = {
317 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
318 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
319 switches::kEnableZeroCopy, ""},
320 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
321 switches::kDisableZeroCopy, ""}
324 #if defined(OS_ANDROID)
325 const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
326 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
327 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
328 switches::kEnableZeroSuggestMostVisited, ""},
329 { IDS_FLAGS_ZERO_SUGGEST_ETHER_SERP,
330 switches::kEnableZeroSuggestEtherSerp, ""},
331 { IDS_FLAGS_ZERO_SUGGEST_ETHER_NO_SERP,
332 switches::kEnableZeroSuggestEtherNoSerp, ""},
333 { IDS_FLAGS_ZERO_SUGGEST_PERSONALIZED,
334 switches::kEnableZeroSuggestPersonalized, ""},
335 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
336 switches::kDisableZeroSuggest, ""}
338 #endif
340 const Experiment::Choice kNumRasterThreadsChoices[] = {
341 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
342 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
343 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
344 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
345 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
348 const Experiment::Choice kEnableGpuRasterizationChoices[] = {
349 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
350 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
351 switches::kEnableGpuRasterization, "" },
352 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
353 switches::kDisableGpuRasterization, "" },
354 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
355 switches::kForceGpuRasterization, "" },
358 // We're using independent flags here (as opposed to a common flag with
359 // different values) to be able to enable/disable the entire experience
360 // associated with this feature server-side from the FieldTrial (the complete
361 // experience includes other flag changes as well). It is not currently possible
362 // to do that with "flag=value" flags.
363 const Experiment::Choice kSearchButtonInOmniboxChoices[] = {
364 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
365 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
366 switches::kDisableSearchButtonInOmnibox, ""},
367 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR,
368 switches::kEnableSearchButtonInOmniboxForStr, ""},
369 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR_OR_IIP,
370 switches::kEnableSearchButtonInOmniboxForStrOrIip, ""},
371 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLED,
372 switches::kEnableSearchButtonInOmniboxAlways, ""}
375 // See comment above for kSearchButtonInOmniboxChoices. The same reasoning
376 // applies here.
377 const Experiment::Choice kOriginChipChoices[] = {
378 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
379 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kDisableOriginChip, ""},
380 { IDS_FLAGS_ORIGIN_CHIP_ALWAYS, switches::kEnableOriginChipAlways, ""},
381 { IDS_FLAGS_ORIGIN_CHIP_ON_SRP, switches::kEnableOriginChipOnSrp, ""}
384 const Experiment::Choice kTouchScrollingModeChoices[] = {
385 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
386 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL,
387 switches::kTouchScrollingMode,
388 switches::kTouchScrollingModeTouchcancel },
389 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE,
390 switches::kTouchScrollingMode,
391 switches::kTouchScrollingModeAsyncTouchmove },
392 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE,
393 switches::kTouchScrollingMode,
394 switches::kTouchScrollingModeSyncTouchmove },
397 #if defined(ENABLE_APP_LIST)
398 const Experiment::Choice kEnableSyncAppListChoices[] = {
399 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
400 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
401 app_list::switches::kEnableSyncAppList, "" },
402 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
403 app_list::switches::kDisableSyncAppList, "" },
405 #endif
407 const Experiment::Choice kExtensionContentVerificationChoices[] = {
408 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
409 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
410 switches::kExtensionContentVerification,
411 switches::kExtensionContentVerificationBootstrap },
412 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
413 switches::kExtensionContentVerification,
414 switches::kExtensionContentVerificationEnforce },
415 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
416 switches::kExtensionContentVerification,
417 switches::kExtensionContentVerificationEnforceStrict },
420 #if defined(OS_ANDROID)
421 const Experiment::Choice kAnswersInSuggestChoices[] = {
422 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
423 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
424 switches::kEnableAnswersInSuggest, ""},
425 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
426 switches::kDisableAnswersInSuggest, ""}
428 #endif
430 const Experiment::Choice kEnableSettingsWindowChoices[] = {
431 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
432 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
433 ::switches::kEnableSettingsWindow, "" },
434 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
435 ::switches::kDisableSettingsWindow, "" },
438 // Note that the value is specified in seconds (where 0 is equivalent to
439 // disabled).
440 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
441 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
442 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
443 switches::kRememberCertErrorDecisions,
444 "-1" },
445 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
446 switches::kRememberCertErrorDecisions,
447 "86400" },
448 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
449 switches::kRememberCertErrorDecisions,
450 "259200" },
451 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
452 switches::kRememberCertErrorDecisions,
453 "604800" },
454 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
455 switches::kRememberCertErrorDecisions,
456 "2592000" },
457 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
458 switches::kRememberCertErrorDecisions,
459 "7776000" },
462 const Experiment::Choice kEnableDropSyncCredentialChoices[] = {
463 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
464 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
465 password_manager::switches::kEnableDropSyncCredential, "" },
466 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
467 password_manager::switches::kDisableDropSyncCredential, "" },
470 #if defined(OS_MACOSX)
471 const Experiment::Choice kEnableAVFoundationChoices[] = {
472 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
473 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, switches::kEnableAVFoundation, ""},
474 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kForceQTKit, ""}
476 #endif
478 const Experiment::Choice kAutofillSyncCredentialChoices[] = {
479 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
480 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
481 password_manager::switches::kAllowAutofillSyncCredential, ""},
482 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
483 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
484 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
485 password_manager::switches::kDisallowAutofillSyncCredential, ""},
488 // RECORDING USER METRICS FOR FLAGS:
489 // -----------------------------------------------------------------------------
490 // The first line of the experiment is the internal name. If you'd like to
491 // gather statistics about the usage of your flag, you should append a marker
492 // comment to the end of the feature name, like so:
493 // "my-special-feature", // FLAGS:RECORD_UMA
495 // After doing that, run
496 // tools/metrics/actions/extract_actions.py
497 // to add the metric to actions.xml (which will enable UMA to record your
498 // feature flag), then update the <owner>s and <description> sections. Make sure
499 // to include the actions.xml file when you upload your code for review!
501 // After your feature has shipped under a flag, you can locate the metrics under
502 // the action name AboutFlags_internal-action-name. Actions are recorded once
503 // per startup, so you should divide this number by AboutFlags_StartupTick to
504 // get a sense of usage. Note that this will not be the same as number of users
505 // with a given feature enabled because users can quit and relaunch the
506 // application multiple times over a given time interval. The dashboard also
507 // shows you how many (metrics reporting) users have enabled the flag over the
508 // last seven days. However, note that this is not the same as the number of
509 // users who have the flag enabled, since enabling the flag happens once,
510 // whereas running with the flag enabled happens until the user flips the flag
511 // again.
513 // To add a new experiment add to the end of kExperiments. There are two
514 // distinct types of experiments:
515 // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
516 // macro for this type supplying the command line to the macro.
517 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
518 // deactivated state for this lab (i.e. no command line option). To specify
519 // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
520 // array of choices.
521 // See the documentation of Experiment for details on the fields.
523 // Command-line switches must have entries in enum "LoginCustomFlags" in
524 // histograms.xml. See note in histograms.xml and don't forget to run
525 // AboutFlagsHistogramTest unit test to calculate and verify checksum.
527 // When adding a new choice, add it to the end of the list.
528 const Experiment kExperiments[] = {
530 "ignore-gpu-blacklist",
531 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
532 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
533 kOsAll,
534 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
537 "disable_layer_squashing",
538 IDS_FLAGS_DISABLE_LAYER_SQUASHING_NAME,
539 IDS_FLAGS_DISABLE_LAYER_SQUASHING_DESCRIPTION,
540 kOsAll,
541 SINGLE_VALUE_TYPE(switches::kDisableLayerSquashing)
543 #if defined(OS_WIN)
545 "disable-direct-write",
546 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
547 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
548 kOsWin,
549 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
551 #endif
553 "enable-experimental-canvas-features",
554 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
555 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
556 kOsAll,
557 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
560 "disable-accelerated-2d-canvas",
561 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
562 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
563 kOsAll,
564 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
567 "enable-display-list-2d-canvas",
568 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
569 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
570 kOsAll,
571 MULTI_VALUE_TYPE(kEnableDisplayList2DcanvasChoices)
574 "composited-layer-borders",
575 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
576 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
577 kOsAll,
578 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
581 "show-fps-counter",
582 IDS_FLAGS_SHOW_FPS_COUNTER,
583 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
584 kOsAll,
585 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
588 "disable-webgl",
589 IDS_FLAGS_DISABLE_WEBGL_NAME,
590 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
591 kOsAll,
592 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
595 "disable-webrtc",
596 IDS_FLAGS_DISABLE_WEBRTC_NAME,
597 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
598 kOsAndroid,
599 #if defined(OS_ANDROID)
600 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
601 #else
602 SINGLE_VALUE_TYPE("")
603 #endif
605 #if defined(ENABLE_WEBRTC)
607 "disable-webrtc-hw-decoding",
608 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
609 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
610 kOsAndroid | kOsCrOS,
611 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
614 "disable-webrtc-hw-encoding",
615 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
616 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
617 kOsAndroid | kOsCrOS,
618 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
620 #endif
621 #if defined(OS_ANDROID)
623 "disable-webaudio",
624 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
625 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
626 kOsAndroid,
627 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
629 #endif
631 "enable-compositing-for-transition",
632 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME,
633 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION,
634 kOsAll,
635 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices)
637 // Native client is compiled out when DISABLE_NACL is defined.
638 #if !defined(DISABLE_NACL)
640 "enable-nacl", // FLAGS:RECORD_UMA
641 IDS_FLAGS_ENABLE_NACL_NAME,
642 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
643 kOsAll,
644 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
647 "enable-nacl-debug", // FLAGS:RECORD_UMA
648 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
649 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
650 kOsDesktop,
651 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
654 "nacl-debug-mask", // FLAGS:RECORD_UMA
655 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
656 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
657 kOsDesktop,
658 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
660 #endif
662 "extension-apis", // FLAGS:RECORD_UMA
663 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
664 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
665 kOsDesktop,
666 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
669 "extensions-on-chrome-urls",
670 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
671 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
672 kOsAll,
673 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
676 "enable-fast-unload",
677 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
678 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
679 kOsAll,
680 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
683 "enable-app-window-controls",
684 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
685 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
686 kOsDesktop,
687 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
690 "disable-hyperlink-auditing",
691 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
692 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
693 kOsAll,
694 SINGLE_VALUE_TYPE(switches::kNoPings)
696 #if defined(OS_ANDROID)
698 "contextual-search",
699 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
700 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
701 kOsAndroid,
702 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
703 switches::kDisableContextualSearch)
705 #endif
707 "show-autofill-type-predictions",
708 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
709 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
710 kOsAll,
711 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
714 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
715 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
716 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
717 // Can't expose the switch unless the code is compiled in.
718 // On by default for the Mac (different implementation in WebKit).
719 kOsLinux,
720 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
722 #if defined(USE_AURA) || defined(OS_LINUX)
724 "overlay-scrollbars",
725 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
726 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
727 // Uses the system preference on Mac (a different implementation).
728 // On Android, this is always enabled.
729 kOsLinux | kOsCrOS | kOsWin,
730 MULTI_VALUE_TYPE(kOverlayScrollbarChoices)
732 #endif
734 "enable-panels",
735 IDS_FLAGS_ENABLE_PANELS_NAME,
736 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
737 kOsDesktop,
738 SINGLE_VALUE_TYPE(switches::kEnablePanels)
741 // See http://crbug.com/120416 for how to remove this flag.
742 "save-page-as-mhtml", // FLAGS:RECORD_UMA
743 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
744 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
745 kOsMac | kOsWin | kOsLinux,
746 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
749 "enable-quic",
750 IDS_FLAGS_ENABLE_QUIC_NAME,
751 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
752 kOsAll,
753 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
754 switches::kDisableQuic)
757 "enable-spdy4",
758 IDS_FLAGS_ENABLE_SPDY4_NAME,
759 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
764 "enable-async-dns",
765 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
766 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
767 kOsWin | kOsMac | kOsLinux | kOsCrOS,
768 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
769 switches::kDisableAsyncDns)
772 "disable-media-source",
773 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
774 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
775 kOsAll,
776 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
779 "enable-encrypted-media",
780 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
781 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
782 kOsAll,
783 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
786 "disable-prefixed-encrypted-media",
787 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
788 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
789 kOsAll,
790 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
792 #if defined(OS_ANDROID)
794 "disable-infobar-for-protected-media-identifier",
795 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
796 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
797 kOsAndroid,
798 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
801 "mediadrm-enable-non-compositing",
802 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME,
803 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION,
804 kOsAndroid,
805 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing)
807 #endif // defined(OS_ANDROID)
809 "enable-javascript-harmony",
810 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
811 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
812 kOsAll,
813 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
816 "disable-software-rasterizer",
817 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
818 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
819 #if defined(ENABLE_SWIFTSHADER)
820 kOsAll,
821 #else
823 #endif
824 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
827 "enable-gpu-rasterization",
828 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
829 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
830 kOsAndroid,
831 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
834 "enable-experimental-web-platform-features",
835 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
836 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
837 kOsAll,
838 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
841 "disable-ntp-other-sessions-menu",
842 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
843 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
844 kOsDesktop,
845 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
848 "enable-material-design-ntp",
849 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_NAME,
850 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_DESCRIPTION,
851 kOsDesktop,
852 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMaterialDesignNTP,
853 switches::kDisableMaterialDesignNTP)
856 "enable-devtools-experiments",
857 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
858 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
859 kOsDesktop,
860 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
863 "silent-debugger-extension-api",
864 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
865 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
866 kOsDesktop,
867 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
870 "spellcheck-autocorrect",
871 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
872 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
873 kOsWin | kOsLinux | kOsCrOS,
874 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
877 "enable-scroll-prediction",
878 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
879 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
880 kOsDesktop,
881 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
884 "touch-events",
885 IDS_TOUCH_EVENTS_NAME,
886 IDS_TOUCH_EVENTS_DESCRIPTION,
887 kOsDesktop,
888 MULTI_VALUE_TYPE(kTouchEventsChoices)
891 "disable-touch-adjustment",
892 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
893 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
894 kOsWin | kOsLinux | kOsCrOS,
895 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
897 #if defined(OS_CHROMEOS)
899 "network-portal-notification",
900 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
901 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
902 kOsCrOS,
903 ENABLE_DISABLE_VALUE_TYPE(
904 chromeos::switches::kEnableNetworkPortalNotification,
905 chromeos::switches::kDisableNetworkPortalNotification)
907 #endif
909 "enable-download-resumption",
910 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
911 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
912 kOsDesktop,
913 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
915 #if defined(ENABLE_PLUGINS)
917 "allow-nacl-socket-api",
918 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
919 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
920 kOsDesktop,
921 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
923 #endif
924 #if defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_LINUX)
926 "force-device-scale-factor",
927 IDS_FLAGS_FORCE_DEVICE_SCALE_FACTOR_NAME,
928 IDS_FLAGS_FORCE_DEVICE_SCALE_FACTOR_DESCRIPTION,
929 kOsLinux | kOsWin | kOsCrOS,
930 MULTI_VALUE_TYPE(kDeviceScaleFactorChoices)
932 #endif
933 #if defined(OS_CHROMEOS)
935 "allow-touchpad-three-finger-click",
936 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
937 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
938 kOsCrOS,
939 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
942 "enable-easy-signin",
943 IDS_FLAGS_ENABLE_EASY_SIGNIN_NAME,
944 IDS_FLAGS_ENABLE_EASY_SIGNIN_DESCRIPTION,
945 kOsCrOSOwnerOnly,
946 SINGLE_VALUE_TYPE(chromeos::switches::kEnableEasySignin),
948 #endif
949 #if defined(USE_ASH)
951 "disable-minimize-on-second-launcher-item-click",
952 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
953 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
954 kOsAll,
955 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
958 "show-touch-hud",
959 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
960 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
961 kOsAll,
962 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
965 "enable-pinch",
966 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
967 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
968 kOsLinux | kOsWin | kOsCrOS,
969 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
971 #endif // defined(USE_ASH)
973 "enable-pinch-virtual-viewport",
974 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
975 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
976 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
977 ENABLE_DISABLE_VALUE_TYPE(
978 cc::switches::kEnablePinchVirtualViewport,
979 cc::switches::kDisablePinchVirtualViewport),
982 "enable-viewport-meta",
983 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
984 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
985 kOsLinux | kOsWin | kOsCrOS | kOsMac,
986 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
988 #if defined(OS_CHROMEOS)
990 "disable-boot-animation",
991 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
992 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
993 kOsCrOSOwnerOnly,
994 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
997 "enable-video-player-chromecast-support",
998 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
999 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
1000 kOsCrOS,
1001 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
1004 "disable-office-editing-component-app",
1005 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
1006 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
1007 kOsCrOS,
1008 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
1011 "disable-display-color-calibration",
1012 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
1013 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
1014 kOsCrOS,
1015 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
1017 #endif // defined(OS_CHROMEOS)
1018 { "disable-accelerated-video-decode",
1019 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1020 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
1021 kOsWin | kOsCrOS,
1022 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
1024 #if defined(USE_ASH)
1026 "ash-debug-shortcuts",
1027 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1028 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1029 kOsAll,
1030 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1032 { "ash-enable-touch-view-testing",
1033 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
1034 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
1035 kOsCrOS,
1036 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
1039 "ash-enable-touch-view-touch-feedback",
1040 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TOUCH_FEEDBACK_NAME,
1041 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TOUCH_FEEDBACK_DESCRIPTION,
1042 kOsCrOS,
1043 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTouchFeedback),
1045 { "ash-disable-text-filtering-in-overview-mode",
1046 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_NAME,
1047 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_DESCRIPTION,
1048 kOsCrOS,
1049 SINGLE_VALUE_TYPE(ash::switches::kAshDisableTextFilteringInOverviewMode),
1051 #endif // defined(USE_ASH)
1052 #if defined(OS_CHROMEOS)
1054 "enable-carrier-switching",
1055 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1056 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1057 kOsCrOS,
1058 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
1061 "enable-request-tablet-site",
1062 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1063 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1064 kOsCrOS,
1065 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
1067 #endif
1069 "debug-packed-apps",
1070 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1071 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1072 kOsDesktop,
1073 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1076 "enable-password-generation",
1077 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1078 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
1079 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1080 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1081 autofill::switches::kDisablePasswordGeneration)
1084 "enable-automatic-password-saving",
1085 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1086 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1087 kOsDesktop,
1088 SINGLE_VALUE_TYPE(
1089 password_manager::switches::kEnableAutomaticPasswordSaving)
1092 "password-manager-reauthentication",
1093 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1094 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
1095 kOsMac | kOsWin,
1096 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
1099 "enable-android-password-link",
1100 IDS_FLAGS_PASSWORD_MANAGER_ANDROID_LINK_NAME,
1101 IDS_FLAGS_PASSWORD_MANAGER_ANDROID_LINK_DESCRIPTION,
1102 kOsAndroid,
1103 ENABLE_DISABLE_VALUE_TYPE(
1104 password_manager::switches::kEnableAndroidPasswordLink,
1105 password_manager::switches::kDisableAndroidPasswordLink)
1108 "enable-deferred-image-decoding",
1109 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1110 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1111 kOsMac | kOsLinux | kOsCrOS,
1112 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1115 "wallet-service-use-sandbox",
1116 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1117 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
1118 kOsAndroid | kOsDesktop,
1119 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1120 autofill::switches::kWalletServiceUseSandbox, "1",
1121 autofill::switches::kWalletServiceUseSandbox, "0")
1123 #if defined(USE_AURA)
1125 "overscroll-history-navigation",
1126 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1127 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1128 kOsAll,
1129 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
1131 #endif
1133 "scroll-end-effect",
1134 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1135 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1136 kOsCrOS,
1137 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1138 switches::kScrollEndEffect, "1",
1139 switches::kScrollEndEffect, "0")
1142 "enable-renderer-mojo-channel",
1143 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_NAME,
1144 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_DESCRIPTION,
1145 kOsAll,
1146 SINGLE_VALUE_TYPE(switches::kEnableRendererMojoChannel)
1149 "enable-touch-drag-drop",
1150 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1151 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1152 kOsWin | kOsCrOS,
1153 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1154 switches::kDisableTouchDragDrop)
1157 "enable-touch-editing",
1158 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1159 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1160 kOsCrOS | kOsWin | kOsLinux,
1161 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1162 switches::kDisableTouchEditing)
1165 "enable-suggestions-service",
1166 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1167 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1168 kOsAndroid | kOsCrOS,
1169 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1170 switches::kDisableSuggestionsService)
1173 "enable-supervised-user-blacklist",
1174 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1175 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1176 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1177 SINGLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist)
1180 "enable-sync-synced-notifications",
1181 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1182 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
1183 kOsDesktop,
1184 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1185 switches::kDisableSyncSyncedNotifications)
1187 #if defined(ENABLE_APP_LIST)
1189 "enable-sync-app-list",
1190 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1191 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
1192 kOsDesktop,
1193 MULTI_VALUE_TYPE(kEnableSyncAppListChoices)
1195 #endif
1196 #if defined(OS_MACOSX)
1198 "enable-avfoundation",
1199 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1200 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
1201 kOsMac,
1202 MULTI_VALUE_TYPE(kEnableAVFoundationChoices)
1204 #endif
1206 "impl-side-painting",
1207 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1208 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
1209 kOsAll,
1210 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1213 "lcd-text-aa",
1214 IDS_FLAGS_LCD_TEXT_NAME,
1215 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1216 kOsDesktop,
1217 MULTI_VALUE_TYPE(kLCDTextChoices)
1219 #if defined(OS_ANDROID) || defined(OS_MACOSX)
1221 "delegated-renderer",
1222 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1223 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
1224 kOsAndroid, // TODO(ccameron) Add mac support soon.
1225 MULTI_VALUE_TYPE(kDelegatedRendererChoices)
1227 #endif
1229 "max-tiles-for-interest-area",
1230 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1231 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1232 kOsAll,
1233 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1236 "enable-offline-auto-reload",
1237 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1238 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1239 kOsAll,
1240 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1241 switches::kDisableOfflineAutoReload)
1244 "enable-offline-auto-reload-visible-only",
1245 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1246 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1247 kOsAll,
1248 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1249 switches::kDisableOfflineAutoReloadVisibleOnly)
1252 "enable-offline-load-stale-cache",
1253 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME,
1254 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION,
1255 kOsLinux | kOsMac | kOsWin | kOsAndroid,
1256 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache,
1257 switches::kDisableOfflineLoadStaleCache)
1260 "default-tile-width",
1261 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1262 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1263 kOsAll,
1264 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1267 "default-tile-height",
1268 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1269 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1270 kOsAll,
1271 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1273 #if defined(OS_ANDROID)
1275 "disable-gesture-requirement-for-media-playback",
1276 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1277 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1278 kOsAndroid,
1279 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1281 #endif
1282 #if defined(OS_CHROMEOS)
1284 "enable-virtual-keyboard",
1285 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1286 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1287 kOsCrOS,
1288 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1291 "enable-virtual-keyboard-overscroll",
1292 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1293 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1294 kOsCrOS,
1295 ENABLE_DISABLE_VALUE_TYPE(
1296 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1297 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1300 "enable-swipe-selection",
1301 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1302 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1303 kOsCrOS,
1304 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1307 "enable-input-view",
1308 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1309 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1310 kOsCrOS,
1311 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1312 keyboard::switches::kDisableInputView)
1315 "enable-experimental-input-view-features",
1316 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1317 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1318 kOsCrOS,
1319 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1321 #endif
1323 "enable-simple-cache-backend",
1324 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1325 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1326 kOsWin | kOsMac | kOsLinux | kOsCrOS,
1327 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1330 "enable-tcp-fast-open",
1331 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1332 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
1333 kOsLinux | kOsCrOS | kOsAndroid,
1334 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1336 #if defined(ENABLE_SERVICE_DISCOVERY)
1338 "device-discovery-notifications",
1339 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1340 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
1341 kOsDesktop,
1342 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1343 switches::kDisableDeviceDiscoveryNotifications)
1346 "enable-cloud-devices",
1347 IDS_FLAGS_ENABLE_CLOUD_DEVICES_NAME,
1348 IDS_FLAGS_ENABLE_CLOUD_DEVICES_DESCRIPTION,
1349 kOsDesktop,
1350 SINGLE_VALUE_TYPE(switches::kEnableCloudDevices)
1353 "enable-print-preview-register-promos",
1354 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1355 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
1356 kOsDesktop,
1357 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1359 #endif // ENABLE_SERVICE_DISCOVERY
1360 #if defined(OS_WIN)
1362 "enable-cloud-print-xps",
1363 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1364 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1365 kOsWin,
1366 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1368 #endif
1369 #if defined(USE_AURA)
1371 "tab-capture-upscale-quality",
1372 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1373 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1374 kOsAll,
1375 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1378 "tab-capture-downscale-quality",
1379 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1380 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1381 kOsAll,
1382 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1384 #endif
1386 "enable-spelling-feedback-field-trial",
1387 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1388 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
1389 kOsAll,
1390 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)
1393 "enable-webgl-draft-extensions",
1394 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1395 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1396 kOsAll,
1397 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1400 "enable-web-midi",
1401 IDS_FLAGS_ENABLE_WEB_MIDI_NAME,
1402 IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION,
1403 kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1404 SINGLE_VALUE_TYPE(switches::kEnableWebMIDI)
1407 "enable-new-profile-management",
1408 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1409 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
1410 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1411 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1412 switches::kDisableNewProfileManagement)
1415 "enable-account-consistency",
1416 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1417 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1418 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
1419 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1420 switches::kDisableAccountConsistency)
1423 "enable-fast-user-switching",
1424 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1425 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1426 kOsMac | kOsWin | kOsLinux,
1427 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1430 "enable-new-avatar-menu",
1431 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1432 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1433 kOsMac | kOsWin | kOsLinux,
1434 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1435 switches::kDisableNewAvatarMenu)
1438 "enable-web-based-signin",
1439 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_NAME,
1440 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_DESCRIPTION,
1441 kOsMac | kOsWin | kOsLinux,
1442 SINGLE_VALUE_TYPE(switches::kEnableWebBasedSignin)
1445 "enable-google-profile-info",
1446 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1447 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
1448 kOsMac | kOsWin | kOsLinux,
1449 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
1452 "reset-app-list-install-state",
1453 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1454 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
1455 kOsMac | kOsWin | kOsLinux,
1456 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
1458 #if defined(ENABLE_APP_LIST)
1459 #if defined(OS_LINUX)
1461 // This is compiled out on non-Linux platforms because otherwise it would be
1462 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1463 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1464 "enable-app-list",
1465 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1466 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1467 kOsLinux,
1468 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1470 #endif
1472 "enable-app-view",
1473 IDS_FLAGS_ENABLE_APP_VIEW_NAME,
1474 IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION,
1475 kOsDesktop,
1476 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppView)
1479 "disable-app-list-app-info",
1480 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST,
1481 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST_DESCRIPTION,
1482 kOsLinux | kOsWin | kOsCrOS,
1483 SINGLE_VALUE_TYPE(app_list::switches::kDisableAppInfo)
1486 "disable-drive-apps-in-app-list",
1487 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1488 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1489 kOsCrOS,
1490 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
1492 #endif
1493 #if defined(OS_ANDROID)
1495 "enable-accessibility-tab-switcher",
1496 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1497 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1498 kOsAndroid,
1499 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
1502 // TODO(dmazzoni): remove this flag when native android accessibility
1503 // ships in the stable channel. http://crbug.com/356775
1504 "enable-accessibility-script-injection",
1505 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1506 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
1507 kOsAndroid,
1508 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1509 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
1511 #endif
1513 "enable-one-copy",
1514 IDS_FLAGS_ONE_COPY_NAME,
1515 IDS_FLAGS_ONE_COPY_DESCRIPTION,
1516 kOsAll,
1517 SINGLE_VALUE_TYPE(switches::kEnableOneCopy)
1520 "enable-zero-copy",
1521 IDS_FLAGS_ZERO_COPY_NAME,
1522 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1523 kOsAll,
1524 MULTI_VALUE_TYPE(kZeroCopyChoices)
1526 #if defined(OS_CHROMEOS)
1528 "enable-first-run-ui-transitions",
1529 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1530 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1531 kOsCrOS,
1532 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1534 #endif
1536 "enable-streamlined-hosted-apps",
1537 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME,
1538 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION,
1539 kOsWin | kOsCrOS | kOsLinux,
1540 SINGLE_VALUE_TYPE(switches::kEnableStreamlinedHostedApps)
1543 "enable-ephemeral-apps",
1544 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_NAME,
1545 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_DESCRIPTION,
1546 kOsAll,
1547 SINGLE_VALUE_TYPE(switches::kEnableEphemeralApps)
1550 "enable-linkable-ephemeral-apps",
1551 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1552 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
1553 kOsAll,
1554 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1557 "enable-service-worker-sync",
1558 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1559 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1560 kOsAll,
1561 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1563 #if defined(OS_ANDROID)
1565 "disable-click-delay",
1566 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1567 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1568 kOsAndroid,
1569 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1570 SINGLE_VALUE_TYPE("disable-click-delay")
1572 #endif
1573 #if defined(OS_MACOSX)
1575 "enable-translate-new-ux",
1576 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1577 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
1578 kOsMac,
1579 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1581 #endif
1582 #if defined(TOOLKIT_VIEWS)
1584 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1585 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1586 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
1587 kOsCrOS | kOsWin | kOsLinux,
1588 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
1590 #endif
1592 "enable-apps-show-on-first-paint",
1593 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1594 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1595 kOsDesktop,
1596 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
1599 "enhanced-bookmarks-experiment",
1600 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1601 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1602 kOsDesktop | kOsAndroid,
1603 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1604 switches::kEnhancedBookmarksExperiment, "1",
1605 switches::kEnhancedBookmarksExperiment, "0")
1608 "manual-enhanced-bookmarks",
1609 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1610 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1611 kOsDesktop | kOsAndroid,
1612 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1615 "manual-enhanced-bookmarks-optout",
1616 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1617 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
1618 kOsDesktop | kOsAndroid,
1619 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1621 #if defined(OS_ANDROID)
1623 "enable-zero-suggest-experiment",
1624 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1625 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1626 kOsAndroid,
1627 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
1630 "enable-reader-mode-toolbar-icon",
1631 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1632 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1633 kOsAndroid,
1634 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1636 #endif
1638 "num-raster-threads",
1639 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1640 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1641 kOsAll,
1642 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
1645 "origin-chip-in-omnibox",
1646 IDS_FLAGS_ORIGIN_CHIP_NAME,
1647 IDS_FLAGS_ORIGIN_CHIP_DESCRIPTION,
1648 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1649 MULTI_VALUE_TYPE(kOriginChipChoices)
1652 "search-button-in-omnibox",
1653 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_NAME,
1654 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_DESCRIPTION,
1655 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1656 MULTI_VALUE_TYPE(kSearchButtonInOmniboxChoices)
1659 "disable-ignore-autocomplete-off",
1660 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_NAME,
1661 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_DESCRIPTION,
1662 kOsAll,
1663 SINGLE_VALUE_TYPE(autofill::switches::kDisableIgnoreAutocompleteOff)
1666 "enable-permissions-bubbles",
1667 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1668 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
1669 kOsCrOS | kOsMac | kOsWin | kOsLinux,
1670 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1671 switches::kDisablePermissionsBubbles)
1674 "enable-session-crashed-bubble",
1675 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1676 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1677 kOsWin | kOsLinux,
1678 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1679 switches::kDisableSessionCrashedBubble)
1682 "out-of-process-pdf",
1683 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1684 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1685 kOsDesktop,
1686 SINGLE_VALUE_TYPE(switches::kOutOfProcessPdf)
1688 #if defined(OS_ANDROID)
1690 "disable-cast",
1691 IDS_FLAGS_DISABLE_CAST_NAME,
1692 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
1693 kOsAndroid,
1694 SINGLE_VALUE_TYPE(switches::kDisableCast)
1697 "prefetch-search-results",
1698 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1699 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
1700 kOsAndroid,
1701 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1703 #endif
1704 #if defined(ENABLE_APP_LIST)
1706 "enable-experimental-app-list",
1707 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1708 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1709 kOsWin | kOsLinux | kOsCrOS,
1710 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList)
1713 "enable-centered-app-list",
1714 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1715 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
1716 kOsWin | kOsLinux | kOsCrOS,
1717 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
1719 #endif
1721 "touch-scrolling-mode",
1722 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME,
1723 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION,
1724 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1725 MULTI_VALUE_TYPE(kTouchScrollingModeChoices)
1728 "bleeding-edge-renderer-mode",
1729 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1730 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
1731 kOsAndroid,
1732 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1735 "enable-settings-window",
1736 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1737 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1738 kOsDesktop,
1739 MULTI_VALUE_TYPE(kEnableSettingsWindowChoices)
1741 #if defined(OS_ANDROID)
1743 "enable-instant-search-clicks",
1744 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1745 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1746 kOsAndroid,
1747 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1749 #endif
1751 "enable-save-password-bubble",
1752 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1753 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
1754 kOsWin | kOsLinux | kOsCrOS | kOsMac,
1755 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1756 switches::kDisableSavePasswordBubble)
1758 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1759 // crbug.com/366483 for the target milestone.
1761 "allow-insecure-websocket-from-https-origin",
1762 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME,
1763 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION,
1764 kOsAll,
1765 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin)
1768 "enable-apps-file-associations",
1769 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1770 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1771 kOsMac,
1772 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1774 #if defined(OS_ANDROID)
1776 "enable-embeddedsearch-api",
1777 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1778 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1779 kOsAndroid,
1780 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1783 "enable-app-install-alerts",
1784 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1785 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1786 kOsAndroid,
1787 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1789 #endif
1791 "distance-field-text",
1792 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1793 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1794 kOsAll,
1795 MULTI_VALUE_TYPE(kDistanceFieldTextChoices)
1798 "extension-content-verification",
1799 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1800 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1801 kOsDesktop,
1802 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1804 #if defined(USE_AURA)
1806 "text-input-focus-manager",
1807 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1808 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1809 kOsCrOS | kOsLinux | kOsWin,
1810 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1811 switches::kDisableTextInputFocusManager)
1813 #endif
1815 "extension-active-script-permission",
1816 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1817 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1818 kOsAll,
1819 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1822 "harfbuzz-rendertext",
1823 IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME,
1824 IDS_FLAGS_HARFBUZZ_RENDERTEXT_DESCRIPTION,
1825 kOsDesktop,
1826 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText,
1827 switches::kDisableHarfBuzzRenderText)
1829 #if defined(OS_ANDROID)
1831 "answers-in-suggest",
1832 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1833 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1834 kOsAndroid,
1835 MULTI_VALUE_TYPE(kAnswersInSuggestChoices)
1837 #endif
1838 #if defined(OS_ANDROID)
1840 "enable-data-reduction-proxy-dev",
1841 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1842 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1843 kOsAndroid,
1844 ENABLE_DISABLE_VALUE_TYPE(
1845 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1846 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1848 #endif
1850 "enable-experimental-hotwording",
1851 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_NAME,
1852 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION,
1853 kOsDesktop,
1854 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwording)
1857 "enable-embedded-extension-options",
1858 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1859 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1860 kOsDesktop,
1861 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1864 "enable-website-settings-manager",
1865 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1866 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1867 kOsDesktop,
1868 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1871 "remember-cert-error-decisions",
1872 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1873 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1874 kOsAll,
1875 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1878 "enable-drop-sync-credential",
1879 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1880 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1881 kOsAll,
1882 MULTI_VALUE_TYPE(kEnableDropSyncCredentialChoices)
1885 "enable-extension-action-redesign",
1886 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1887 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1888 kOsWin | kOsLinux | kOsCrOS,
1889 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
1892 "autofill-sync-credential",
1893 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1894 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1895 kOsAll,
1896 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
1898 #if !defined(OS_ANDROID)
1900 "enable-message-center-always-scroll-up-upon-notification-removal",
1901 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1902 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1903 kOsDesktop,
1904 SINGLE_VALUE_TYPE(
1905 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
1907 #endif
1908 #if defined(OS_CHROMEOS)
1910 "wake-on-packets",
1911 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1912 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1913 kOsCrOSOwnerOnly,
1914 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
1916 #endif // OS_CHROMEOS
1917 // NOTE: Adding new command-line switches requires adding corresponding
1918 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
1919 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
1922 const Experiment* experiments = kExperiments;
1923 size_t num_experiments = arraysize(kExperiments);
1925 // Stores and encapsulates the little state that about:flags has.
1926 class FlagsState {
1927 public:
1928 FlagsState() : needs_restart_(false) {}
1929 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
1930 CommandLine* command_line,
1931 SentinelsMode sentinels);
1932 bool IsRestartNeededToCommitChanges();
1933 void SetExperimentEnabled(
1934 FlagsStorage* flags_storage,
1935 const std::string& internal_name,
1936 bool enable);
1937 void RemoveFlagsSwitches(
1938 std::map<std::string, CommandLine::StringType>* switch_list);
1939 void ResetAllFlags(FlagsStorage* flags_storage);
1940 void reset();
1942 // Returns the singleton instance of this class
1943 static FlagsState* GetInstance() {
1944 return Singleton<FlagsState>::get();
1947 private:
1948 bool needs_restart_;
1949 std::map<std::string, std::string> flags_switches_;
1951 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1954 // Adds the internal names for the specified experiment to |names|.
1955 void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1956 if (e.type == Experiment::SINGLE_VALUE) {
1957 names->insert(e.internal_name);
1958 } else {
1959 DCHECK(e.type == Experiment::MULTI_VALUE ||
1960 e.type == Experiment::ENABLE_DISABLE_VALUE);
1961 for (int i = 0; i < e.num_choices; ++i)
1962 names->insert(e.NameForChoice(i));
1966 // Confirms that an experiment is valid, used in a DCHECK in
1967 // SanitizeList below.
1968 bool ValidateExperiment(const Experiment& e) {
1969 switch (e.type) {
1970 case Experiment::SINGLE_VALUE:
1971 DCHECK_EQ(0, e.num_choices);
1972 DCHECK(!e.choices);
1973 break;
1974 case Experiment::MULTI_VALUE:
1975 DCHECK_GT(e.num_choices, 0);
1976 DCHECK(e.choices);
1977 DCHECK(e.choices[0].command_line_switch);
1978 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
1979 break;
1980 case Experiment::ENABLE_DISABLE_VALUE:
1981 DCHECK_EQ(3, e.num_choices);
1982 DCHECK(!e.choices);
1983 DCHECK(e.command_line_switch);
1984 DCHECK(e.command_line_value);
1985 DCHECK(e.disable_command_line_switch);
1986 DCHECK(e.disable_command_line_value);
1987 break;
1988 default:
1989 NOTREACHED();
1991 return true;
1994 // Removes all experiments from prefs::kEnabledLabsExperiments that are
1995 // unknown, to prevent this list to become very long as experiments are added
1996 // and removed.
1997 void SanitizeList(FlagsStorage* flags_storage) {
1998 std::set<std::string> known_experiments;
1999 for (size_t i = 0; i < num_experiments; ++i) {
2000 DCHECK(ValidateExperiment(experiments[i]));
2001 AddInternalName(experiments[i], &known_experiments);
2004 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
2006 std::set<std::string> new_enabled_experiments =
2007 base::STLSetIntersection<std::set<std::string> >(
2008 known_experiments, enabled_experiments);
2010 if (new_enabled_experiments != enabled_experiments)
2011 flags_storage->SetFlags(new_enabled_experiments);
2014 void GetSanitizedEnabledFlags(
2015 FlagsStorage* flags_storage, std::set<std::string>* result) {
2016 SanitizeList(flags_storage);
2017 *result = flags_storage->GetFlags();
2020 bool SkipConditionalExperiment(const Experiment& experiment) {
2021 if (experiment.internal_name ==
2022 std::string("enhanced-bookmarks-experiment")) {
2023 #if defined(OS_ANDROID)
2024 // On Android, user can opt in.
2025 return false;
2026 #else
2027 CommandLine* command_line = CommandLine::ForCurrentProcess();
2028 // Dont't skip experiment if it has non default value.
2029 // It means user selected it.
2030 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment))
2031 return false;
2033 return !IsEnhancedBookmarksExperimentEnabled();
2034 #endif
2037 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2038 (experiment.internal_name ==
2039 std::string("manual-enhanced-bookmarks-optout"))) {
2040 return true;
2043 #if defined(OS_ANDROID)
2044 // enable-data-reduction-proxy-dev is only available for the Dev channel.
2045 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2046 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2047 return true;
2049 #endif
2051 return false;
2055 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2056 // enabled on the current platform.
2057 void GetSanitizedEnabledFlagsForCurrentPlatform(
2058 FlagsStorage* flags_storage, std::set<std::string>* result) {
2059 GetSanitizedEnabledFlags(flags_storage, result);
2061 // Filter out any experiments that aren't enabled on the current platform. We
2062 // don't remove these from prefs else syncing to a platform with a different
2063 // set of experiments would be lossy.
2064 std::set<std::string> platform_experiments;
2065 int current_platform = GetCurrentPlatform();
2066 for (size_t i = 0; i < num_experiments; ++i) {
2067 if (experiments[i].supported_platforms & current_platform)
2068 AddInternalName(experiments[i], &platform_experiments);
2069 #if defined(OS_CHROMEOS)
2070 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2071 AddInternalName(experiments[i], &platform_experiments);
2072 #endif
2075 std::set<std::string> new_enabled_experiments =
2076 base::STLSetIntersection<std::set<std::string> >(
2077 platform_experiments, *result);
2079 result->swap(new_enabled_experiments);
2082 // Returns the Value representing the choice data in the specified experiment.
2083 base::Value* CreateChoiceData(
2084 const Experiment& experiment,
2085 const std::set<std::string>& enabled_experiments) {
2086 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2087 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
2088 base::ListValue* result = new base::ListValue;
2089 for (int i = 0; i < experiment.num_choices; ++i) {
2090 base::DictionaryValue* value = new base::DictionaryValue;
2091 const std::string name = experiment.NameForChoice(i);
2092 value->SetString("internal_name", name);
2093 value->SetString("description", experiment.DescriptionForChoice(i));
2094 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
2095 result->Append(value);
2097 return result;
2100 } // namespace
2102 std::string Experiment::NameForChoice(int index) const {
2103 DCHECK(type == Experiment::MULTI_VALUE ||
2104 type == Experiment::ENABLE_DISABLE_VALUE);
2105 DCHECK_LT(index, num_choices);
2106 return std::string(internal_name) + testing::kMultiSeparator +
2107 base::IntToString(index);
2110 base::string16 Experiment::DescriptionForChoice(int index) const {
2111 DCHECK(type == Experiment::MULTI_VALUE ||
2112 type == Experiment::ENABLE_DISABLE_VALUE);
2113 DCHECK_LT(index, num_choices);
2114 int description_id;
2115 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2116 const int kEnableDisableDescriptionIds[] = {
2117 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2118 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2119 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2121 description_id = kEnableDisableDescriptionIds[index];
2122 } else {
2123 description_id = choices[index].description_id;
2125 return l10n_util::GetStringUTF16(description_id);
2128 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2129 CommandLine* command_line,
2130 SentinelsMode sentinels) {
2131 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
2132 command_line,
2133 sentinels);
2136 bool AreSwitchesIdenticalToCurrentCommandLine(
2137 const CommandLine& new_cmdline,
2138 const CommandLine& active_cmdline,
2139 std::set<CommandLine::StringType>* out_difference) {
2140 std::set<CommandLine::StringType> new_flags =
2141 ExtractFlagsFromCommandLine(new_cmdline);
2142 std::set<CommandLine::StringType> active_flags =
2143 ExtractFlagsFromCommandLine(active_cmdline);
2145 bool result = false;
2146 // Needed because std::equal doesn't check if the 2nd set is empty.
2147 if (new_flags.size() == active_flags.size()) {
2148 result =
2149 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2152 if (out_difference && !result) {
2153 std::set_symmetric_difference(
2154 new_flags.begin(),
2155 new_flags.end(),
2156 active_flags.begin(),
2157 active_flags.end(),
2158 std::inserter(*out_difference, out_difference->begin()));
2161 return result;
2164 void GetFlagsExperimentsData(FlagsStorage* flags_storage,
2165 FlagAccess access,
2166 base::ListValue* supported_experiments,
2167 base::ListValue* unsupported_experiments) {
2168 std::set<std::string> enabled_experiments;
2169 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2171 int current_platform = GetCurrentPlatform();
2173 for (size_t i = 0; i < num_experiments; ++i) {
2174 const Experiment& experiment = experiments[i];
2175 if (SkipConditionalExperiment(experiment))
2176 continue;
2178 base::DictionaryValue* data = new base::DictionaryValue();
2179 data->SetString("internal_name", experiment.internal_name);
2180 data->SetString("name",
2181 l10n_util::GetStringUTF16(experiment.visible_name_id));
2182 data->SetString("description",
2183 l10n_util::GetStringUTF16(
2184 experiment.visible_description_id));
2186 base::ListValue* supported_platforms = new base::ListValue();
2187 AddOsStrings(experiment.supported_platforms, supported_platforms);
2188 data->Set("supported_platforms", supported_platforms);
2190 switch (experiment.type) {
2191 case Experiment::SINGLE_VALUE:
2192 data->SetBoolean(
2193 "enabled",
2194 enabled_experiments.count(experiment.internal_name) > 0);
2195 break;
2196 case Experiment::MULTI_VALUE:
2197 case Experiment::ENABLE_DISABLE_VALUE:
2198 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2199 break;
2200 default:
2201 NOTREACHED();
2204 bool supported = (experiment.supported_platforms & current_platform) != 0;
2205 #if defined(OS_CHROMEOS)
2206 if (access == kOwnerAccessToFlags &&
2207 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2208 supported = true;
2210 #endif
2211 if (supported)
2212 supported_experiments->Append(data);
2213 else
2214 unsupported_experiments->Append(data);
2218 bool IsRestartNeededToCommitChanges() {
2219 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
2222 void SetExperimentEnabled(FlagsStorage* flags_storage,
2223 const std::string& internal_name,
2224 bool enable) {
2225 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2226 internal_name, enable);
2229 void RemoveFlagsSwitches(
2230 std::map<std::string, CommandLine::StringType>* switch_list) {
2231 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
2234 void ResetAllFlags(FlagsStorage* flags_storage) {
2235 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
2238 int GetCurrentPlatform() {
2239 #if defined(OS_MACOSX)
2240 return kOsMac;
2241 #elif defined(OS_WIN)
2242 return kOsWin;
2243 #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2244 return kOsCrOS;
2245 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
2246 return kOsLinux;
2247 #elif defined(OS_ANDROID)
2248 return kOsAndroid;
2249 #else
2250 #error Unknown platform
2251 #endif
2254 void RecordUMAStatistics(FlagsStorage* flags_storage) {
2255 std::set<std::string> flags = flags_storage->GetFlags();
2256 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
2257 ++it) {
2258 std::string action("AboutFlags_");
2259 action += *it;
2260 content::RecordComputedAction(action);
2262 // Since flag metrics are recorded every startup, add a tick so that the
2263 // stats can be made meaningful.
2264 if (flags.size())
2265 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
2266 content::RecordAction(UserMetricsAction("StartupTick"));
2269 base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2270 return static_cast<base::HistogramBase::Sample>(
2271 metrics::HashMetricName(switch_name));
2274 void ReportCustomFlags(const std::string& uma_histogram_hame,
2275 const std::set<std::string>& command_line_difference) {
2276 for (std::set<std::string>::const_iterator it =
2277 command_line_difference.begin();
2278 it != command_line_difference.end();
2279 ++it) {
2280 int uma_id = about_flags::kBadSwitchFormatHistogramId;
2281 if (StartsWithASCII(*it, "--", true /* case_sensitive */)) {
2282 // Skip '--' before switch name.
2283 std::string switch_name(it->substr(2));
2285 // Kill value, if any.
2286 const size_t value_pos = switch_name.find('=');
2287 if (value_pos != std::string::npos)
2288 switch_name.resize(value_pos);
2290 uma_id = GetSwitchUMAId(switch_name);
2291 } else {
2292 NOTREACHED() << "ReportCustomFlags(): flag '" << *it
2293 << "' has incorrect format.";
2295 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2296 << "' '" << *it << "', uma_id=" << uma_id;
2298 // Sparse histogram macro does not cache the histogram, so it's safe
2299 // to use macro with non-static histogram name here.
2300 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2304 //////////////////////////////////////////////////////////////////////////////
2305 // FlagsState implementation.
2307 namespace {
2309 typedef std::map<std::string, std::pair<std::string, std::string> >
2310 NameToSwitchAndValueMap;
2312 void SetFlagToSwitchMapping(const std::string& key,
2313 const std::string& switch_name,
2314 const std::string& switch_value,
2315 NameToSwitchAndValueMap* name_to_switch_map) {
2316 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2317 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2320 void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2321 CommandLine* command_line,
2322 SentinelsMode sentinels) {
2323 if (command_line->HasSwitch(switches::kNoExperiments))
2324 return;
2326 std::set<std::string> enabled_experiments;
2328 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2329 &enabled_experiments);
2331 NameToSwitchAndValueMap name_to_switch_map;
2332 for (size_t i = 0; i < num_experiments; ++i) {
2333 const Experiment& e = experiments[i];
2334 if (e.type == Experiment::SINGLE_VALUE) {
2335 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2336 e.command_line_value, &name_to_switch_map);
2337 } else if (e.type == Experiment::MULTI_VALUE) {
2338 for (int j = 0; j < e.num_choices; ++j) {
2339 SetFlagToSwitchMapping(e.NameForChoice(j),
2340 e.choices[j].command_line_switch,
2341 e.choices[j].command_line_value,
2342 &name_to_switch_map);
2344 } else {
2345 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2346 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2347 &name_to_switch_map);
2348 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2349 e.command_line_value, &name_to_switch_map);
2350 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2351 e.disable_command_line_value, &name_to_switch_map);
2355 if (sentinels == kAddSentinels) {
2356 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2357 flags_switches_.insert(
2358 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2359 std::string()));
2361 for (std::set<std::string>::iterator it = enabled_experiments.begin();
2362 it != enabled_experiments.end();
2363 ++it) {
2364 const std::string& experiment_name = *it;
2365 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
2366 name_to_switch_map.find(experiment_name);
2367 if (name_to_switch_it == name_to_switch_map.end()) {
2368 NOTREACHED();
2369 continue;
2372 const std::pair<std::string, std::string>&
2373 switch_and_value_pair = name_to_switch_it->second;
2375 CHECK(!switch_and_value_pair.first.empty());
2376 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2377 switch_and_value_pair.second);
2378 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
2380 if (sentinels == kAddSentinels) {
2381 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2382 flags_switches_.insert(
2383 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2384 std::string()));
2388 bool FlagsState::IsRestartNeededToCommitChanges() {
2389 return needs_restart_;
2392 void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2393 const std::string& internal_name,
2394 bool enable) {
2395 size_t at_index = internal_name.find(testing::kMultiSeparator);
2396 if (at_index != std::string::npos) {
2397 DCHECK(enable);
2398 // We're being asked to enable a multi-choice experiment. Disable the
2399 // currently selected choice.
2400 DCHECK_NE(at_index, 0u);
2401 const std::string experiment_name = internal_name.substr(0, at_index);
2402 SetExperimentEnabled(flags_storage, experiment_name, false);
2404 // And enable the new choice, if it is not the default first choice.
2405 if (internal_name != experiment_name + "@0") {
2406 std::set<std::string> enabled_experiments;
2407 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2408 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2409 flags_storage->SetFlags(enabled_experiments);
2411 return;
2414 std::set<std::string> enabled_experiments;
2415 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
2417 const Experiment* e = NULL;
2418 for (size_t i = 0; i < num_experiments; ++i) {
2419 if (experiments[i].internal_name == internal_name) {
2420 e = experiments + i;
2421 break;
2424 DCHECK(e);
2426 if (e->type == Experiment::SINGLE_VALUE) {
2427 if (enable)
2428 needs_restart_ |= enabled_experiments.insert(internal_name).second;
2429 else
2430 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
2431 } else {
2432 if (enable) {
2433 // Enable the first choice.
2434 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
2435 } else {
2436 // Find the currently enabled choice and disable it.
2437 for (int i = 0; i < e->num_choices; ++i) {
2438 std::string choice_name = e->NameForChoice(i);
2439 if (enabled_experiments.find(choice_name) !=
2440 enabled_experiments.end()) {
2441 needs_restart_ = true;
2442 enabled_experiments.erase(choice_name);
2443 // Continue on just in case there's a bug and more than one
2444 // experiment for this choice was enabled.
2450 flags_storage->SetFlags(enabled_experiments);
2453 void FlagsState::RemoveFlagsSwitches(
2454 std::map<std::string, CommandLine::StringType>* switch_list) {
2455 for (std::map<std::string, std::string>::const_iterator
2456 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
2457 switch_list->erase(it->first);
2461 void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
2462 needs_restart_ = true;
2464 std::set<std::string> no_experiments;
2465 flags_storage->SetFlags(no_experiments);
2468 void FlagsState::reset() {
2469 needs_restart_ = false;
2470 flags_switches_.clear();
2473 } // namespace
2475 namespace testing {
2477 // WARNING: '@' is also used in the html file. If you update this constant you
2478 // also need to update the html file.
2479 const char kMultiSeparator[] = "@";
2481 void ClearState() {
2482 FlagsState::GetInstance()->reset();
2485 void SetExperiments(const Experiment* e, size_t count) {
2486 if (!e) {
2487 experiments = kExperiments;
2488 num_experiments = arraysize(kExperiments);
2489 } else {
2490 experiments = e;
2491 num_experiments = count;
2495 const Experiment* GetExperiments(size_t* count) {
2496 *count = num_experiments;
2497 return experiments;
2500 } // namespace testing
2502 } // namespace about_flags