blob: a5b358f0b7b6cab7704cc56b4194c43daa38d46a [file] [log] [blame]
[email protected]9c66adc2012-01-05 02:10:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
7#include <algorithm>
8#include <iterator>
9#include <map>
10#include <set>
[email protected]83e9fa702013-02-25 19:30:4411#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0512
[email protected]ad2a3ded2010-08-27 13:19:0513#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1514#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5715#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4116#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0317#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0518#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5219#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3820#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0321#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0522#include "chrome/common/chrome_switches.h"
23#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3824#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0225#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0526#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0227#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0228#include "media/base/media_switches.h"
[email protected]c051a1b2011-01-21 23:30:1729#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5930#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4831#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2732#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2433#include "ui/keyboard/keyboard_switches.h"
[email protected]9a224572013-05-12 23:08:5634#include "ui/message_center/message_center_switches.h"
[email protected]fb1aac14e2013-05-14 05:30:2435#include "ui/surface/surface_switches.h"
[email protected]9a224572013-05-12 23:08:5636
[email protected]dc04be7c2012-03-15 23:57:4937#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3138#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4939#endif
40
[email protected]badba1ad2012-11-16 17:21:4641#if defined(OS_CHROMEOS)
42#include "chromeos/chromeos_switches.h"
43#endif
44
[email protected]7f6f44c2011-12-14 13:23:3845using content::UserMetricsAction;
46
[email protected]1a47d7e2010-10-15 00:37:2447namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0548
[email protected]8a6ff28d2010-12-02 16:35:1949// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5350#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4451 Experiment::SINGLE_VALUE, \
52 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5353#define SINGLE_VALUE_TYPE(command_line_switch) \
54 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4455#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
56 disable_switch, disable_value) \
57 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
58 disable_switch, disable_value, NULL, 3
59#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
60 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5361#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4462 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1963
[email protected]e2ddbc92010-10-15 20:02:0764namespace {
65
[email protected]9c7453d2012-01-21 00:45:4066const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5667const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0568
[email protected]cc3e2052011-12-20 01:01:4069// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
70// whether the experiment is available on that platform.
71void AddOsStrings(unsigned bitmask, ListValue* list) {
72 struct {
73 unsigned bit;
74 const char* const name;
75 } kBitsToOs[] = {
76 {kOsMac, "Mac"},
77 {kOsWin, "Windows"},
78 {kOsLinux, "Linux"},
79 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0180 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:5881 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[email protected]cc3e2052011-12-20 01:01:4082 };
83 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
84 if (bitmask & kBitsToOs[i].bit)
85 list->Append(new StringValue(kBitsToOs[i].name));
86}
87
[email protected]128dc6c2012-06-22 20:30:3588const Experiment::Choice
89 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
90 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
91 "",
92 "" },
93 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
94 switches::kOmniboxHistoryQuickProviderReorderForInlining,
95 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
97 switches::kOmniboxHistoryQuickProviderReorderForInlining,
98 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
99};
100
[email protected]032d5e6c2012-02-17 17:53:55101const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
102 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
103 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
104 switches::kOmniboxInlineHistoryQuickProvider,
105 switches::kOmniboxInlineHistoryQuickProviderAllowed },
106 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
107 switches::kOmniboxInlineHistoryQuickProvider,
108 switches::kOmniboxInlineHistoryQuickProviderProhibited }
109};
110
[email protected]fb854192013-02-06 01:30:04111const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
112 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
113 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
114 switches::kEnableCompositingForFixedPosition, ""},
115 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
116 switches::kDisableCompositingForFixedPosition, ""},
117 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
118 switches::kEnableHighDpiCompositingForFixedPosition, ""}
119};
120
[email protected]d8221b22013-05-23 05:35:43121const Experiment::Choice kEnableCompositingForTransitionChoices[] = {
122 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
123 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
124 switches::kEnableCompositingForTransition, ""},
125 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
126 switches::kDisableCompositingForTransition, ""},
127};
128
[email protected]8b1c3c72013-01-25 01:48:43129const Experiment::Choice kGDIPresentChoices[] = {
130 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
131 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
132 switches::kDoFirstShowPresentWithGDI, ""},
133 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
134 switches::kDoAllShowPresentWithGDI, ""}
135};
136
[email protected]d7932532012-11-21 21:10:31137const Experiment::Choice kTouchEventsChoices[] = {
138 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
139 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
140 switches::kTouchEvents,
141 switches::kTouchEventsEnabled },
142 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
143 switches::kTouchEvents,
144 switches::kTouchEventsDisabled }
145};
146
[email protected]347a0c72012-05-14 20:28:06147const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31148 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06150 switches::kTouchOptimizedUI,
151 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20152 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06153 switches::kTouchOptimizedUI,
154 switches::kTouchOptimizedUIDisabled }
155};
156
[email protected]66f409c2012-10-04 20:59:04157const Experiment::Choice kNaClDebugMaskChoices[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
159 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
160 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
161 // an option to switch off its debugging.
162 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
163 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
164 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
165 switches::kNaClDebugMask, "*://*/*debug.nmf" }
166};
167
[email protected]ea2f3342012-09-21 21:13:36168#if defined(OS_CHROMEOS)
[email protected]d96aef22012-10-30 11:47:02169
170const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]2f2d6c32013-05-10 02:56:24171 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]d96aef22012-10-30 11:47:02172 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24173 chromeos::switches::kEnableChromeCaptivePortalDetector, "" },
[email protected]ad2fe9f2012-11-15 11:03:19174 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24175 chromeos::switches::kDisableChromeCaptivePortalDetector, "" }
[email protected]d96aef22012-10-30 11:47:02176};
[email protected]a78c7432013-03-13 06:22:43177
[email protected]ea2f3342012-09-21 21:13:36178#endif
179
[email protected]9323fdd12013-02-23 00:31:36180const Experiment::Choice kImplSidePaintingChoices[] = {
181 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
182 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
183 cc::switches::kEnableImplSidePainting, ""},
184 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
185 cc::switches::kDisableImplSidePainting, ""}
186};
187
[email protected]a42c85f2013-04-04 18:15:12188const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
189 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
190 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
191 cc::switches::kMaxTilesForInterestArea, "64"},
192 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
193 cc::switches::kMaxTilesForInterestArea, "128"},
194 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
195 cc::switches::kMaxTilesForInterestArea, "256"},
196 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
197 cc::switches::kMaxTilesForInterestArea, "512"}
198};
199
[email protected]a3618122013-04-26 21:15:34200const Experiment::Choice kDefaultTileWidthChoices[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
202 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
203 switches::kDefaultTileWidth, "128"},
204 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
205 switches::kDefaultTileWidth, "256"},
206 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
207 switches::kDefaultTileWidth, "512"},
208 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
209 switches::kDefaultTileWidth, "1024"}
210};
211
212const Experiment::Choice kDefaultTileHeightChoices[] = {
213 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
214 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
215 switches::kDefaultTileHeight, "128"},
216 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
217 switches::kDefaultTileHeight, "256"},
218 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
219 switches::kDefaultTileHeight, "512"},
220 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
221 switches::kDefaultTileHeight, "1024"}
222};
223
[email protected]38484df12013-04-10 16:42:03224const Experiment::Choice kSimpleCacheBackendChoices[] = {
[email protected]9a3de3e32013-04-23 19:05:21225 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
227 switches::kUseSimpleCacheBackend, "off" },
[email protected]38484df12013-04-10 16:42:03228 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
229 switches::kUseSimpleCacheBackend, "on"}
230};
231
[email protected]4bc5050c2010-11-18 17:55:54232// RECORDING USER METRICS FOR FLAGS:
233// -----------------------------------------------------------------------------
234// The first line of the experiment is the internal name. If you'd like to
235// gather statistics about the usage of your flag, you should append a marker
236// comment to the end of the feature name, like so:
237// "my-special-feature", // FLAGS:RECORD_UMA
238//
239// After doing that, run //chrome/tools/extract_actions.py (see instructions at
240// the top of that file for details) to update the chromeactions.txt file, which
241// will enable UMA to record your feature flag.
242//
[email protected]783d5bb2012-10-24 03:47:14243// After your feature has shipped under a flag, you can locate the metrics under
244// the action name AboutFlags_internal-action-name. Actions are recorded once
245// per startup, so you should divide this number by AboutFlags_StartupTick to
246// get a sense of usage. Note that this will not be the same as number of users
247// with a given feature enabled because users can quit and relaunch the
248// application multiple times over a given time interval. The dashboard also
249// shows you how many (metrics reporting) users have enabled the flag over the
250// last seven days. However, note that this is not the same as the number of
251// users who have the flag enabled, since enabling the flag happens once,
252// whereas running with the flag enabled happens until the user flips the flag
253// again.
[email protected]4bc5050c2010-11-18 17:55:54254
[email protected]8a6ff28d2010-12-02 16:35:19255// To add a new experiment add to the end of kExperiments. There are two
256// distinct types of experiments:
257// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
258// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22259// . MULTI_VALUE: a list of choices, the first of which should correspond to a
260// deactivated state for this lab (i.e. no command line option). To specify
261// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
262// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19263// See the documentation of Experiment for details on the fields.
264//
265// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05266const Experiment kExperiments[] = {
267 {
[email protected]aac169d2011-03-18 19:53:03268 "expose-for-tabs", // FLAGS:RECORD_UMA
269 IDS_FLAGS_TABPOSE_NAME,
270 IDS_FLAGS_TABPOSE_DESCRIPTION,
271 kOsMac,
272#if defined(OS_MACOSX)
273 // The switch exists only on OS X.
274 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
275#else
276 SINGLE_VALUE_TYPE("")
277#endif
278 },
279 {
[email protected]4bc5050c2010-11-18 17:55:54280 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05281 IDS_FLAGS_CONFLICTS_CHECK_NAME,
282 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
283 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19284 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05285 },
286 {
[email protected]4bc5050c2010-11-18 17:55:54287 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
289 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45290 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22291 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31292 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22293 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
294 // always have PDF rasterization available, so no flag needed there.
295#if !defined(GOOGLE_CHROME_BUILD)
296 kOsWin,
297#else
298 0,
[email protected]fa6d2a2f2010-11-30 21:47:19299#endif
[email protected]8a6ff28d2010-12-02 16:35:19300 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42301 },
[email protected]60d77bd2012-08-22 00:10:07302#if defined(OS_WIN)
303 {
304 "print-raster",
305 IDS_FLAGS_PRINT_RASTER_NAME,
306 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
307 kOsWin,
308 SINGLE_VALUE_TYPE(switches::kPrintRaster)
309 },
310#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05311 {
[email protected]96c6f4c2011-05-18 19:36:22312 "ignore-gpu-blacklist",
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
314 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
315 kOsAll,
316 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
317 },
318 {
[email protected]0110cf112011-07-02 00:39:43319 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22320 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
321 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23322 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44323 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
324 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22325 },
326 {
[email protected]72787e392012-03-23 05:55:43327 "threaded-compositing-mode",
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
329 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58330 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44331 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
332 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59333 },
334 {
[email protected]17e27692013-02-06 17:02:09335 "force-accelerated-composited-scrolling",
336 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
337 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
338 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44339 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
340 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09341 },
342 {
[email protected]8b1c3c72013-01-25 01:48:43343 "present-with-GDI",
344 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
345 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
346 kOsWin,
347 MULTI_VALUE_TYPE(kGDIPresentChoices)
348 },
349 {
[email protected]2b608752013-05-01 03:34:36350 "enable-experimental-canvas-features",
351 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
352 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
353 kOsAll,
354 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
355 },
356 {
[email protected]81c64af62012-06-06 20:15:52357 "disable-accelerated-2d-canvas",
358 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
359 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
360 kOsAll,
361 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
362 },
363 {
[email protected]efcde132012-05-30 01:05:18364 "disable-threaded-animation",
365 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
366 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59367 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37368 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59369 },
370 {
[email protected]5963b772011-02-09 22:55:38371 "composited-layer-borders",
372 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
373 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
374 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57375 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38376 },
377 {
[email protected]a8f1eaa2011-03-07 19:00:58378 "show-fps-counter",
379 IDS_FLAGS_SHOW_FPS_COUNTER,
380 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
381 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57382 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58383 },
[email protected]8ff7f342011-05-25 01:49:47384 {
[email protected]70c98a332011-12-21 20:51:52385 "accelerated-filters",
386 IDS_FLAGS_ACCELERATED_FILTERS,
387 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
388 kOsAll,
389 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
390 },
391 {
[email protected]8ff7f342011-05-25 01:49:47392 "disable-gpu-vsync",
393 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
394 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56395 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47396 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
397 },
[email protected]deaba6d52011-09-23 14:47:12398 {
[email protected]4052d832013-01-16 05:31:01399 "enable-webgl",
400 IDS_FLAGS_ENABLE_WEBGL_NAME,
401 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
402 kOsAndroid,
403#if defined(OS_ANDROID)
404 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
405#else
406 SINGLE_VALUE_TYPE("")
407#endif
408 },
409 {
[email protected]deaba6d52011-09-23 14:47:12410 "disable-webgl",
411 IDS_FLAGS_DISABLE_WEBGL_NAME,
412 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56413 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01414#if defined(OS_ANDROID)
415 SINGLE_VALUE_TYPE("")
416#else
[email protected]deaba6d52011-09-23 14:47:12417 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01418#endif
[email protected]deaba6d52011-09-23 14:47:12419 },
[email protected]09096e02012-05-24 11:12:04420 {
[email protected]ce585bf2013-03-14 16:25:16421 "disable-webrtc",
422 IDS_FLAGS_DISABLE_WEBRTC_NAME,
423 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05424 kOsAndroid,
425#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16426 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05427#else
428 SINGLE_VALUE_TYPE("")
429#endif
430 },
[email protected]5e2bc8c2013-05-28 22:59:57431#if defined(ENABLE_WEBRTC)
[email protected]d816ddc2013-05-23 14:28:30432 {
433 "enable-sctp-data-channels",
434 IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_NAME,
435 IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_DESCRIPTION,
436 kOsAll,
437 SINGLE_VALUE_TYPE(switches::kEnableSCTPDataChannels)
438 },
[email protected]5e2bc8c2013-05-28 22:59:57439#endif
[email protected]34cb5292013-04-15 06:06:31440#if defined(OS_ANDROID)
441 {
442 "enable-webaudio",
443 IDS_FLAGS_ENABLE_WEBAUDIO_NAME,
444 IDS_FLAGS_ENABLE_WEBAUDIO_DESCRIPTION,
445 kOsAndroid,
446 SINGLE_VALUE_TYPE(switches::kEnableWebAudio)
447 },
448#endif
[email protected]d9da9582013-01-31 04:59:05449 {
[email protected]96bcdc102012-05-24 23:42:10450 "fixed-position-creates-stacking-context",
451 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
452 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
453 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44454 ENABLE_DISABLE_VALUE_TYPE(
455 switches::kEnableFixedPositionCreatesStackingContext,
456 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10457 },
[email protected]fb854192013-02-06 01:30:04458 {
459 "enable-compositing-for-fixed-position",
460 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
461 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
462 kOsAll,
463 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
464 },
[email protected]d8221b22013-05-23 05:35:43465 {
466 "enable-compositing-for-transition",
467 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME,
468 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION,
469 kOsAll,
470 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices)
471 },
[email protected]a7640ef22012-10-06 00:52:08472 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53473 {
[email protected]e3791ce92011-08-09 01:03:32474 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40475 IDS_FLAGS_ENABLE_NACL_NAME,
476 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56477 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19478 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40479 },
480 {
[email protected]9addd1c2012-09-15 14:28:24481 "enable-nacl-debug", // FLAGS:RECORD_UMA
482 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
483 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56484 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24485 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13486 },
487 {
[email protected]66f409c2012-10-04 20:59:04488 "nacl-debug-mask", // FLAGS:RECORD_UMA
489 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
490 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56491 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04492 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
493 },
494 {
[email protected]7babd1c2012-08-08 20:35:29495 "enable-pnacl", // FLAGS:RECORD_UMA
496 IDS_FLAGS_ENABLE_PNACL_NAME,
497 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56498 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29499 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
500 },
501 {
[email protected]4bc5050c2010-11-18 17:55:54502 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32503 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
504 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56505 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19506 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32507 },
[email protected]3627b06d2010-11-12 16:36:16508 {
[email protected]ac2e2acd2013-03-21 12:57:29509 "extensions-on-chrome-urls",
510 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
511 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
512 kOsAll,
513 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
514 },
515 {
[email protected]e9cddd52013-03-23 17:37:53516 "enable-adview",
517 IDS_FLAGS_ENABLE_ADVIEW_NAME,
518 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
519 kOsDesktop,
520 SINGLE_VALUE_TYPE(switches::kEnableAdview)
521 },
522 {
523 "enable-adview-src-attribute",
524 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
525 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
526 kOsDesktop,
527 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
528 },
529 {
[email protected]544471a2012-10-13 05:27:09530 "action-box",
[email protected]cab18ef2012-04-27 07:22:03531 IDS_FLAGS_ACTION_BOX_NAME,
532 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56533 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44534 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
535 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03536 },
537 {
[email protected]3a362432012-06-18 20:39:51538 "script-badges",
539 IDS_FLAGS_SCRIPT_BADGES_NAME,
540 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56541 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09542 SINGLE_VALUE_TYPE(switches::kScriptBadges)
543 },
544 {
545 "script-bubble",
546 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
547 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56548 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44549 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
550 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51551 },
552 {
[email protected]cbe224d2011-08-04 22:12:49553 "apps-new-install-bubble",
554 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
555 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56556 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49557 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
558 },
559 {
[email protected]80bd24e2010-11-30 09:34:38560 "disable-hyperlink-auditing",
561 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
562 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
563 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19564 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51565 },
566 {
567 "experimental-location-features", // FLAGS:RECORD_UMA
568 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
569 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
570 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19571 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
572 },
573 {
[email protected]5aea1862011-03-23 23:55:39574 "tab-groups-context-menu",
575 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
576 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
577 kOsWin,
578 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
579 },
[email protected]c94cebd2012-06-21 00:55:28580 {
581 "enable-instant-extended-api",
582 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
583 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56584 kOsDesktop,
[email protected]73444382013-02-26 19:31:51585 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
586 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28587 },
[email protected]e9bf9d92011-03-31 20:57:15588 {
[email protected]8cc9e532013-05-06 21:01:47589 "enable-local-first-load-ntp",
590 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP,
591 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP_DESCRIPTION,
592 kOsDesktop,
593 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalFirstLoadNTP,
594 switches::kDisableLocalFirstLoadNTP)
595 },
596 {
[email protected]07fd48a2013-04-13 02:53:27597 "enable-local-only-instant-extended-api",
598 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
599 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
600 kOsDesktop,
601 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
602 switches::kDisableLocalOnlyInstantExtendedAPI)
603 },
604 {
[email protected]354e33b2011-06-15 00:29:10605 "static-ip-config",
606 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
607 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
608 kOsCrOS,
609#if defined(OS_CHROMEOS)
610 // This switch exists only on Chrome OS.
[email protected]2f2d6c32013-05-10 02:56:24611 SINGLE_VALUE_TYPE(chromeos::switches::kEnableStaticIPConfig)
[email protected]354e33b2011-06-15 00:29:10612#else
613 SINGLE_VALUE_TYPE("")
614#endif
615 },
[email protected]3eb5728c2011-06-20 22:32:24616 {
617 "show-autofill-type-predictions",
618 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
619 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
620 kOsAll,
[email protected]e217c5632013-04-12 19:11:48621 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24622 },
[email protected]bff4d3e2011-06-21 23:58:52623 {
[email protected]a5e9faa2013-03-19 09:58:38624 "enable-sync-favicons",
625 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
626 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55627 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38628 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55629 },
630 {
[email protected]5d90a0a2012-11-15 02:43:40631 "sync-keystore-encryption",
632 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
633 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
634 kOsAll,
635 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
636 },
637 {
[email protected]e755a382012-09-13 17:16:35638 "enable-gesture-tap-highlight",
639 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
640 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
641 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47642 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
643 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35644 },
645 {
[email protected]a22ebd812011-06-23 00:05:39646 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
647 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
648 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
649 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40650 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25651 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39652 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
653 },
[email protected]81a6b0b2011-06-24 17:55:40654 {
[email protected]128dc6c2012-06-22 20:30:35655 "omnibox-history-quick-provider-reorder-for-inlining",
656 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
657 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
658 kOsAll,
659 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
660 },
661 {
[email protected]032d5e6c2012-02-17 17:53:55662 "omnibox-inline-history-quick-provider",
663 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
664 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
665 kOsAll,
666 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
667 },
668 {
[email protected]7e7a28092011-12-09 22:24:55669 "enable-panels",
670 IDS_FLAGS_ENABLE_PANELS_NAME,
671 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56672 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55673 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54674 },
[email protected]e3749d12011-07-25 22:22:12675 {
[email protected]27c14f02012-06-22 17:29:58676 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27677 "save-page-as-mhtml", // FLAGS:RECORD_UMA
678 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
679 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
680 kOsMac | kOsWin | kOsLinux,
681 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
682 },
683 {
[email protected]b7bb44f2011-09-01 05:17:03684 "enable-autologin",
685 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
686 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
687 kOsMac | kOsWin | kOsLinux,
688 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
689 },
[email protected]b9841172011-09-26 23:36:09690 {
[email protected]27b3fe92012-03-21 05:35:06691 "enable-async-dns",
692 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
693 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46694 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44695 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
696 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06697 },
698 {
[email protected]1eb93802012-09-11 18:57:56699 "disable-media-source",
[email protected]5bf1223a52013-05-14 21:42:31700 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_NAME,
701 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32702 kOsAll,
[email protected]5bf1223a52013-05-14 21:42:31703 SINGLE_VALUE_TYPE(switches::kDisableWebKitMediaSource)
[email protected]6aa03b32011-10-27 21:44:44704 },
[email protected]e4e68dbb2011-11-18 01:50:22705 {
[email protected]36d98412013-01-31 20:28:53706 "disable-encrypted-media",
707 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
708 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56709 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53710 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03711 },
[email protected]f88628792012-12-18 07:07:50712 {
713 "enable-opus-playback",
714 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
715 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56716 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50717 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
718 },
[email protected]ca6eaa5a2013-01-24 16:16:04719 {
[email protected]c54e1aa2013-01-25 09:26:17720 "enable-vp9-playback",
721 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
722 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
723 kOsDesktop,
724 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
725 },
726 {
[email protected]6ac955b2013-04-19 23:43:32727 "enable-vp8-alpha-playback",
728 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME,
729 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION,
730 kOsDesktop,
731 SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback)
732 },
733 {
[email protected]ca6eaa5a2013-01-24 16:16:04734 "enable-managed-users",
735 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
736 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58737 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04738 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
739 },
[email protected]dc04be7c2012-03-15 23:57:49740#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50741 {
[email protected]2a13a9a2013-04-19 04:00:21742 "ash-disable-auto-maximizing",
743 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
744 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
745 kOsWin | kOsLinux | kOsCrOS,
746 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
747 },
748 {
[email protected]cda278d2012-10-30 20:31:40749 "ash-disable-auto-window-placement",
750 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
751 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
752 kOsWin | kOsLinux | kOsCrOS,
753 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
754 },
[email protected]b4e4ec42012-11-29 21:42:40755 {
[email protected]16f55a22013-02-13 23:47:34756 "ash-disable-per-app-launcher",
757 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
758 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40759 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34760 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40761 },
[email protected]dc04be7c2012-03-15 23:57:49762#endif
[email protected]eaae8b462012-01-20 22:20:39763 {
[email protected]db543d322011-12-15 20:40:15764 "per-tile-painting",
765 IDS_FLAGS_PER_TILE_PAINTING_NAME,
766 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37767 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37768 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15769 },
[email protected]bf88c032011-12-22 19:05:47770 {
771 "enable-javascript-harmony",
772 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
773 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
774 kOsAll,
775 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
776 },
[email protected]7e7f378a2012-01-05 14:35:37777 {
[email protected]85646172012-01-09 22:45:54778 "enable-tab-browser-dragging",
779 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
780 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
781 kOsWin,
782 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
783 },
784 {
[email protected]068b7b52012-02-27 12:41:44785 "disable-restore-session-state",
786 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
787 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37788 kOsAll,
[email protected]068b7b52012-02-27 12:41:44789 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37790 },
[email protected]88864db2012-01-18 20:56:35791 {
792 "disable-software-rasterizer",
793 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
794 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
795#if defined(ENABLE_SWIFTSHADER)
796 kOsAll,
797#else
798 0,
799#endif
800 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
801 },
[email protected]15a5d722012-01-23 09:11:14802 {
[email protected]ff7b6dd2012-09-15 20:20:03803 "enable-experimental-webkit-features",
804 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
805 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16806 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03807 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49808 },
809 {
[email protected]0f95a252012-09-13 22:30:04810 "enable-css-shaders",
811 IDS_FLAGS_CSS_SHADERS_NAME,
812 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
813 kOsAll,
814 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
815 },
816 {
[email protected]3e8befc2012-03-13 01:17:03817 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16818 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
819 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56820 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03821 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16822 },
[email protected]dc04be7c2012-03-15 23:57:49823#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01824 {
[email protected]3cd198a22012-03-12 20:38:01825 "enable-ash-oak",
826 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
827 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
828 kOsAll,
829 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
830 },
[email protected]31cf1c52012-02-29 20:55:01831#endif
[email protected]184ec592012-03-01 11:54:28832 {
833 "enable-devtools-experiments",
834 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
835 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56836 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28837 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
838 },
[email protected]76d1854e2012-03-02 23:57:44839 {
[email protected]2fefdb32013-02-26 14:28:10840 "silent-debugger-extension-api",
841 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
842 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
843 kOsDesktop,
844 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
845 },
846 {
[email protected]76d1854e2012-03-02 23:57:44847 "enable-suggestions-ntp",
848 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
849 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56850 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44851 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
852 },
[email protected]a3d54252012-04-05 20:04:13853 {
[email protected]1dbaf5e2012-11-30 05:51:32854 "spellcheck-autocorrect",
855 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
856 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
857 kOsWin | kOsLinux | kOsCrOS,
858 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
859 },
860 {
[email protected]d7932532012-11-21 21:10:31861 "touch-events",
862 IDS_TOUCH_EVENTS_NAME,
863 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56864 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31865 MULTI_VALUE_TYPE(kTouchEventsChoices)
866 },
867 {
[email protected]c9c73ad42012-04-18 03:35:59868 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06869 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
870 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55871 kOsWin,
[email protected]347a0c72012-05-14 20:28:06872 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59873 },
[email protected]8a6aaa72012-04-20 20:53:58874 {
[email protected]b9c96ff2012-11-26 22:24:40875 "disable-touch-adjustment",
876 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
877 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
878 kOsWin | kOsLinux | kOsCrOS,
879 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
880 },
881 {
[email protected]0b9383a2012-10-26 00:58:16882 "enable-tab-capture",
883 IDS_ENABLE_TAB_CAPTURE_NAME,
884 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25885 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44886 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
887 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16888 },
[email protected]0b60afa2012-04-19 17:36:39889#if defined(OS_CHROMEOS)
890 {
[email protected]7c4a9bc2012-09-11 22:10:05891 "enable-background-loader",
892 IDS_ENABLE_BACKLOADER_NAME,
893 IDS_ENABLE_BACKLOADER_DESCRIPTION,
894 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24895 SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader)
[email protected]7c4a9bc2012-09-11 22:10:05896 },
897 {
[email protected]c5667b282012-08-31 00:32:50898 "enable-bezel-touch",
899 IDS_ENABLE_BEZEL_TOUCH_NAME,
900 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47901 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50902 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47903 },
904 {
[email protected]3f4181a2013-02-01 21:31:07905 "enable-screensaver-extension",
906 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
907 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
908 kOsCrOS,
909 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
910 },
911 {
[email protected]0b60afa2012-04-19 17:36:39912 "no-discard-tabs",
913 IDS_FLAGS_NO_DISCARD_TABS_NAME,
914 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
915 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24916 SINGLE_VALUE_TYPE(chromeos::switches::kNoDiscardTabs)
[email protected]0b60afa2012-04-19 17:36:39917 },
918#endif
[email protected]79be6d32012-04-24 20:47:44919 {
[email protected]8d68a3e02013-01-12 15:57:10920 "enable-download-resumption",
921 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
922 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56923 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10924 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
925 },
926 {
[email protected]9a5940d2012-04-27 19:16:23927 "allow-nacl-socket-api",
928 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
929 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56930 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23931 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
932 },
[email protected]85333732012-05-01 19:02:24933 {
[email protected]60673ad72012-05-02 06:16:33934 "stacked-tab-strip",
935 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
936 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
937 kOsWin,
938 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
939 },
940 {
[email protected]4bd20202012-06-14 17:35:01941 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24942 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
943 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
944 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01945 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24946 },
[email protected]190349fd2012-05-02 00:10:47947#if defined(OS_CHROMEOS)
948 {
949 "allow-touchpad-three-finger-click",
950 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
951 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
952 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24953 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
[email protected]190349fd2012-05-02 00:10:47954 },
[email protected]fbc176b62012-10-27 02:19:58955 {
956 "allow-touchpad-three-finger-swipe",
957 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
958 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
959 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24960 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerSwipe)
[email protected]fbc176b62012-10-27 02:19:58961 },
[email protected]190349fd2012-05-02 00:10:47962#endif
[email protected]1992a2f42012-10-23 18:32:21963 {
[email protected]a585e462013-01-26 00:37:15964 "use-client-login-signin-flow",
965 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
966 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21967 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15968 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21969 },
[email protected]8ee02242012-12-04 15:23:32970 {
971 "enable-desktop-guest-mode",
972 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
973 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
974 kOsMac | kOsWin | kOsLinux,
975 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
976 },
[email protected]53520b1b2012-05-07 21:43:37977#if defined(USE_ASH)
978 {
[email protected]8257d382013-03-26 13:08:42979 "show-launcher-alignment-menu",
980 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
981 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42982 kOsAll,
[email protected]8257d382013-03-26 13:08:42983 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42984 },
985 {
[email protected]2ddf37b2013-04-20 01:15:58986 "disable-minimize-on-second-launcher-item-click",
987 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
988 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
989 kOsAll,
990 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
991 },
992 {
[email protected]73074742012-05-17 01:44:41993 "show-touch-hud",
994 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
995 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
996 kOsAll,
997 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
998 },
999 {
[email protected]9f0940b62012-05-23 22:56:351000 "enable-pinch",
1001 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
1002 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:061003 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:381004 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
1005 },
1006 {
[email protected]de0aaed2013-05-27 18:16:431007 "enable-pinch-virtual-viewport",
1008 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
1009 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
1010 kOsLinux | kOsWin | kOsCrOS,
1011 SINGLE_VALUE_TYPE(cc::switches::kEnablePinchVirtualViewport),
1012 },
1013 {
[email protected]a4016f12013-05-02 07:53:471014 "forced-maximize-mode",
1015 IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME,
1016 IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION,
1017 kOsLinux | kOsWin | kOsCrOS,
1018 SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode),
1019 },
[email protected]73074742012-05-17 01:44:411020#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281021#if defined(OS_CHROMEOS)
1022 {
[email protected]8b04a1652012-08-04 02:59:491023 "disable-boot-animation",
1024 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1025 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581026 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241027 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:491028 },
[email protected]95058572012-08-20 14:57:291029 {
[email protected]d96aef22012-10-30 11:47:021030 "captive-portal-detector",
1031 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1032 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581033 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021034 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1035 },
1036 {
[email protected]c11aa8f12012-12-18 18:43:141037 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571038 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1039 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1040 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141041 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571042 },
[email protected]f0280952012-11-06 20:30:501043 {
[email protected]ea2fab32013-04-16 06:55:021044 "file-manager-legacy",
1045 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1046 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231047 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241048 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231049 },
[email protected]3e035e82012-11-27 20:54:321050 {
[email protected]828d99052013-04-22 08:15:031051 "file-manager-legacy-ui",
1052 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_NAME,
1053 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_DESCRIPTION,
[email protected]bc545292013-04-18 14:33:101054 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241055 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacyUI),
[email protected]bc545292013-04-18 14:33:101056 },
1057 {
[email protected]c64d7732013-03-25 18:09:501058 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521059 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1060 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581061 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241062 SINGLE_VALUE_TYPE(chromeos::switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471063 },
[email protected]6ad015c2013-03-06 00:49:511064 {
[email protected]c64d7732013-03-25 18:09:501065 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521066 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1067 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511068 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521069 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511070 },
[email protected]099b890c2013-04-25 19:16:261071 {
1072 "disable-quickoffice-component-app",
1073 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
1074 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
1075 kOsCrOS,
1076 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp),
1077 },
[email protected]d918af92013-05-29 00:06:201078 {
1079 "enable-kiosk-app-settings",
1080 IDS_FLAGS_ENABLE_KIOSK_APP_SETTINGS_NAME,
1081 IDS_FLAGS_ENABLE_KIOSK_APP_SETTINGS_DESCRIPTION,
1082 kOsCrOSOwnerOnly,
1083 SINGLE_VALUE_TYPE(chromeos::switches::kEnableKioskAppSettings),
1084 },
[email protected]62018dc2012-12-13 00:37:351085#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391086 {
[email protected]6247aba2013-03-04 22:57:181087 "views-textfield",
1088 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1089 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391090 kOsWin,
[email protected]6247aba2013-03-04 22:57:181091 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1092 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391093 },
[email protected]bd0cd3bb2012-06-14 03:03:381094 {
[email protected]ffbe5782013-05-09 23:22:081095 "new-dialog-style",
1096 IDS_FLAGS_NEW_DIALOG_STYLE_NAME,
1097 IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321098 kOsWin | kOsCrOS,
[email protected]ffbe5782013-05-09 23:22:081099 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle,
1100 switches::kDisableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321101 },
[email protected]7db8893a2012-07-26 00:49:401102 { "disable-accelerated-video-decode",
1103 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1104 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191105 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401106 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151107 },
[email protected]66ae9fc2012-06-19 21:33:521108#if defined(USE_ASH)
1109 {
1110 "ash-debug-shortcuts",
1111 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1112 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1113 kOsAll,
1114 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1115 },
1116#endif
[email protected]37fee0942012-08-07 21:07:451117 {
[email protected]ad3f6d22012-08-29 02:34:191118 "enable-contacts",
1119 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1120 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1121 kOsCrOS,
1122 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1123 },
[email protected]1d9bb9cd2012-08-28 22:02:501124#if defined(USE_ASH)
1125 { "ash-enable-advanced-gestures",
1126 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1127 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1128 kOsCrOS,
1129 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1130 },
[email protected]cfa24e62013-02-13 21:19:111131 { "ash-disable-tab-scrubbing",
1132 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1133 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161134 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111135 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161136 },
[email protected]ad6fcc32013-05-30 03:46:481137 { "ash-disable-drag-and-drop-applist-to-launcher",
[email protected]00c8469e22013-05-08 21:40:081138 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME,
1139 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION,
1140 kOsCrOS,
[email protected]ad6fcc32013-05-30 03:46:481141 SINGLE_VALUE_TYPE(ash::switches::kAshDisableDragAndDropAppListToLauncher),
[email protected]00c8469e22013-05-08 21:40:081142 },
[email protected]83eef802012-12-02 07:43:521143 { "ash-enable-workspace-scrubbing",
1144 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1145 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1146 kOsCrOS,
1147 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1148 },
[email protected]cf2b1a82013-04-20 01:05:431149 { "ash-immersive-fullscreen-2",
[email protected]819e58d22013-03-20 00:16:111150 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1151 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241152 kOsCrOS,
[email protected]cf2b1a82013-04-20 01:05:431153 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen,
1154 ash::switches::kAshDisableImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241155 },
[email protected]316708a2012-11-05 22:57:021156#if defined(OS_LINUX)
1157 { "ash-enable-memory-monitor",
1158 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1159 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1160 kOsCrOS,
1161 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1162 },
1163#endif
[email protected]1d9bb9cd2012-08-28 22:02:501164#endif
[email protected]9b7ab882012-09-10 23:46:361165#if defined(OS_CHROMEOS)
[email protected]1f9fa302013-05-17 21:11:131166 { "use-new-network-configuration-handlers",
1167 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_NAME,
1168 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_DESCRIPTION,
1169 kOsCrOS,
1170 SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConfigurationHandlers),
1171 },
[email protected]9b7ab882012-09-10 23:46:361172 {
[email protected]354ff2d2013-05-01 17:06:311173 "ash-enable-new-audio-handler2",
[email protected]db5be732013-04-24 05:21:121174 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME,
1175 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_DESCRIPTION,
1176 kOsCrOS,
[email protected]354ff2d2013-05-01 17:06:311177 ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableNewAudioHandler)
1178 },
1179 {
1180 "ash-audio-device-menu",
1181 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME,
1182 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION,
1183 kOsCrOS,
1184 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu)
[email protected]db5be732013-04-24 05:21:121185 },
1186 {
[email protected]205f07892012-10-16 20:26:221187 "enable-carrier-switching",
1188 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1189 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1190 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241191 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221192 },
1193 {
[email protected]9b7ab882012-09-10 23:46:361194 "enable-request-tablet-site",
1195 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1196 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1197 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241198 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361199 },
1200#endif
[email protected]dab49c0b2012-10-04 05:55:351201 {
1202 "debug-packed-apps",
1203 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1204 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561205 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351206 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1207 },
[email protected]d1459ed2012-10-10 01:29:331208 {
1209 "enable-password-generation",
1210 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1211 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561212 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331213 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1214 },
[email protected]26d045f2012-10-18 21:18:431215 {
[email protected]76f7d4882012-10-26 21:09:221216 "enable-deferred-image-decoding",
1217 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1218 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221219 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221220 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1221 },
1222 {
[email protected]075543d2012-10-24 01:29:141223 "performance-monitor-gathering",
1224 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1225 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1226 kOsAll,
1227 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1228 },
[email protected]783d5bb2012-10-24 03:47:141229 {
[email protected]90b482d2013-04-04 10:45:581230 "disable-native-autofill-ui",
1231 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1232 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431233 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581234 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431235 },
1236 {
[email protected]a7259fb2012-11-08 06:22:231237 "enable-experimental-form-filling",
1238 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1239 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1240 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481241 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231242 },
[email protected]6e6efe42013-01-30 00:04:501243 {
[email protected]db3178c2013-03-21 14:54:541244 "wallet-service-use-prod",
1245 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1246 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1247 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481248 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541249 },
1250 {
[email protected]6e6efe42013-01-30 00:04:501251 "enable-interactive-autocomplete",
1252 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1253 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]dc1cb7d82013-05-22 18:00:001254 kOsWin | kOsCrOS | kOsAndroid,
[email protected]000f3ad2013-05-16 02:19:171255 ENABLE_DISABLE_VALUE_TYPE(
1256 autofill::switches::kEnableInteractiveAutocomplete,
1257 autofill::switches::kDisableInteractiveAutocomplete)
[email protected]6e6efe42013-01-30 00:04:501258 },
[email protected]177260c2013-04-24 01:47:381259#if defined(USE_AURA)
1260 {
1261 "overscroll-history-navigation",
1262 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1263 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1264 kOsAll,
1265 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1266 switches::kOverscrollHistoryNavigation, "1",
1267 switches::kOverscrollHistoryNavigation, "0")
1268 },
1269#endif
[email protected]edbea622012-11-28 20:39:381270 {
1271 "enable-touch-drag-drop",
1272 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1273 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1274 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271275 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1276 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381277 },
[email protected]0e2f43b62013-02-21 00:47:151278 {
1279 "enable-touch-editing",
1280 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1281 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1282 kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271283 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1284 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151285 },
[email protected]92e12dd92012-12-11 03:33:201286 {
1287 "enable-rich-notifications",
1288 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1289 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
[email protected]ed4004b52013-05-07 13:25:001290 kOsWin | kOsCrOS | kOsMac,
[email protected]aee412aa2013-04-02 20:01:231291 ENABLE_DISABLE_VALUE_TYPE(
1292 message_center::switches::kEnableRichNotifications,
1293 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201294 },
[email protected]4d51c682012-12-11 11:34:551295 {
[email protected]ddec1aa2013-04-28 23:22:451296 "enable-sync-synced-notifications",
1297 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1298 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
[email protected]43168932013-05-24 06:35:181299 kOsDesktop,
[email protected]ddec1aa2013-04-28 23:22:451300 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1301 switches::kDisableSyncSyncedNotifications)
1302 },
1303 {
[email protected]a50e16a2013-04-25 14:07:171304 "disable-full-history-sync",
[email protected]4d51c682012-12-11 11:34:551305 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1306 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1307 kOsAll,
[email protected]a50e16a2013-04-25 14:07:171308 SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync)
[email protected]4d51c682012-12-11 11:34:551309 },
[email protected]628a69a92012-12-23 04:09:341310 {
[email protected]fd030142013-02-08 02:04:381311 "enable-usermedia-screen-capture",
1312 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1313 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1314 kOsDesktop,
1315 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1316 },
[email protected]5b93e162013-02-19 06:33:091317 {
1318 "enable-apps-devtool-app",
1319 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1320 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1321 kOsDesktop,
1322 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1323 },
[email protected]9323fdd12013-02-23 00:31:361324 {
1325 "impl-side-painting",
1326 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1327 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041328 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361329 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1330 },
[email protected]a42c85f2013-04-04 18:15:121331 {
[email protected]1c92d3e2013-04-18 05:31:391332 "enable-websocket-experimental-implementation",
1333 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1334 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1335 kOsAll,
1336 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1337 },
1338 {
[email protected]a42c85f2013-04-04 18:15:121339 "max-tiles-for-interest-area",
1340 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1341 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1342 kOsAndroid | kOsLinux | kOsCrOS,
1343 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1344 },
[email protected]7cf7ccb2013-04-20 02:53:081345 {
1346 "enable-offline-mode",
1347 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME,
1348 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION,
1349 kOsAll,
1350 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess)
1351 },
[email protected]a3618122013-04-26 21:15:341352 {
1353 "default-tile-width",
1354 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1355 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1356 kOsAll,
1357 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1358 },
1359 {
1360 "default-tile-height",
1361 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1362 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1363 kOsAll,
1364 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1365 },
[email protected]2f2f72b2013-03-08 22:37:311366 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1367#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371368 {
1369 "track-active-visit-time",
1370 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1371 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1372 kOsWin,
1373 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1374 },
[email protected]2f2f72b2013-03-08 22:37:311375#endif
[email protected]8cc71d42013-03-02 17:26:081376#if defined(OS_ANDROID)
1377 {
1378 "disable-gesture-requirement-for-media-playback",
1379 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1380 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1381 kOsAndroid,
1382 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1383 },
1384#endif
[email protected]6077cab2013-03-11 19:36:141385#if defined(ENABLE_GOOGLE_NOW)
1386 {
1387 "enable-google-now",
1388 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1389 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1390 kOsWin | kOsCrOS,
1391 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1392 },
1393#endif
[email protected]4a9e2e02013-04-08 16:19:491394 {
1395 "enable-translate-alpha-languages",
1396 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1397 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1398 kOsAll,
1399 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1400 },
[email protected]86459e2c2013-04-10 13:39:241401#if defined(OS_CHROMEOS)
1402 {
1403 "enable-virtual-keyboard",
1404 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1405 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1406 kOsCrOS,
1407 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1408 },
1409#endif
[email protected]38484df12013-04-10 16:42:031410 {
1411 "enable-simple-cache-backend",
1412 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1413 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1414 kOsAndroid,
1415 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1416 },
[email protected]717e4e22013-04-10 20:52:231417 {
1418 "enable-tcp-fast-open",
1419 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1420 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111421 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231422 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1423 },
[email protected]8027acd2013-04-18 08:35:151424 {
1425 "enable-webp-in-accept-header",
1426 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1427 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1428 kOsAll,
1429 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1430 },
[email protected]58c740f2013-05-06 05:25:441431 {
1432 "apps-use-native-frame",
1433 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME,
1434 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION,
1435 kOsWin,
1436 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame)
1437 },
[email protected]896d86b32013-05-09 19:36:441438 {
1439 "enable-syncfs-directory-operation",
1440 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME,
1441 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION,
1442 kOsAll,
1443 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
1444 },
[email protected]a4ed7e12013-05-24 01:00:281445 {
1446 "enable-draggable-menu-button",
1447 IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_NAME,
1448 IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_DESCRIPTION,
1449 kOsAndroid,
1450 SINGLE_VALUE_TYPE(switches::kEnableDraggableMenuButton)
1451 },
[email protected]380532aa2013-05-24 11:59:351452 {
1453 "enable-reset-profile-settings",
1454 IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_NAME,
1455 IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_DESCRIPTION,
1456 kOsAll,
1457 SINGLE_VALUE_TYPE(switches::kEnableResetProfileSettings)
1458 },
[email protected]56d3c6e42013-05-29 11:28:011459#if defined(OS_MACOSX)
1460 {
1461 "enable-app-list-shim",
1462 IDS_FLAGS_ENABLE_APP_LIST_SHIM_NAME,
1463 IDS_FLAGS_ENABLE_APP_LIST_SHIM_DESCRIPTION,
1464 kOsMac,
1465 SINGLE_VALUE_TYPE(switches::kEnableAppListShim)
1466 },
1467#endif
[email protected]a0e4b072011-08-17 01:47:071468};
[email protected]ad2a3ded2010-08-27 13:19:051469
[email protected]a314ee5a2010-10-26 21:23:281470const Experiment* experiments = kExperiments;
1471size_t num_experiments = arraysize(kExperiments);
1472
[email protected]e2ddbc92010-10-15 20:02:071473// Stores and encapsulates the little state that about:flags has.
1474class FlagsState {
1475 public:
1476 FlagsState() : needs_restart_(false) {}
1477 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1478 bool IsRestartNeededToCommitChanges();
1479 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281480 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071481 void RemoveFlagsSwitches(
1482 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001483 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071484 void reset();
1485
1486 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551487 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071488 return Singleton<FlagsState>::get();
1489 }
1490
1491 private:
1492 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531493 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071494
1495 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1496};
1497
[email protected]c7b7800a2010-10-07 18:51:351498// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491499// in a set.
[email protected]1a47d7e2010-10-15 00:37:241500void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051501 const ListValue* enabled_experiments = prefs->GetList(
1502 prefs::kEnabledLabsExperiments);
1503 if (!enabled_experiments)
1504 return;
1505
1506 for (ListValue::const_iterator it = enabled_experiments->begin();
1507 it != enabled_experiments->end();
1508 ++it) {
1509 std::string experiment_name;
1510 if (!(*it)->GetAsString(&experiment_name)) {
1511 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1512 continue;
1513 }
1514 result->insert(experiment_name);
1515 }
1516}
1517
[email protected]c6343372013-03-13 17:05:491518// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241519void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051520 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381521 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1522 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051523
1524 experiments_list->Clear();
1525 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1526 it != enabled_experiments.end();
1527 ++it) {
1528 experiments_list->Append(new StringValue(*it));
1529 }
1530}
1531
[email protected]8a6ff28d2010-12-02 16:35:191532// Adds the internal names for the specified experiment to |names|.
1533void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1534 if (e.type == Experiment::SINGLE_VALUE) {
1535 names->insert(e.internal_name);
1536 } else {
[email protected]83e9fa702013-02-25 19:30:441537 DCHECK(e.type == Experiment::MULTI_VALUE ||
1538 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191539 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441540 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191541 }
1542}
1543
[email protected]28e35af2011-02-09 12:56:221544// Confirms that an experiment is valid, used in a DCHECK in
1545// SanitizeList below.
1546bool ValidateExperiment(const Experiment& e) {
1547 switch (e.type) {
1548 case Experiment::SINGLE_VALUE:
1549 DCHECK_EQ(0, e.num_choices);
1550 DCHECK(!e.choices);
1551 break;
1552 case Experiment::MULTI_VALUE:
1553 DCHECK_GT(e.num_choices, 0);
1554 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531555 DCHECK(e.choices[0].command_line_switch);
1556 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221557 break;
[email protected]83e9fa702013-02-25 19:30:441558 case Experiment::ENABLE_DISABLE_VALUE:
1559 DCHECK_EQ(3, e.num_choices);
1560 DCHECK(!e.choices);
1561 DCHECK(e.command_line_switch);
1562 DCHECK(e.command_line_value);
1563 DCHECK(e.disable_command_line_switch);
1564 DCHECK(e.disable_command_line_value);
1565 break;
[email protected]28e35af2011-02-09 12:56:221566 default:
1567 NOTREACHED();
1568 }
1569 return true;
1570}
1571
[email protected]ad2a3ded2010-08-27 13:19:051572// Removes all experiments from prefs::kEnabledLabsExperiments that are
1573// unknown, to prevent this list to become very long as experiments are added
1574// and removed.
1575void SanitizeList(PrefService* prefs) {
1576 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221577 for (size_t i = 0; i < num_experiments; ++i) {
1578 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191579 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221580 }
[email protected]ad2a3ded2010-08-27 13:19:051581
1582 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241583 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051584
1585 std::set<std::string> new_enabled_experiments;
1586 std::set_intersection(
1587 known_experiments.begin(), known_experiments.end(),
1588 enabled_experiments.begin(), enabled_experiments.end(),
1589 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1590
[email protected]4c8853f2012-07-23 01:29:161591 if (new_enabled_experiments != enabled_experiments)
1592 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051593}
1594
[email protected]1a47d7e2010-10-15 00:37:241595void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051596 PrefService* prefs, std::set<std::string>* result) {
1597 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241598 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051599}
1600
[email protected]a314ee5a2010-10-26 21:23:281601// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1602// enabled on the current platform.
1603void GetSanitizedEnabledFlagsForCurrentPlatform(
1604 PrefService* prefs, std::set<std::string>* result) {
1605 GetSanitizedEnabledFlags(prefs, result);
1606
1607 // Filter out any experiments that aren't enabled on the current platform. We
1608 // don't remove these from prefs else syncing to a platform with a different
1609 // set of experiments would be lossy.
1610 std::set<std::string> platform_experiments;
1611 int current_platform = GetCurrentPlatform();
1612 for (size_t i = 0; i < num_experiments; ++i) {
1613 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191614 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581615#if defined(OS_CHROMEOS)
1616 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1617 AddInternalName(experiments[i], &platform_experiments);
1618#endif
[email protected]a314ee5a2010-10-26 21:23:281619 }
1620
1621 std::set<std::string> new_enabled_experiments;
1622 std::set_intersection(
1623 platform_experiments.begin(), platform_experiments.end(),
1624 result->begin(), result->end(),
1625 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1626
1627 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051628}
1629
[email protected]8a6ff28d2010-12-02 16:35:191630// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191631Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221632 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441633 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1634 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191635 ListValue* result = new ListValue;
1636 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191637 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441638 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191639 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441640 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221641 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191642 result->Append(value);
1643 }
1644 return result;
1645}
1646
[email protected]e2ddbc92010-10-15 20:02:071647} // namespace
1648
[email protected]83e9fa702013-02-25 19:30:441649std::string Experiment::NameForChoice(int index) const {
1650 DCHECK(type == Experiment::MULTI_VALUE ||
1651 type == Experiment::ENABLE_DISABLE_VALUE);
1652 DCHECK_LT(index, num_choices);
1653 return std::string(internal_name) + testing::kMultiSeparator +
1654 base::IntToString(index);
1655}
1656
1657string16 Experiment::DescriptionForChoice(int index) const {
1658 DCHECK(type == Experiment::MULTI_VALUE ||
1659 type == Experiment::ENABLE_DISABLE_VALUE);
1660 DCHECK_LT(index, num_choices);
1661 int description_id;
1662 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1663 const int kEnableDisableDescriptionIds[] = {
1664 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1665 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1666 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1667 };
1668 description_id = kEnableDisableDescriptionIds[index];
1669 } else {
1670 description_id = choices[index].description_id;
1671 }
1672 return l10n_util::GetStringUTF16(description_id);
1673}
1674
[email protected]1a47d7e2010-10-15 00:37:241675void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551676 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051677}
1678
[email protected]ee28495a2013-05-20 04:10:521679void GetFlagsExperimentsData(PrefService* prefs,
1680 FlagAccess access,
1681 base::ListValue* supported_experiments,
1682 base::ListValue* unsupported_experiments) {
[email protected]ad2a3ded2010-08-27 13:19:051683 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241684 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051685
1686 int current_platform = GetCurrentPlatform();
1687
[email protected]a314ee5a2010-10-26 21:23:281688 for (size_t i = 0; i < num_experiments; ++i) {
1689 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051690
1691 DictionaryValue* data = new DictionaryValue();
1692 data->SetString("internal_name", experiment.internal_name);
1693 data->SetString("name",
1694 l10n_util::GetStringUTF16(experiment.visible_name_id));
1695 data->SetString("description",
1696 l10n_util::GetStringUTF16(
1697 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401698
1699 ListValue* supported_platforms = new ListValue();
1700 AddOsStrings(experiment.supported_platforms, supported_platforms);
1701 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051702
[email protected]28e35af2011-02-09 12:56:221703 switch (experiment.type) {
1704 case Experiment::SINGLE_VALUE:
1705 data->SetBoolean(
1706 "enabled",
1707 enabled_experiments.count(experiment.internal_name) > 0);
1708 break;
1709 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441710 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221711 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1712 break;
1713 default:
1714 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191715 }
1716
[email protected]ee28495a2013-05-20 04:10:521717 bool supported = (experiment.supported_platforms & current_platform) != 0;
1718#if defined(OS_CHROMEOS)
1719 if (access == kOwnerAccessToFlags &&
1720 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
1721 supported = true;
1722 }
1723#endif
1724 if (supported)
1725 supported_experiments->Append(data);
1726 else
1727 unsupported_experiments->Append(data);
[email protected]ad2a3ded2010-08-27 13:19:051728 }
[email protected]ad2a3ded2010-08-27 13:19:051729}
1730
[email protected]ad2a3ded2010-08-27 13:19:051731bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551732 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051733}
1734
1735void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351736 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551737 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071738}
1739
1740void RemoveFlagsSwitches(
1741 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551742 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071743}
1744
[email protected]cb93bf52013-02-20 01:20:001745void ResetAllFlags(PrefService* prefs) {
1746 FlagsState::GetInstance()->ResetAllFlags(prefs);
1747}
1748
[email protected]a314ee5a2010-10-26 21:23:281749int GetCurrentPlatform() {
1750#if defined(OS_MACOSX)
1751 return kOsMac;
1752#elif defined(OS_WIN)
1753 return kOsWin;
1754#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1755 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211756#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281757 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401758#elif defined(OS_ANDROID)
1759 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281760#else
1761#error Unknown platform
1762#endif
1763}
1764
[email protected]4bc5050c2010-11-18 17:55:541765void RecordUMAStatistics(const PrefService* prefs) {
1766 std::set<std::string> flags;
1767 GetEnabledFlags(prefs, &flags);
1768 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1769 ++it) {
1770 std::string action("AboutFlags_");
1771 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381772 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541773 }
1774 // Since flag metrics are recorded every startup, add a tick so that the
1775 // stats can be made meaningful.
1776 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381777 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1778 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541779}
1780
[email protected]e2ddbc92010-10-15 20:02:071781//////////////////////////////////////////////////////////////////////////////
1782// FlagsState implementation.
1783
1784namespace {
1785
[email protected]83e9fa702013-02-25 19:30:441786typedef std::map<std::string, std::pair<std::string, std::string> >
1787 NameToSwitchAndValueMap;
1788
1789void SetFlagToSwitchMapping(const std::string& key,
1790 const std::string& switch_name,
1791 const std::string& switch_value,
1792 NameToSwitchAndValueMap* name_to_switch_map) {
1793 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1794 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1795}
1796
[email protected]e2ddbc92010-10-15 20:02:071797void FlagsState::ConvertFlagsToSwitches(
1798 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071799 if (command_line->HasSwitch(switches::kNoExperiments))
1800 return;
1801
1802 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001803
[email protected]a314ee5a2010-10-26 21:23:281804 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071805
[email protected]a82744532011-02-11 16:15:531806 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191807 for (size_t i = 0; i < num_experiments; ++i) {
1808 const Experiment& e = experiments[i];
1809 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441810 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1811 e.command_line_value, &name_to_switch_map);
1812 } else if (e.type == Experiment::MULTI_VALUE) {
1813 for (int j = 0; j < e.num_choices; ++j) {
1814 SetFlagToSwitchMapping(e.NameForChoice(j),
1815 e.choices[j].command_line_switch,
1816 e.choices[j].command_line_value,
1817 &name_to_switch_map);
1818 }
[email protected]8a6ff28d2010-12-02 16:35:191819 } else {
[email protected]83e9fa702013-02-25 19:30:441820 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1821 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1822 &name_to_switch_map);
1823 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1824 e.command_line_value, &name_to_switch_map);
1825 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1826 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191827 }
1828 }
[email protected]e2ddbc92010-10-15 20:02:071829
1830 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531831 flags_switches_.insert(
1832 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1833 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071834 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1835 it != enabled_experiments.end();
1836 ++it) {
1837 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531838 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191839 name_to_switch_map.find(experiment_name);
1840 if (name_to_switch_it == name_to_switch_map.end()) {
1841 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071842 continue;
[email protected]8a6ff28d2010-12-02 16:35:191843 }
[email protected]e2ddbc92010-10-15 20:02:071844
[email protected]a82744532011-02-11 16:15:531845 const std::pair<std::string, std::string>&
1846 switch_and_value_pair = name_to_switch_it->second;
1847
1848 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1849 switch_and_value_pair.second);
1850 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071851 }
1852 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531853 flags_switches_.insert(
1854 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1855 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071856}
1857
1858bool FlagsState::IsRestartNeededToCommitChanges() {
1859 return needs_restart_;
1860}
1861
1862void FlagsState::SetExperimentEnabled(
1863 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441864 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191865 if (at_index != std::string::npos) {
1866 DCHECK(enable);
1867 // We're being asked to enable a multi-choice experiment. Disable the
1868 // currently selected choice.
1869 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221870 const std::string experiment_name = internal_name.substr(0, at_index);
1871 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191872
[email protected]28e35af2011-02-09 12:56:221873 // And enable the new choice, if it is not the default first choice.
1874 if (internal_name != experiment_name + "@0") {
1875 std::set<std::string> enabled_experiments;
1876 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081877 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221878 SetEnabledFlags(prefs, enabled_experiments);
1879 }
[email protected]8a6ff28d2010-12-02 16:35:191880 return;
1881 }
1882
[email protected]ad2a3ded2010-08-27 13:19:051883 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241884 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051885
[email protected]8a6ff28d2010-12-02 16:35:191886 const Experiment* e = NULL;
1887 for (size_t i = 0; i < num_experiments; ++i) {
1888 if (experiments[i].internal_name == internal_name) {
1889 e = experiments + i;
1890 break;
1891 }
1892 }
1893 DCHECK(e);
1894
1895 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591896 if (enable)
[email protected]147492b2013-03-19 23:52:081897 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591898 else
[email protected]147492b2013-03-19 23:52:081899 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191900 } else {
1901 if (enable) {
1902 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081903 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191904 } else {
1905 // Find the currently enabled choice and disable it.
1906 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441907 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191908 if (enabled_experiments.find(choice_name) !=
1909 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081910 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191911 enabled_experiments.erase(choice_name);
1912 // Continue on just in case there's a bug and more than one
1913 // experiment for this choice was enabled.
1914 }
1915 }
1916 }
1917 }
[email protected]ad2a3ded2010-08-27 13:19:051918
[email protected]1a47d7e2010-10-15 00:37:241919 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051920}
1921
[email protected]e2ddbc92010-10-15 20:02:071922void FlagsState::RemoveFlagsSwitches(
1923 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531924 for (std::map<std::string, std::string>::const_iterator
1925 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1926 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071927 }
1928}
1929
[email protected]cb93bf52013-02-20 01:20:001930void FlagsState::ResetAllFlags(PrefService* prefs) {
1931 needs_restart_ = true;
1932
1933 std::set<std::string> no_experiments;
1934 SetEnabledFlags(prefs, no_experiments);
1935}
1936
[email protected]e2ddbc92010-10-15 20:02:071937void FlagsState::reset() {
1938 needs_restart_ = false;
1939 flags_switches_.clear();
1940}
1941
[email protected]38e46812011-05-09 20:49:221942} // namespace
[email protected]e2ddbc92010-10-15 20:02:071943
1944namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191945
1946// WARNING: '@' is also used in the html file. If you update this constant you
1947// also need to update the html file.
1948const char kMultiSeparator[] = "@";
1949
[email protected]e2ddbc92010-10-15 20:02:071950void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551951 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071952}
[email protected]a314ee5a2010-10-26 21:23:281953
1954void SetExperiments(const Experiment* e, size_t count) {
1955 if (!e) {
1956 experiments = kExperiments;
1957 num_experiments = arraysize(kExperiments);
1958 } else {
1959 experiments = e;
1960 num_experiments = count;
1961 }
1962}
1963
[email protected]8a6ff28d2010-12-02 16:35:191964const Experiment* GetExperiments(size_t* count) {
1965 *count = num_experiments;
1966 return experiments;
1967}
1968
[email protected]e2ddbc92010-10-15 20:02:071969} // namespace testing
1970
[email protected]1a47d7e2010-10-15 00:37:241971} // namespace about_flags