blob: b092fee3d39b22d31d6a043faa13baeda6889aed [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]8b1c3c72013-01-25 01:48:43121const Experiment::Choice kGDIPresentChoices[] = {
122 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
123 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
124 switches::kDoFirstShowPresentWithGDI, ""},
125 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
126 switches::kDoAllShowPresentWithGDI, ""}
127};
128
[email protected]d7932532012-11-21 21:10:31129const Experiment::Choice kTouchEventsChoices[] = {
130 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
131 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
132 switches::kTouchEvents,
133 switches::kTouchEventsEnabled },
134 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
135 switches::kTouchEvents,
136 switches::kTouchEventsDisabled }
137};
138
[email protected]347a0c72012-05-14 20:28:06139const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31140 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20141 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06142 switches::kTouchOptimizedUI,
143 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20144 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06145 switches::kTouchOptimizedUI,
146 switches::kTouchOptimizedUIDisabled }
147};
148
[email protected]66f409c2012-10-04 20:59:04149const Experiment::Choice kNaClDebugMaskChoices[] = {
150 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
151 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
152 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
153 // an option to switch off its debugging.
154 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
155 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
156 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
157 switches::kNaClDebugMask, "*://*/*debug.nmf" }
158};
159
[email protected]ea2f3342012-09-21 21:13:36160#if defined(OS_CHROMEOS)
161const Experiment::Choice kAshBootAnimationFunction[] = {
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
163 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
164 ash::switches::kAshBootAnimationFunction2, ""},
165 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
166 ash::switches::kAshBootAnimationFunction3, ""}
167};
[email protected]d96aef22012-10-30 11:47:02168
169const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]2f2d6c32013-05-10 02:56:24170 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]d96aef22012-10-30 11:47:02171 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24172 chromeos::switches::kEnableChromeCaptivePortalDetector, "" },
[email protected]ad2fe9f2012-11-15 11:03:19173 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24174 chromeos::switches::kDisableChromeCaptivePortalDetector, "" }
[email protected]d96aef22012-10-30 11:47:02175};
[email protected]a78c7432013-03-13 06:22:43176
[email protected]ea2f3342012-09-21 21:13:36177#endif
178
[email protected]9323fdd12013-02-23 00:31:36179const Experiment::Choice kImplSidePaintingChoices[] = {
180 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
181 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
182 cc::switches::kEnableImplSidePainting, ""},
183 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
184 cc::switches::kDisableImplSidePainting, ""}
185};
186
[email protected]a42c85f2013-04-04 18:15:12187const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
188 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
189 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
190 cc::switches::kMaxTilesForInterestArea, "64"},
191 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
192 cc::switches::kMaxTilesForInterestArea, "128"},
193 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
194 cc::switches::kMaxTilesForInterestArea, "256"},
195 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
196 cc::switches::kMaxTilesForInterestArea, "512"}
197};
198
[email protected]a3618122013-04-26 21:15:34199const Experiment::Choice kDefaultTileWidthChoices[] = {
200 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
201 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
202 switches::kDefaultTileWidth, "128"},
203 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
204 switches::kDefaultTileWidth, "256"},
205 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
206 switches::kDefaultTileWidth, "512"},
207 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
208 switches::kDefaultTileWidth, "1024"}
209};
210
211const Experiment::Choice kDefaultTileHeightChoices[] = {
212 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
213 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
214 switches::kDefaultTileHeight, "128"},
215 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
216 switches::kDefaultTileHeight, "256"},
217 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
218 switches::kDefaultTileHeight, "512"},
219 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
220 switches::kDefaultTileHeight, "1024"}
221};
222
[email protected]38484df12013-04-10 16:42:03223const Experiment::Choice kSimpleCacheBackendChoices[] = {
[email protected]9a3de3e32013-04-23 19:05:21224 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
225 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
226 switches::kUseSimpleCacheBackend, "off" },
[email protected]38484df12013-04-10 16:42:03227 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
228 switches::kUseSimpleCacheBackend, "on"}
229};
230
[email protected]4bc5050c2010-11-18 17:55:54231// RECORDING USER METRICS FOR FLAGS:
232// -----------------------------------------------------------------------------
233// The first line of the experiment is the internal name. If you'd like to
234// gather statistics about the usage of your flag, you should append a marker
235// comment to the end of the feature name, like so:
236// "my-special-feature", // FLAGS:RECORD_UMA
237//
238// After doing that, run //chrome/tools/extract_actions.py (see instructions at
239// the top of that file for details) to update the chromeactions.txt file, which
240// will enable UMA to record your feature flag.
241//
[email protected]783d5bb2012-10-24 03:47:14242// After your feature has shipped under a flag, you can locate the metrics under
243// the action name AboutFlags_internal-action-name. Actions are recorded once
244// per startup, so you should divide this number by AboutFlags_StartupTick to
245// get a sense of usage. Note that this will not be the same as number of users
246// with a given feature enabled because users can quit and relaunch the
247// application multiple times over a given time interval. The dashboard also
248// shows you how many (metrics reporting) users have enabled the flag over the
249// last seven days. However, note that this is not the same as the number of
250// users who have the flag enabled, since enabling the flag happens once,
251// whereas running with the flag enabled happens until the user flips the flag
252// again.
[email protected]4bc5050c2010-11-18 17:55:54253
[email protected]8a6ff28d2010-12-02 16:35:19254// To add a new experiment add to the end of kExperiments. There are two
255// distinct types of experiments:
256// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
257// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22258// . MULTI_VALUE: a list of choices, the first of which should correspond to a
259// deactivated state for this lab (i.e. no command line option). To specify
260// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
261// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19262// See the documentation of Experiment for details on the fields.
263//
264// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05265const Experiment kExperiments[] = {
266 {
[email protected]aac169d2011-03-18 19:53:03267 "expose-for-tabs", // FLAGS:RECORD_UMA
268 IDS_FLAGS_TABPOSE_NAME,
269 IDS_FLAGS_TABPOSE_DESCRIPTION,
270 kOsMac,
271#if defined(OS_MACOSX)
272 // The switch exists only on OS X.
273 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
274#else
275 SINGLE_VALUE_TYPE("")
276#endif
277 },
278 {
[email protected]4bc5050c2010-11-18 17:55:54279 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05280 IDS_FLAGS_CONFLICTS_CHECK_NAME,
281 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
282 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19283 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05284 },
285 {
[email protected]4bc5050c2010-11-18 17:55:54286 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54287 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45289 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22290 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31291 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22292 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
293 // always have PDF rasterization available, so no flag needed there.
294#if !defined(GOOGLE_CHROME_BUILD)
295 kOsWin,
296#else
297 0,
[email protected]fa6d2a2f2010-11-30 21:47:19298#endif
[email protected]8a6ff28d2010-12-02 16:35:19299 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42300 },
[email protected]60d77bd2012-08-22 00:10:07301#if defined(OS_WIN)
302 {
303 "print-raster",
304 IDS_FLAGS_PRINT_RASTER_NAME,
305 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
306 kOsWin,
307 SINGLE_VALUE_TYPE(switches::kPrintRaster)
308 },
309#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05310 {
[email protected]96c6f4c2011-05-18 19:36:22311 "ignore-gpu-blacklist",
312 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
314 kOsAll,
315 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
316 },
317 {
[email protected]0110cf112011-07-02 00:39:43318 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22319 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
320 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23321 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44322 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
323 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22324 },
325 {
[email protected]72787e392012-03-23 05:55:43326 "threaded-compositing-mode",
327 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58329 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44330 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
331 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59332 },
333 {
[email protected]17e27692013-02-06 17:02:09334 "force-accelerated-composited-scrolling",
335 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
336 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
337 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44338 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
339 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09340 },
341 {
[email protected]8b1c3c72013-01-25 01:48:43342 "present-with-GDI",
343 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
344 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
345 kOsWin,
346 MULTI_VALUE_TYPE(kGDIPresentChoices)
347 },
348 {
[email protected]2b608752013-05-01 03:34:36349 "enable-experimental-canvas-features",
350 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
351 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
352 kOsAll,
353 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
354 },
355 {
[email protected]81c64af62012-06-06 20:15:52356 "disable-accelerated-2d-canvas",
357 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
358 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
359 kOsAll,
360 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
361 },
362 {
[email protected]efcde132012-05-30 01:05:18363 "disable-threaded-animation",
364 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
365 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59366 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37367 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59368 },
369 {
[email protected]5963b772011-02-09 22:55:38370 "composited-layer-borders",
371 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
372 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
373 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57374 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38375 },
376 {
[email protected]a8f1eaa2011-03-07 19:00:58377 "show-fps-counter",
378 IDS_FLAGS_SHOW_FPS_COUNTER,
379 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
380 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57381 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58382 },
[email protected]8ff7f342011-05-25 01:49:47383 {
[email protected]70c98a332011-12-21 20:51:52384 "accelerated-filters",
385 IDS_FLAGS_ACCELERATED_FILTERS,
386 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
387 kOsAll,
388 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
389 },
390 {
[email protected]8ff7f342011-05-25 01:49:47391 "disable-gpu-vsync",
392 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
393 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56394 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47395 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
396 },
[email protected]deaba6d52011-09-23 14:47:12397 {
[email protected]4052d832013-01-16 05:31:01398 "enable-webgl",
399 IDS_FLAGS_ENABLE_WEBGL_NAME,
400 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
401 kOsAndroid,
402#if defined(OS_ANDROID)
403 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
404#else
405 SINGLE_VALUE_TYPE("")
406#endif
407 },
408 {
[email protected]deaba6d52011-09-23 14:47:12409 "disable-webgl",
410 IDS_FLAGS_DISABLE_WEBGL_NAME,
411 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56412 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01413#if defined(OS_ANDROID)
414 SINGLE_VALUE_TYPE("")
415#else
[email protected]deaba6d52011-09-23 14:47:12416 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01417#endif
[email protected]deaba6d52011-09-23 14:47:12418 },
[email protected]09096e02012-05-24 11:12:04419 {
[email protected]ce585bf2013-03-14 16:25:16420 "disable-webrtc",
421 IDS_FLAGS_DISABLE_WEBRTC_NAME,
422 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05423 kOsAndroid,
424#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16425 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05426#else
427 SINGLE_VALUE_TYPE("")
428#endif
429 },
[email protected]34cb5292013-04-15 06:06:31430#if defined(OS_ANDROID)
431 {
432 "enable-webaudio",
433 IDS_FLAGS_ENABLE_WEBAUDIO_NAME,
434 IDS_FLAGS_ENABLE_WEBAUDIO_DESCRIPTION,
435 kOsAndroid,
436 SINGLE_VALUE_TYPE(switches::kEnableWebAudio)
437 },
438#endif
[email protected]d9da9582013-01-31 04:59:05439 {
[email protected]96bcdc102012-05-24 23:42:10440 "fixed-position-creates-stacking-context",
441 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
442 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
443 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44444 ENABLE_DISABLE_VALUE_TYPE(
445 switches::kEnableFixedPositionCreatesStackingContext,
446 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10447 },
[email protected]fb854192013-02-06 01:30:04448 {
449 "enable-compositing-for-fixed-position",
450 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
451 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
452 kOsAll,
453 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
454 },
[email protected]a7640ef22012-10-06 00:52:08455 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53456 {
[email protected]e3791ce92011-08-09 01:03:32457 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40458 IDS_FLAGS_ENABLE_NACL_NAME,
459 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56460 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19461 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40462 },
463 {
[email protected]9addd1c2012-09-15 14:28:24464 "enable-nacl-debug", // FLAGS:RECORD_UMA
465 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
466 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56467 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24468 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13469 },
470 {
[email protected]66f409c2012-10-04 20:59:04471 "nacl-debug-mask", // FLAGS:RECORD_UMA
472 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
473 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56474 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04475 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
476 },
477 {
[email protected]7babd1c2012-08-08 20:35:29478 "enable-pnacl", // FLAGS:RECORD_UMA
479 IDS_FLAGS_ENABLE_PNACL_NAME,
480 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56481 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29482 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
483 },
484 {
[email protected]4bc5050c2010-11-18 17:55:54485 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32486 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
487 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56488 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19489 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32490 },
[email protected]3627b06d2010-11-12 16:36:16491 {
[email protected]ac2e2acd2013-03-21 12:57:29492 "extensions-on-chrome-urls",
493 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
494 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
495 kOsAll,
496 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
497 },
498 {
[email protected]e9cddd52013-03-23 17:37:53499 "enable-adview",
500 IDS_FLAGS_ENABLE_ADVIEW_NAME,
501 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
502 kOsDesktop,
503 SINGLE_VALUE_TYPE(switches::kEnableAdview)
504 },
505 {
506 "enable-adview-src-attribute",
507 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
508 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
509 kOsDesktop,
510 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
511 },
512 {
[email protected]544471a2012-10-13 05:27:09513 "action-box",
[email protected]cab18ef2012-04-27 07:22:03514 IDS_FLAGS_ACTION_BOX_NAME,
515 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56516 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44517 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
518 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03519 },
520 {
[email protected]3a362432012-06-18 20:39:51521 "script-badges",
522 IDS_FLAGS_SCRIPT_BADGES_NAME,
523 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56524 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09525 SINGLE_VALUE_TYPE(switches::kScriptBadges)
526 },
527 {
528 "script-bubble",
529 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
530 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56531 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44532 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
533 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51534 },
535 {
[email protected]cbe224d2011-08-04 22:12:49536 "apps-new-install-bubble",
537 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
538 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56539 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49540 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
541 },
542 {
[email protected]80bd24e2010-11-30 09:34:38543 "disable-hyperlink-auditing",
544 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
545 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
546 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19547 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51548 },
549 {
550 "experimental-location-features", // FLAGS:RECORD_UMA
551 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
552 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
553 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19554 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
555 },
556 {
[email protected]5aea1862011-03-23 23:55:39557 "tab-groups-context-menu",
558 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
559 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
560 kOsWin,
561 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
562 },
[email protected]c94cebd2012-06-21 00:55:28563 {
564 "enable-instant-extended-api",
565 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
566 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56567 kOsDesktop,
[email protected]73444382013-02-26 19:31:51568 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
569 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28570 },
[email protected]e9bf9d92011-03-31 20:57:15571 {
[email protected]8cc9e532013-05-06 21:01:47572 "enable-local-first-load-ntp",
573 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP,
574 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP_DESCRIPTION,
575 kOsDesktop,
576 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalFirstLoadNTP,
577 switches::kDisableLocalFirstLoadNTP)
578 },
579 {
[email protected]07fd48a2013-04-13 02:53:27580 "enable-local-only-instant-extended-api",
581 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
582 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
583 kOsDesktop,
584 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
585 switches::kDisableLocalOnlyInstantExtendedAPI)
586 },
587 {
[email protected]354e33b2011-06-15 00:29:10588 "static-ip-config",
589 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
590 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
591 kOsCrOS,
592#if defined(OS_CHROMEOS)
593 // This switch exists only on Chrome OS.
[email protected]2f2d6c32013-05-10 02:56:24594 SINGLE_VALUE_TYPE(chromeos::switches::kEnableStaticIPConfig)
[email protected]354e33b2011-06-15 00:29:10595#else
596 SINGLE_VALUE_TYPE("")
597#endif
598 },
[email protected]3eb5728c2011-06-20 22:32:24599 {
600 "show-autofill-type-predictions",
601 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
602 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
603 kOsAll,
[email protected]e217c5632013-04-12 19:11:48604 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24605 },
[email protected]bff4d3e2011-06-21 23:58:52606 {
[email protected]a5e9faa2013-03-19 09:58:38607 "enable-sync-favicons",
608 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
609 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55610 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38611 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55612 },
613 {
[email protected]5d90a0a2012-11-15 02:43:40614 "sync-keystore-encryption",
615 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
616 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
617 kOsAll,
618 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
619 },
620 {
[email protected]e755a382012-09-13 17:16:35621 "enable-gesture-tap-highlight",
622 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
623 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
624 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47625 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
626 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35627 },
628 {
[email protected]a22ebd812011-06-23 00:05:39629 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
630 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
631 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
632 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40633 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25634 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39635 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
636 },
[email protected]81a6b0b2011-06-24 17:55:40637 {
[email protected]128dc6c2012-06-22 20:30:35638 "omnibox-history-quick-provider-reorder-for-inlining",
639 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
640 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
641 kOsAll,
642 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
643 },
644 {
[email protected]032d5e6c2012-02-17 17:53:55645 "omnibox-inline-history-quick-provider",
646 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
647 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
648 kOsAll,
649 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
650 },
651 {
[email protected]7e7a28092011-12-09 22:24:55652 "enable-panels",
653 IDS_FLAGS_ENABLE_PANELS_NAME,
654 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56655 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55656 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54657 },
[email protected]e3749d12011-07-25 22:22:12658 {
[email protected]27c14f02012-06-22 17:29:58659 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27660 "save-page-as-mhtml", // FLAGS:RECORD_UMA
661 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
662 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
663 kOsMac | kOsWin | kOsLinux,
664 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
665 },
666 {
[email protected]b7bb44f2011-09-01 05:17:03667 "enable-autologin",
668 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
669 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
670 kOsMac | kOsWin | kOsLinux,
671 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
672 },
[email protected]b9841172011-09-26 23:36:09673 {
[email protected]27b3fe92012-03-21 05:35:06674 "enable-async-dns",
675 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
676 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46677 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44678 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
679 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06680 },
681 {
[email protected]1eb93802012-09-11 18:57:56682 "disable-media-source",
[email protected]5bf1223a52013-05-14 21:42:31683 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_NAME,
684 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32685 kOsAll,
[email protected]5bf1223a52013-05-14 21:42:31686 SINGLE_VALUE_TYPE(switches::kDisableWebKitMediaSource)
[email protected]6aa03b32011-10-27 21:44:44687 },
[email protected]e4e68dbb2011-11-18 01:50:22688 {
[email protected]36d98412013-01-31 20:28:53689 "disable-encrypted-media",
690 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
691 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56692 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53693 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03694 },
[email protected]f88628792012-12-18 07:07:50695 {
696 "enable-opus-playback",
697 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
698 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56699 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50700 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
701 },
[email protected]ca6eaa5a2013-01-24 16:16:04702 {
[email protected]c54e1aa2013-01-25 09:26:17703 "enable-vp9-playback",
704 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
705 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
706 kOsDesktop,
707 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
708 },
709 {
[email protected]6ac955b2013-04-19 23:43:32710 "enable-vp8-alpha-playback",
711 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME,
712 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION,
713 kOsDesktop,
714 SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback)
715 },
716 {
[email protected]ca6eaa5a2013-01-24 16:16:04717 "enable-managed-users",
718 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
719 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58720 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04721 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
722 },
[email protected]dc04be7c2012-03-15 23:57:49723#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50724 {
[email protected]2a13a9a2013-04-19 04:00:21725 "ash-disable-auto-maximizing",
726 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
727 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
728 kOsWin | kOsLinux | kOsCrOS,
729 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
730 },
731 {
[email protected]cda278d2012-10-30 20:31:40732 "ash-disable-auto-window-placement",
733 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
734 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
735 kOsWin | kOsLinux | kOsCrOS,
736 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
737 },
[email protected]b4e4ec42012-11-29 21:42:40738 {
[email protected]16f55a22013-02-13 23:47:34739 "ash-disable-per-app-launcher",
740 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
741 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40742 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34743 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40744 },
[email protected]dc04be7c2012-03-15 23:57:49745#endif
[email protected]eaae8b462012-01-20 22:20:39746 {
[email protected]db543d322011-12-15 20:40:15747 "per-tile-painting",
748 IDS_FLAGS_PER_TILE_PAINTING_NAME,
749 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37750 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37751 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15752 },
[email protected]bf88c032011-12-22 19:05:47753 {
754 "enable-javascript-harmony",
755 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
756 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
757 kOsAll,
758 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
759 },
[email protected]7e7f378a2012-01-05 14:35:37760 {
[email protected]85646172012-01-09 22:45:54761 "enable-tab-browser-dragging",
762 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
763 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
764 kOsWin,
765 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
766 },
767 {
[email protected]068b7b52012-02-27 12:41:44768 "disable-restore-session-state",
769 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
770 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37771 kOsAll,
[email protected]068b7b52012-02-27 12:41:44772 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37773 },
[email protected]88864db2012-01-18 20:56:35774 {
775 "disable-software-rasterizer",
776 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
777 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
778#if defined(ENABLE_SWIFTSHADER)
779 kOsAll,
780#else
781 0,
782#endif
783 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
784 },
[email protected]15a5d722012-01-23 09:11:14785 {
[email protected]ff7b6dd2012-09-15 20:20:03786 "enable-experimental-webkit-features",
787 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
788 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16789 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03790 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49791 },
792 {
[email protected]0f95a252012-09-13 22:30:04793 "enable-css-shaders",
794 IDS_FLAGS_CSS_SHADERS_NAME,
795 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
796 kOsAll,
797 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
798 },
799 {
[email protected]9860c68b2012-02-02 01:58:09800 "enable-extension-activity-ui",
801 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
802 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56803 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09804 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00805 },
[email protected]54ae4e92012-02-16 15:19:05806 {
[email protected]3e8befc2012-03-13 01:17:03807 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16808 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
809 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56810 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03811 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16812 },
[email protected]dc04be7c2012-03-15 23:57:49813#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01814 {
[email protected]3cd198a22012-03-12 20:38:01815 "enable-ash-oak",
816 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
817 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
818 kOsAll,
819 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
820 },
[email protected]31cf1c52012-02-29 20:55:01821#endif
[email protected]184ec592012-03-01 11:54:28822 {
823 "enable-devtools-experiments",
824 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
825 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56826 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28827 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
828 },
[email protected]76d1854e2012-03-02 23:57:44829 {
[email protected]2fefdb32013-02-26 14:28:10830 "silent-debugger-extension-api",
831 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
832 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
833 kOsDesktop,
834 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
835 },
836 {
[email protected]76d1854e2012-03-02 23:57:44837 "enable-suggestions-ntp",
838 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
839 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56840 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44841 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
842 },
[email protected]a3d54252012-04-05 20:04:13843 {
[email protected]1dbaf5e2012-11-30 05:51:32844 "spellcheck-autocorrect",
845 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
846 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
847 kOsWin | kOsLinux | kOsCrOS,
848 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
849 },
850 {
[email protected]d7932532012-11-21 21:10:31851 "touch-events",
852 IDS_TOUCH_EVENTS_NAME,
853 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56854 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31855 MULTI_VALUE_TYPE(kTouchEventsChoices)
856 },
857 {
[email protected]c9c73ad42012-04-18 03:35:59858 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06859 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
860 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55861 kOsWin,
[email protected]347a0c72012-05-14 20:28:06862 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59863 },
[email protected]8a6aaa72012-04-20 20:53:58864 {
[email protected]b9c96ff2012-11-26 22:24:40865 "disable-touch-adjustment",
866 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
867 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
868 kOsWin | kOsLinux | kOsCrOS,
869 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
870 },
871 {
[email protected]0b9383a2012-10-26 00:58:16872 "enable-tab-capture",
873 IDS_ENABLE_TAB_CAPTURE_NAME,
874 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25875 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44876 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
877 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16878 },
[email protected]0b60afa2012-04-19 17:36:39879#if defined(OS_CHROMEOS)
880 {
[email protected]7c4a9bc2012-09-11 22:10:05881 "enable-background-loader",
882 IDS_ENABLE_BACKLOADER_NAME,
883 IDS_ENABLE_BACKLOADER_DESCRIPTION,
884 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24885 SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader)
[email protected]7c4a9bc2012-09-11 22:10:05886 },
887 {
[email protected]c5667b282012-08-31 00:32:50888 "enable-bezel-touch",
889 IDS_ENABLE_BEZEL_TOUCH_NAME,
890 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47891 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50892 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47893 },
894 {
[email protected]3f4181a2013-02-01 21:31:07895 "enable-screensaver-extension",
896 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
897 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
898 kOsCrOS,
899 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
900 },
901 {
[email protected]0b60afa2012-04-19 17:36:39902 "no-discard-tabs",
903 IDS_FLAGS_NO_DISCARD_TABS_NAME,
904 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
905 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24906 SINGLE_VALUE_TYPE(chromeos::switches::kNoDiscardTabs)
[email protected]0b60afa2012-04-19 17:36:39907 },
908#endif
[email protected]79be6d32012-04-24 20:47:44909 {
[email protected]8d68a3e02013-01-12 15:57:10910 "enable-download-resumption",
911 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
912 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56913 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10914 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
915 },
916 {
[email protected]9a5940d2012-04-27 19:16:23917 "allow-nacl-socket-api",
918 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
919 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56920 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23921 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
922 },
[email protected]85333732012-05-01 19:02:24923 {
[email protected]60673ad72012-05-02 06:16:33924 "stacked-tab-strip",
925 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
926 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
927 kOsWin,
928 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
929 },
930 {
[email protected]4bd20202012-06-14 17:35:01931 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24932 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
933 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
934 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01935 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24936 },
[email protected]190349fd2012-05-02 00:10:47937#if defined(OS_CHROMEOS)
938 {
939 "allow-touchpad-three-finger-click",
940 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
941 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
942 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24943 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
[email protected]190349fd2012-05-02 00:10:47944 },
[email protected]fbc176b62012-10-27 02:19:58945 {
946 "allow-touchpad-three-finger-swipe",
947 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
948 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
949 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24950 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerSwipe)
[email protected]fbc176b62012-10-27 02:19:58951 },
[email protected]190349fd2012-05-02 00:10:47952#endif
[email protected]1992a2f42012-10-23 18:32:21953 {
[email protected]a585e462013-01-26 00:37:15954 "use-client-login-signin-flow",
955 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
956 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21957 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15958 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21959 },
[email protected]8ee02242012-12-04 15:23:32960 {
961 "enable-desktop-guest-mode",
962 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
963 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
964 kOsMac | kOsWin | kOsLinux,
965 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
966 },
[email protected]53520b1b2012-05-07 21:43:37967#if defined(USE_ASH)
968 {
[email protected]8257d382013-03-26 13:08:42969 "show-launcher-alignment-menu",
970 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
971 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42972 kOsAll,
[email protected]8257d382013-03-26 13:08:42973 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42974 },
975 {
[email protected]2ddf37b2013-04-20 01:15:58976 "disable-minimize-on-second-launcher-item-click",
977 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
978 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
979 kOsAll,
980 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
981 },
982 {
[email protected]73074742012-05-17 01:44:41983 "show-touch-hud",
984 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
985 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
986 kOsAll,
987 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
988 },
989 {
[email protected]9f0940b62012-05-23 22:56:35990 "enable-pinch",
991 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
992 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06993 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38994 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
995 },
996 {
[email protected]a4016f12013-05-02 07:53:47997 "forced-maximize-mode",
998 IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME,
999 IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION,
1000 kOsLinux | kOsWin | kOsCrOS,
1001 SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode),
1002 },
[email protected]73074742012-05-17 01:44:411003#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281004#if defined(OS_CHROMEOS)
1005 {
[email protected]8b04a1652012-08-04 02:59:491006 "disable-boot-animation",
1007 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1008 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581009 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241010 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:491011 },
[email protected]95058572012-08-20 14:57:291012 {
[email protected]b4557192012-09-19 11:29:581013 "disable-boot-animation2",
1014 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1015 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581016 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581017 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1018 },
1019 {
[email protected]ea2f3342012-09-21 21:13:361020 "boot-animation-fucntion",
1021 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1022 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581023 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361024 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1025 },
[email protected]839667d62012-10-23 19:38:571026 {
[email protected]d96aef22012-10-30 11:47:021027 "captive-portal-detector",
1028 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1029 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581030 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021031 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1032 },
1033 {
[email protected]c11aa8f12012-12-18 18:43:141034 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571035 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1036 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1037 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141038 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571039 },
[email protected]f0280952012-11-06 20:30:501040 {
[email protected]ea2fab32013-04-16 06:55:021041 "file-manager-legacy",
1042 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1043 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231044 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241045 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231046 },
[email protected]3e035e82012-11-27 20:54:321047 {
[email protected]828d99052013-04-22 08:15:031048 "file-manager-legacy-ui",
1049 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_NAME,
1050 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_DESCRIPTION,
[email protected]bc545292013-04-18 14:33:101051 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241052 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacyUI),
[email protected]bc545292013-04-18 14:33:101053 },
1054 {
[email protected]c64d7732013-03-25 18:09:501055 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521056 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1057 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581058 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241059 SINGLE_VALUE_TYPE(chromeos::switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471060 },
[email protected]6ad015c2013-03-06 00:49:511061 {
[email protected]c64d7732013-03-25 18:09:501062 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521063 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1064 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511065 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521066 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511067 },
[email protected]099b890c2013-04-25 19:16:261068 {
1069 "disable-quickoffice-component-app",
1070 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
1071 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
1072 kOsCrOS,
1073 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp),
1074 },
[email protected]62018dc2012-12-13 00:37:351075#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391076 {
[email protected]6247aba2013-03-04 22:57:181077 "views-textfield",
1078 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1079 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391080 kOsWin,
[email protected]6247aba2013-03-04 22:57:181081 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1082 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391083 },
[email protected]bd0cd3bb2012-06-14 03:03:381084 {
[email protected]ffbe5782013-05-09 23:22:081085 "new-dialog-style",
1086 IDS_FLAGS_NEW_DIALOG_STYLE_NAME,
1087 IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321088 kOsWin | kOsCrOS,
[email protected]ffbe5782013-05-09 23:22:081089 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle,
1090 switches::kDisableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321091 },
[email protected]7db8893a2012-07-26 00:49:401092 { "disable-accelerated-video-decode",
1093 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1094 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191095 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401096 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151097 },
[email protected]66ae9fc2012-06-19 21:33:521098#if defined(USE_ASH)
1099 {
1100 "ash-debug-shortcuts",
1101 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1102 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1103 kOsAll,
1104 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1105 },
1106#endif
[email protected]37fee0942012-08-07 21:07:451107 {
[email protected]ad3f6d22012-08-29 02:34:191108 "enable-contacts",
1109 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1110 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1111 kOsCrOS,
1112 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1113 },
[email protected]1d9bb9cd2012-08-28 22:02:501114#if defined(USE_ASH)
1115 { "ash-enable-advanced-gestures",
1116 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1117 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1118 kOsCrOS,
1119 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1120 },
[email protected]cfa24e62013-02-13 21:19:111121 { "ash-disable-tab-scrubbing",
1122 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1123 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161124 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111125 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161126 },
[email protected]00c8469e22013-05-08 21:40:081127 { "ash-drag-and-drop-applist-to-launcher",
1128 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME,
1129 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION,
1130 kOsCrOS,
1131 SINGLE_VALUE_TYPE(ash::switches::kAshDragAndDropAppListToLauncher),
1132 },
[email protected]83eef802012-12-02 07:43:521133 { "ash-enable-workspace-scrubbing",
1134 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1135 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1136 kOsCrOS,
1137 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1138 },
[email protected]cf2b1a82013-04-20 01:05:431139 { "ash-immersive-fullscreen-2",
[email protected]819e58d22013-03-20 00:16:111140 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1141 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241142 kOsCrOS,
[email protected]cf2b1a82013-04-20 01:05:431143 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen,
1144 ash::switches::kAshDisableImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241145 },
[email protected]316708a2012-11-05 22:57:021146#if defined(OS_LINUX)
1147 { "ash-enable-memory-monitor",
1148 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1149 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1150 kOsCrOS,
1151 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1152 },
1153#endif
[email protected]1d9bb9cd2012-08-28 22:02:501154#endif
[email protected]9b7ab882012-09-10 23:46:361155#if defined(OS_CHROMEOS)
[email protected]1f9fa302013-05-17 21:11:131156 { "use-new-network-configuration-handlers",
1157 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_NAME,
1158 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_DESCRIPTION,
1159 kOsCrOS,
1160 SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConfigurationHandlers),
1161 },
[email protected]9475ee6f2013-03-08 18:20:091162 { "ash-disable-new-network-status-area",
1163 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1164 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461165 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091166 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461167 },
[email protected]9b7ab882012-09-10 23:46:361168 {
[email protected]354ff2d2013-05-01 17:06:311169 "ash-enable-new-audio-handler2",
[email protected]db5be732013-04-24 05:21:121170 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME,
1171 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_DESCRIPTION,
1172 kOsCrOS,
[email protected]354ff2d2013-05-01 17:06:311173 ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableNewAudioHandler)
1174 },
1175 {
1176 "ash-audio-device-menu",
1177 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME,
1178 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION,
1179 kOsCrOS,
1180 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu)
[email protected]db5be732013-04-24 05:21:121181 },
1182 {
[email protected]205f07892012-10-16 20:26:221183 "enable-carrier-switching",
1184 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1185 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1186 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241187 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221188 },
1189 {
[email protected]9b7ab882012-09-10 23:46:361190 "enable-request-tablet-site",
1191 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1192 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1193 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241194 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361195 },
1196#endif
[email protected]dab49c0b2012-10-04 05:55:351197 {
1198 "debug-packed-apps",
1199 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1200 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561201 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351202 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1203 },
[email protected]d1459ed2012-10-10 01:29:331204 {
1205 "enable-password-generation",
1206 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1207 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561208 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331209 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1210 },
[email protected]26d045f2012-10-18 21:18:431211 {
[email protected]76f7d4882012-10-26 21:09:221212 "enable-deferred-image-decoding",
1213 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1214 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221215 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221216 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1217 },
1218 {
[email protected]075543d2012-10-24 01:29:141219 "performance-monitor-gathering",
1220 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1221 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1222 kOsAll,
1223 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1224 },
[email protected]783d5bb2012-10-24 03:47:141225 {
[email protected]90b482d2013-04-04 10:45:581226 "disable-native-autofill-ui",
1227 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1228 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431229 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581230 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431231 },
1232 {
[email protected]a7259fb2012-11-08 06:22:231233 "enable-experimental-form-filling",
1234 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1235 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1236 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481237 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231238 },
[email protected]6e6efe42013-01-30 00:04:501239 {
[email protected]db3178c2013-03-21 14:54:541240 "wallet-service-use-prod",
1241 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1242 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1243 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481244 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541245 },
1246 {
[email protected]6e6efe42013-01-30 00:04:501247 "enable-interactive-autocomplete",
1248 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1249 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221250 kOsWin | kOsCrOS | kOsAndroid,
[email protected]000f3ad2013-05-16 02:19:171251 ENABLE_DISABLE_VALUE_TYPE(
1252 autofill::switches::kEnableInteractiveAutocomplete,
1253 autofill::switches::kDisableInteractiveAutocomplete)
[email protected]6e6efe42013-01-30 00:04:501254 },
[email protected]177260c2013-04-24 01:47:381255#if defined(USE_AURA)
1256 {
1257 "overscroll-history-navigation",
1258 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1259 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1260 kOsAll,
1261 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1262 switches::kOverscrollHistoryNavigation, "1",
1263 switches::kOverscrollHistoryNavigation, "0")
1264 },
1265#endif
[email protected]edbea622012-11-28 20:39:381266 {
1267 "enable-touch-drag-drop",
1268 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1269 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1270 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271271 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1272 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381273 },
[email protected]0e2f43b62013-02-21 00:47:151274 {
1275 "enable-touch-editing",
1276 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1277 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1278 kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271279 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1280 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151281 },
[email protected]92e12dd92012-12-11 03:33:201282 {
1283 "enable-rich-notifications",
1284 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1285 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
[email protected]ed4004b52013-05-07 13:25:001286 kOsWin | kOsCrOS | kOsMac,
[email protected]aee412aa2013-04-02 20:01:231287 ENABLE_DISABLE_VALUE_TYPE(
1288 message_center::switches::kEnableRichNotifications,
1289 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201290 },
[email protected]4d51c682012-12-11 11:34:551291 {
[email protected]ddec1aa2013-04-28 23:22:451292 "enable-sync-synced-notifications",
1293 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1294 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
1295 kOsWin | kOsCrOS,
1296 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1297 switches::kDisableSyncSyncedNotifications)
1298 },
1299 {
[email protected]a50e16a2013-04-25 14:07:171300 "disable-full-history-sync",
[email protected]4d51c682012-12-11 11:34:551301 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1302 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1303 kOsAll,
[email protected]a50e16a2013-04-25 14:07:171304 SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync)
[email protected]4d51c682012-12-11 11:34:551305 },
[email protected]628a69a92012-12-23 04:09:341306 {
[email protected]fd030142013-02-08 02:04:381307 "enable-usermedia-screen-capture",
1308 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1309 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1310 kOsDesktop,
1311 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1312 },
[email protected]5b93e162013-02-19 06:33:091313 {
1314 "enable-apps-devtool-app",
1315 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1316 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1317 kOsDesktop,
1318 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1319 },
[email protected]9323fdd12013-02-23 00:31:361320 {
1321 "impl-side-painting",
1322 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1323 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041324 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361325 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1326 },
[email protected]a42c85f2013-04-04 18:15:121327 {
[email protected]1c92d3e2013-04-18 05:31:391328 "enable-websocket-experimental-implementation",
1329 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1330 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1331 kOsAll,
1332 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1333 },
1334 {
[email protected]a42c85f2013-04-04 18:15:121335 "max-tiles-for-interest-area",
1336 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1337 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1338 kOsAndroid | kOsLinux | kOsCrOS,
1339 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1340 },
[email protected]7cf7ccb2013-04-20 02:53:081341 {
1342 "enable-offline-mode",
1343 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME,
1344 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION,
1345 kOsAll,
1346 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess)
1347 },
[email protected]a3618122013-04-26 21:15:341348 {
1349 "default-tile-width",
1350 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1351 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1352 kOsAll,
1353 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1354 },
1355 {
1356 "default-tile-height",
1357 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1358 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1359 kOsAll,
1360 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1361 },
[email protected]2f2f72b2013-03-08 22:37:311362 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1363#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371364 {
1365 "track-active-visit-time",
1366 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1367 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1368 kOsWin,
1369 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1370 },
[email protected]2f2f72b2013-03-08 22:37:311371#endif
[email protected]8cc71d42013-03-02 17:26:081372#if defined(OS_ANDROID)
1373 {
1374 "disable-gesture-requirement-for-media-playback",
1375 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1376 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1377 kOsAndroid,
1378 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1379 },
1380#endif
[email protected]e79f2fd52013-03-08 23:52:471381#if defined(OS_CHROMEOS)
1382 {
1383 "enable-experimental-bluetooth",
1384 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1385 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1386 kOsCrOS,
1387 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1388 },
1389#endif
[email protected]6077cab2013-03-11 19:36:141390#if defined(ENABLE_GOOGLE_NOW)
1391 {
1392 "enable-google-now",
1393 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1394 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1395 kOsWin | kOsCrOS,
1396 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1397 },
1398#endif
[email protected]4a9e2e02013-04-08 16:19:491399 {
1400 "enable-translate-alpha-languages",
1401 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1402 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1403 kOsAll,
1404 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1405 },
[email protected]86459e2c2013-04-10 13:39:241406#if defined(OS_CHROMEOS)
1407 {
1408 "enable-virtual-keyboard",
1409 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1410 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1411 kOsCrOS,
1412 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1413 },
1414#endif
[email protected]38484df12013-04-10 16:42:031415 {
1416 "enable-simple-cache-backend",
1417 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1418 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1419 kOsAndroid,
1420 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1421 },
[email protected]717e4e22013-04-10 20:52:231422 {
1423 "enable-tcp-fast-open",
1424 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1425 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111426 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231427 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1428 },
[email protected]8027acd2013-04-18 08:35:151429 {
1430 "enable-webp-in-accept-header",
1431 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1432 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1433 kOsAll,
1434 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1435 },
[email protected]58c740f2013-05-06 05:25:441436 {
1437 "apps-use-native-frame",
1438 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME,
1439 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION,
1440 kOsWin,
1441 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame)
1442 },
[email protected]896d86b32013-05-09 19:36:441443 {
1444 "enable-syncfs-directory-operation",
1445 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME,
1446 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION,
1447 kOsAll,
1448 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
1449 },
[email protected]a0e4b072011-08-17 01:47:071450};
[email protected]ad2a3ded2010-08-27 13:19:051451
[email protected]a314ee5a2010-10-26 21:23:281452const Experiment* experiments = kExperiments;
1453size_t num_experiments = arraysize(kExperiments);
1454
[email protected]e2ddbc92010-10-15 20:02:071455// Stores and encapsulates the little state that about:flags has.
1456class FlagsState {
1457 public:
1458 FlagsState() : needs_restart_(false) {}
1459 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1460 bool IsRestartNeededToCommitChanges();
1461 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281462 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071463 void RemoveFlagsSwitches(
1464 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001465 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071466 void reset();
1467
1468 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551469 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071470 return Singleton<FlagsState>::get();
1471 }
1472
1473 private:
1474 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531475 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071476
1477 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1478};
1479
[email protected]c7b7800a2010-10-07 18:51:351480// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491481// in a set.
[email protected]1a47d7e2010-10-15 00:37:241482void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051483 const ListValue* enabled_experiments = prefs->GetList(
1484 prefs::kEnabledLabsExperiments);
1485 if (!enabled_experiments)
1486 return;
1487
1488 for (ListValue::const_iterator it = enabled_experiments->begin();
1489 it != enabled_experiments->end();
1490 ++it) {
1491 std::string experiment_name;
1492 if (!(*it)->GetAsString(&experiment_name)) {
1493 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1494 continue;
1495 }
1496 result->insert(experiment_name);
1497 }
1498}
1499
[email protected]c6343372013-03-13 17:05:491500// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241501void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051502 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381503 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1504 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051505
1506 experiments_list->Clear();
1507 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1508 it != enabled_experiments.end();
1509 ++it) {
1510 experiments_list->Append(new StringValue(*it));
1511 }
1512}
1513
[email protected]8a6ff28d2010-12-02 16:35:191514// Adds the internal names for the specified experiment to |names|.
1515void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1516 if (e.type == Experiment::SINGLE_VALUE) {
1517 names->insert(e.internal_name);
1518 } else {
[email protected]83e9fa702013-02-25 19:30:441519 DCHECK(e.type == Experiment::MULTI_VALUE ||
1520 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191521 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441522 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191523 }
1524}
1525
[email protected]28e35af2011-02-09 12:56:221526// Confirms that an experiment is valid, used in a DCHECK in
1527// SanitizeList below.
1528bool ValidateExperiment(const Experiment& e) {
1529 switch (e.type) {
1530 case Experiment::SINGLE_VALUE:
1531 DCHECK_EQ(0, e.num_choices);
1532 DCHECK(!e.choices);
1533 break;
1534 case Experiment::MULTI_VALUE:
1535 DCHECK_GT(e.num_choices, 0);
1536 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531537 DCHECK(e.choices[0].command_line_switch);
1538 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221539 break;
[email protected]83e9fa702013-02-25 19:30:441540 case Experiment::ENABLE_DISABLE_VALUE:
1541 DCHECK_EQ(3, e.num_choices);
1542 DCHECK(!e.choices);
1543 DCHECK(e.command_line_switch);
1544 DCHECK(e.command_line_value);
1545 DCHECK(e.disable_command_line_switch);
1546 DCHECK(e.disable_command_line_value);
1547 break;
[email protected]28e35af2011-02-09 12:56:221548 default:
1549 NOTREACHED();
1550 }
1551 return true;
1552}
1553
[email protected]ad2a3ded2010-08-27 13:19:051554// Removes all experiments from prefs::kEnabledLabsExperiments that are
1555// unknown, to prevent this list to become very long as experiments are added
1556// and removed.
1557void SanitizeList(PrefService* prefs) {
1558 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221559 for (size_t i = 0; i < num_experiments; ++i) {
1560 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191561 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221562 }
[email protected]ad2a3ded2010-08-27 13:19:051563
1564 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241565 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051566
1567 std::set<std::string> new_enabled_experiments;
1568 std::set_intersection(
1569 known_experiments.begin(), known_experiments.end(),
1570 enabled_experiments.begin(), enabled_experiments.end(),
1571 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1572
[email protected]4c8853f2012-07-23 01:29:161573 if (new_enabled_experiments != enabled_experiments)
1574 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051575}
1576
[email protected]1a47d7e2010-10-15 00:37:241577void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051578 PrefService* prefs, std::set<std::string>* result) {
1579 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241580 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051581}
1582
[email protected]a314ee5a2010-10-26 21:23:281583// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1584// enabled on the current platform.
1585void GetSanitizedEnabledFlagsForCurrentPlatform(
1586 PrefService* prefs, std::set<std::string>* result) {
1587 GetSanitizedEnabledFlags(prefs, result);
1588
1589 // Filter out any experiments that aren't enabled on the current platform. We
1590 // don't remove these from prefs else syncing to a platform with a different
1591 // set of experiments would be lossy.
1592 std::set<std::string> platform_experiments;
1593 int current_platform = GetCurrentPlatform();
1594 for (size_t i = 0; i < num_experiments; ++i) {
1595 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191596 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581597#if defined(OS_CHROMEOS)
1598 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1599 AddInternalName(experiments[i], &platform_experiments);
1600#endif
[email protected]a314ee5a2010-10-26 21:23:281601 }
1602
1603 std::set<std::string> new_enabled_experiments;
1604 std::set_intersection(
1605 platform_experiments.begin(), platform_experiments.end(),
1606 result->begin(), result->end(),
1607 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1608
1609 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051610}
1611
[email protected]8a6ff28d2010-12-02 16:35:191612// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191613Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221614 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441615 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1616 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191617 ListValue* result = new ListValue;
1618 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191619 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441620 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191621 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441622 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221623 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191624 result->Append(value);
1625 }
1626 return result;
1627}
1628
[email protected]e2ddbc92010-10-15 20:02:071629} // namespace
1630
[email protected]83e9fa702013-02-25 19:30:441631std::string Experiment::NameForChoice(int index) const {
1632 DCHECK(type == Experiment::MULTI_VALUE ||
1633 type == Experiment::ENABLE_DISABLE_VALUE);
1634 DCHECK_LT(index, num_choices);
1635 return std::string(internal_name) + testing::kMultiSeparator +
1636 base::IntToString(index);
1637}
1638
1639string16 Experiment::DescriptionForChoice(int index) const {
1640 DCHECK(type == Experiment::MULTI_VALUE ||
1641 type == Experiment::ENABLE_DISABLE_VALUE);
1642 DCHECK_LT(index, num_choices);
1643 int description_id;
1644 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1645 const int kEnableDisableDescriptionIds[] = {
1646 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1647 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1648 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1649 };
1650 description_id = kEnableDisableDescriptionIds[index];
1651 } else {
1652 description_id = choices[index].description_id;
1653 }
1654 return l10n_util::GetStringUTF16(description_id);
1655}
1656
[email protected]1a47d7e2010-10-15 00:37:241657void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551658 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051659}
1660
[email protected]37736bd2013-04-18 11:53:581661ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051662 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241663 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051664
1665 int current_platform = GetCurrentPlatform();
1666
1667 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281668 for (size_t i = 0; i < num_experiments; ++i) {
1669 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051670
1671 DictionaryValue* data = new DictionaryValue();
1672 data->SetString("internal_name", experiment.internal_name);
1673 data->SetString("name",
1674 l10n_util::GetStringUTF16(experiment.visible_name_id));
1675 data->SetString("description",
1676 l10n_util::GetStringUTF16(
1677 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581678 bool supported = (experiment.supported_platforms & current_platform) != 0;
1679#if defined(OS_CHROMEOS)
1680 if (access == kOwnerAccessToFlags &&
1681 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1682 supported = true;
1683#endif
[email protected]cc3e2052011-12-20 01:01:401684 data->SetBoolean("supported", supported);
1685
1686 ListValue* supported_platforms = new ListValue();
1687 AddOsStrings(experiment.supported_platforms, supported_platforms);
1688 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051689
[email protected]28e35af2011-02-09 12:56:221690 switch (experiment.type) {
1691 case Experiment::SINGLE_VALUE:
1692 data->SetBoolean(
1693 "enabled",
1694 enabled_experiments.count(experiment.internal_name) > 0);
1695 break;
1696 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441697 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221698 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1699 break;
1700 default:
1701 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191702 }
1703
[email protected]ad2a3ded2010-08-27 13:19:051704 experiments_data->Append(data);
1705 }
1706 return experiments_data;
1707}
1708
[email protected]ad2a3ded2010-08-27 13:19:051709bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551710 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051711}
1712
1713void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351714 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551715 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071716}
1717
1718void RemoveFlagsSwitches(
1719 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551720 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071721}
1722
[email protected]cb93bf52013-02-20 01:20:001723void ResetAllFlags(PrefService* prefs) {
1724 FlagsState::GetInstance()->ResetAllFlags(prefs);
1725}
1726
[email protected]a314ee5a2010-10-26 21:23:281727int GetCurrentPlatform() {
1728#if defined(OS_MACOSX)
1729 return kOsMac;
1730#elif defined(OS_WIN)
1731 return kOsWin;
1732#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1733 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211734#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281735 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401736#elif defined(OS_ANDROID)
1737 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281738#else
1739#error Unknown platform
1740#endif
1741}
1742
[email protected]4bc5050c2010-11-18 17:55:541743void RecordUMAStatistics(const PrefService* prefs) {
1744 std::set<std::string> flags;
1745 GetEnabledFlags(prefs, &flags);
1746 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1747 ++it) {
1748 std::string action("AboutFlags_");
1749 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381750 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541751 }
1752 // Since flag metrics are recorded every startup, add a tick so that the
1753 // stats can be made meaningful.
1754 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381755 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1756 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541757}
1758
[email protected]e2ddbc92010-10-15 20:02:071759//////////////////////////////////////////////////////////////////////////////
1760// FlagsState implementation.
1761
1762namespace {
1763
[email protected]83e9fa702013-02-25 19:30:441764typedef std::map<std::string, std::pair<std::string, std::string> >
1765 NameToSwitchAndValueMap;
1766
1767void SetFlagToSwitchMapping(const std::string& key,
1768 const std::string& switch_name,
1769 const std::string& switch_value,
1770 NameToSwitchAndValueMap* name_to_switch_map) {
1771 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1772 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1773}
1774
[email protected]e2ddbc92010-10-15 20:02:071775void FlagsState::ConvertFlagsToSwitches(
1776 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071777 if (command_line->HasSwitch(switches::kNoExperiments))
1778 return;
1779
1780 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001781
[email protected]a314ee5a2010-10-26 21:23:281782 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071783
[email protected]a82744532011-02-11 16:15:531784 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191785 for (size_t i = 0; i < num_experiments; ++i) {
1786 const Experiment& e = experiments[i];
1787 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441788 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1789 e.command_line_value, &name_to_switch_map);
1790 } else if (e.type == Experiment::MULTI_VALUE) {
1791 for (int j = 0; j < e.num_choices; ++j) {
1792 SetFlagToSwitchMapping(e.NameForChoice(j),
1793 e.choices[j].command_line_switch,
1794 e.choices[j].command_line_value,
1795 &name_to_switch_map);
1796 }
[email protected]8a6ff28d2010-12-02 16:35:191797 } else {
[email protected]83e9fa702013-02-25 19:30:441798 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1799 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1800 &name_to_switch_map);
1801 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1802 e.command_line_value, &name_to_switch_map);
1803 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1804 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191805 }
1806 }
[email protected]e2ddbc92010-10-15 20:02:071807
1808 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531809 flags_switches_.insert(
1810 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1811 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071812 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1813 it != enabled_experiments.end();
1814 ++it) {
1815 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531816 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191817 name_to_switch_map.find(experiment_name);
1818 if (name_to_switch_it == name_to_switch_map.end()) {
1819 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071820 continue;
[email protected]8a6ff28d2010-12-02 16:35:191821 }
[email protected]e2ddbc92010-10-15 20:02:071822
[email protected]a82744532011-02-11 16:15:531823 const std::pair<std::string, std::string>&
1824 switch_and_value_pair = name_to_switch_it->second;
1825
1826 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1827 switch_and_value_pair.second);
1828 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071829 }
1830 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531831 flags_switches_.insert(
1832 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1833 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071834}
1835
1836bool FlagsState::IsRestartNeededToCommitChanges() {
1837 return needs_restart_;
1838}
1839
1840void FlagsState::SetExperimentEnabled(
1841 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441842 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191843 if (at_index != std::string::npos) {
1844 DCHECK(enable);
1845 // We're being asked to enable a multi-choice experiment. Disable the
1846 // currently selected choice.
1847 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221848 const std::string experiment_name = internal_name.substr(0, at_index);
1849 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191850
[email protected]28e35af2011-02-09 12:56:221851 // And enable the new choice, if it is not the default first choice.
1852 if (internal_name != experiment_name + "@0") {
1853 std::set<std::string> enabled_experiments;
1854 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081855 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221856 SetEnabledFlags(prefs, enabled_experiments);
1857 }
[email protected]8a6ff28d2010-12-02 16:35:191858 return;
1859 }
1860
[email protected]ad2a3ded2010-08-27 13:19:051861 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241862 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051863
[email protected]8a6ff28d2010-12-02 16:35:191864 const Experiment* e = NULL;
1865 for (size_t i = 0; i < num_experiments; ++i) {
1866 if (experiments[i].internal_name == internal_name) {
1867 e = experiments + i;
1868 break;
1869 }
1870 }
1871 DCHECK(e);
1872
1873 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591874 if (enable)
[email protected]147492b2013-03-19 23:52:081875 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591876 else
[email protected]147492b2013-03-19 23:52:081877 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191878 } else {
1879 if (enable) {
1880 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081881 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191882 } else {
1883 // Find the currently enabled choice and disable it.
1884 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441885 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191886 if (enabled_experiments.find(choice_name) !=
1887 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081888 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191889 enabled_experiments.erase(choice_name);
1890 // Continue on just in case there's a bug and more than one
1891 // experiment for this choice was enabled.
1892 }
1893 }
1894 }
1895 }
[email protected]ad2a3ded2010-08-27 13:19:051896
[email protected]1a47d7e2010-10-15 00:37:241897 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051898}
1899
[email protected]e2ddbc92010-10-15 20:02:071900void FlagsState::RemoveFlagsSwitches(
1901 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531902 for (std::map<std::string, std::string>::const_iterator
1903 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1904 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071905 }
1906}
1907
[email protected]cb93bf52013-02-20 01:20:001908void FlagsState::ResetAllFlags(PrefService* prefs) {
1909 needs_restart_ = true;
1910
1911 std::set<std::string> no_experiments;
1912 SetEnabledFlags(prefs, no_experiments);
1913}
1914
[email protected]e2ddbc92010-10-15 20:02:071915void FlagsState::reset() {
1916 needs_restart_ = false;
1917 flags_switches_.clear();
1918}
1919
[email protected]38e46812011-05-09 20:49:221920} // namespace
[email protected]e2ddbc92010-10-15 20:02:071921
1922namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191923
1924// WARNING: '@' is also used in the html file. If you update this constant you
1925// also need to update the html file.
1926const char kMultiSeparator[] = "@";
1927
[email protected]e2ddbc92010-10-15 20:02:071928void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551929 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071930}
[email protected]a314ee5a2010-10-26 21:23:281931
1932void SetExperiments(const Experiment* e, size_t count) {
1933 if (!e) {
1934 experiments = kExperiments;
1935 num_experiments = arraysize(kExperiments);
1936 } else {
1937 experiments = e;
1938 num_experiments = count;
1939 }
1940}
1941
[email protected]8a6ff28d2010-12-02 16:35:191942const Experiment* GetExperiments(size_t* count) {
1943 *count = num_experiments;
1944 return experiments;
1945}
1946
[email protected]e2ddbc92010-10-15 20:02:071947} // namespace testing
1948
[email protected]1a47d7e2010-10-15 00:37:241949} // namespace about_flags