blob: 32a7c43f0253be792ef5d5b667d7e923693d4153 [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 {
997 "pinch-zoom-scrollbars",
998 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
999 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
1000 kOsCrOS,
1001 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
1002 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:351003 },
[email protected]a8379312012-06-15 00:20:431004 {
[email protected]a4016f12013-05-02 07:53:471005 "forced-maximize-mode",
1006 IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME,
1007 IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION,
1008 kOsLinux | kOsWin | kOsCrOS,
1009 SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode),
1010 },
[email protected]73074742012-05-17 01:44:411011#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281012#if defined(OS_CHROMEOS)
1013 {
[email protected]8b04a1652012-08-04 02:59:491014 "disable-boot-animation",
1015 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1016 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581017 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241018 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:491019 },
[email protected]95058572012-08-20 14:57:291020 {
[email protected]b4557192012-09-19 11:29:581021 "disable-boot-animation2",
1022 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1023 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581024 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581025 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1026 },
1027 {
[email protected]ea2f3342012-09-21 21:13:361028 "boot-animation-fucntion",
1029 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1030 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581031 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361032 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1033 },
[email protected]839667d62012-10-23 19:38:571034 {
[email protected]d96aef22012-10-30 11:47:021035 "captive-portal-detector",
1036 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1037 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581038 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021039 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1040 },
1041 {
[email protected]c11aa8f12012-12-18 18:43:141042 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571043 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1044 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1045 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141046 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571047 },
[email protected]f0280952012-11-06 20:30:501048 {
[email protected]ea2fab32013-04-16 06:55:021049 "file-manager-legacy",
1050 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1051 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231052 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241053 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231054 },
[email protected]3e035e82012-11-27 20:54:321055 {
[email protected]828d99052013-04-22 08:15:031056 "file-manager-legacy-ui",
1057 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_NAME,
1058 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_DESCRIPTION,
[email protected]bc545292013-04-18 14:33:101059 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241060 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacyUI),
[email protected]bc545292013-04-18 14:33:101061 },
1062 {
[email protected]c64d7732013-03-25 18:09:501063 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521064 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1065 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581066 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241067 SINGLE_VALUE_TYPE(chromeos::switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471068 },
[email protected]6ad015c2013-03-06 00:49:511069 {
[email protected]c64d7732013-03-25 18:09:501070 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521071 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1072 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511073 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521074 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511075 },
[email protected]099b890c2013-04-25 19:16:261076 {
1077 "disable-quickoffice-component-app",
1078 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
1079 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
1080 kOsCrOS,
1081 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp),
1082 },
[email protected]62018dc2012-12-13 00:37:351083#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391084 {
[email protected]6247aba2013-03-04 22:57:181085 "views-textfield",
1086 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1087 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391088 kOsWin,
[email protected]6247aba2013-03-04 22:57:181089 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1090 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391091 },
[email protected]bd0cd3bb2012-06-14 03:03:381092 {
[email protected]ffbe5782013-05-09 23:22:081093 "new-dialog-style",
1094 IDS_FLAGS_NEW_DIALOG_STYLE_NAME,
1095 IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321096 kOsWin | kOsCrOS,
[email protected]ffbe5782013-05-09 23:22:081097 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle,
1098 switches::kDisableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321099 },
[email protected]7db8893a2012-07-26 00:49:401100 { "disable-accelerated-video-decode",
1101 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1102 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191103 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401104 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151105 },
[email protected]66ae9fc2012-06-19 21:33:521106#if defined(USE_ASH)
1107 {
1108 "ash-debug-shortcuts",
1109 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1110 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1111 kOsAll,
1112 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1113 },
1114#endif
[email protected]37fee0942012-08-07 21:07:451115 {
[email protected]ad3f6d22012-08-29 02:34:191116 "enable-contacts",
1117 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1118 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1119 kOsCrOS,
1120 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1121 },
[email protected]1d9bb9cd2012-08-28 22:02:501122#if defined(USE_ASH)
1123 { "ash-enable-advanced-gestures",
1124 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1125 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1126 kOsCrOS,
1127 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1128 },
[email protected]cfa24e62013-02-13 21:19:111129 { "ash-disable-tab-scrubbing",
1130 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1131 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161132 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111133 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161134 },
[email protected]00c8469e22013-05-08 21:40:081135 { "ash-drag-and-drop-applist-to-launcher",
1136 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME,
1137 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION,
1138 kOsCrOS,
1139 SINGLE_VALUE_TYPE(ash::switches::kAshDragAndDropAppListToLauncher),
1140 },
[email protected]83eef802012-12-02 07:43:521141 { "ash-enable-workspace-scrubbing",
1142 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1143 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1144 kOsCrOS,
1145 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1146 },
[email protected]cf2b1a82013-04-20 01:05:431147 { "ash-immersive-fullscreen-2",
[email protected]819e58d22013-03-20 00:16:111148 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1149 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241150 kOsCrOS,
[email protected]cf2b1a82013-04-20 01:05:431151 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen,
1152 ash::switches::kAshDisableImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241153 },
[email protected]316708a2012-11-05 22:57:021154#if defined(OS_LINUX)
1155 { "ash-enable-memory-monitor",
1156 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1157 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1158 kOsCrOS,
1159 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1160 },
1161#endif
[email protected]1d9bb9cd2012-08-28 22:02:501162#endif
[email protected]9b7ab882012-09-10 23:46:361163#if defined(OS_CHROMEOS)
[email protected]1f9fa302013-05-17 21:11:131164 { "use-new-network-configuration-handlers",
1165 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_NAME,
1166 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_DESCRIPTION,
1167 kOsCrOS,
1168 SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConfigurationHandlers),
1169 },
[email protected]9475ee6f2013-03-08 18:20:091170 { "ash-disable-new-network-status-area",
1171 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1172 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461173 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091174 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461175 },
[email protected]9b7ab882012-09-10 23:46:361176 {
[email protected]354ff2d2013-05-01 17:06:311177 "ash-enable-new-audio-handler2",
[email protected]db5be732013-04-24 05:21:121178 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME,
1179 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_DESCRIPTION,
1180 kOsCrOS,
[email protected]354ff2d2013-05-01 17:06:311181 ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableNewAudioHandler)
1182 },
1183 {
1184 "ash-audio-device-menu",
1185 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME,
1186 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION,
1187 kOsCrOS,
1188 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu)
[email protected]db5be732013-04-24 05:21:121189 },
1190 {
[email protected]205f07892012-10-16 20:26:221191 "enable-carrier-switching",
1192 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1193 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1194 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241195 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221196 },
1197 {
[email protected]9b7ab882012-09-10 23:46:361198 "enable-request-tablet-site",
1199 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1200 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1201 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241202 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361203 },
1204#endif
[email protected]dab49c0b2012-10-04 05:55:351205 {
1206 "debug-packed-apps",
1207 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1208 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561209 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351210 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1211 },
[email protected]d1459ed2012-10-10 01:29:331212 {
1213 "enable-password-generation",
1214 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1215 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561216 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331217 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1218 },
[email protected]26d045f2012-10-18 21:18:431219 {
[email protected]76f7d4882012-10-26 21:09:221220 "enable-deferred-image-decoding",
1221 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1222 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221223 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221224 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1225 },
1226 {
[email protected]075543d2012-10-24 01:29:141227 "performance-monitor-gathering",
1228 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1229 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1230 kOsAll,
1231 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1232 },
[email protected]783d5bb2012-10-24 03:47:141233 {
[email protected]90b482d2013-04-04 10:45:581234 "disable-native-autofill-ui",
1235 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1236 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431237 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581238 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431239 },
1240 {
[email protected]a7259fb2012-11-08 06:22:231241 "enable-experimental-form-filling",
1242 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1243 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1244 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481245 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231246 },
[email protected]6e6efe42013-01-30 00:04:501247 {
[email protected]db3178c2013-03-21 14:54:541248 "wallet-service-use-prod",
1249 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1250 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1251 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481252 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541253 },
1254 {
[email protected]6e6efe42013-01-30 00:04:501255 "enable-interactive-autocomplete",
1256 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1257 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221258 kOsWin | kOsCrOS | kOsAndroid,
[email protected]000f3ad2013-05-16 02:19:171259 ENABLE_DISABLE_VALUE_TYPE(
1260 autofill::switches::kEnableInteractiveAutocomplete,
1261 autofill::switches::kDisableInteractiveAutocomplete)
[email protected]6e6efe42013-01-30 00:04:501262 },
[email protected]177260c2013-04-24 01:47:381263#if defined(USE_AURA)
1264 {
1265 "overscroll-history-navigation",
1266 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1267 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1268 kOsAll,
1269 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1270 switches::kOverscrollHistoryNavigation, "1",
1271 switches::kOverscrollHistoryNavigation, "0")
1272 },
1273#endif
[email protected]edbea622012-11-28 20:39:381274 {
1275 "enable-touch-drag-drop",
1276 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1277 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1278 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271279 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1280 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381281 },
[email protected]0e2f43b62013-02-21 00:47:151282 {
1283 "enable-touch-editing",
1284 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1285 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1286 kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271287 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1288 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151289 },
[email protected]92e12dd92012-12-11 03:33:201290 {
1291 "enable-rich-notifications",
1292 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1293 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
[email protected]ed4004b52013-05-07 13:25:001294 kOsWin | kOsCrOS | kOsMac,
[email protected]aee412aa2013-04-02 20:01:231295 ENABLE_DISABLE_VALUE_TYPE(
1296 message_center::switches::kEnableRichNotifications,
1297 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201298 },
[email protected]4d51c682012-12-11 11:34:551299 {
[email protected]ddec1aa2013-04-28 23:22:451300 "enable-sync-synced-notifications",
1301 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1302 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
1303 kOsWin | kOsCrOS,
1304 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1305 switches::kDisableSyncSyncedNotifications)
1306 },
1307 {
[email protected]a50e16a2013-04-25 14:07:171308 "disable-full-history-sync",
[email protected]4d51c682012-12-11 11:34:551309 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1310 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1311 kOsAll,
[email protected]a50e16a2013-04-25 14:07:171312 SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync)
[email protected]4d51c682012-12-11 11:34:551313 },
[email protected]628a69a92012-12-23 04:09:341314 {
[email protected]fd030142013-02-08 02:04:381315 "enable-usermedia-screen-capture",
1316 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1317 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1318 kOsDesktop,
1319 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1320 },
[email protected]5b93e162013-02-19 06:33:091321 {
1322 "enable-apps-devtool-app",
1323 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1324 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1325 kOsDesktop,
1326 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1327 },
[email protected]9323fdd12013-02-23 00:31:361328 {
1329 "impl-side-painting",
1330 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1331 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041332 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361333 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1334 },
[email protected]a42c85f2013-04-04 18:15:121335 {
[email protected]1c92d3e2013-04-18 05:31:391336 "enable-websocket-experimental-implementation",
1337 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1338 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1339 kOsAll,
1340 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1341 },
1342 {
[email protected]a42c85f2013-04-04 18:15:121343 "max-tiles-for-interest-area",
1344 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1345 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1346 kOsAndroid | kOsLinux | kOsCrOS,
1347 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1348 },
[email protected]7cf7ccb2013-04-20 02:53:081349 {
1350 "enable-offline-mode",
1351 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME,
1352 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION,
1353 kOsAll,
1354 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess)
1355 },
[email protected]a3618122013-04-26 21:15:341356 {
1357 "default-tile-width",
1358 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1359 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1360 kOsAll,
1361 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1362 },
1363 {
1364 "default-tile-height",
1365 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1366 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1367 kOsAll,
1368 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1369 },
[email protected]2f2f72b2013-03-08 22:37:311370 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1371#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371372 {
1373 "track-active-visit-time",
1374 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1375 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1376 kOsWin,
1377 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1378 },
[email protected]2f2f72b2013-03-08 22:37:311379#endif
[email protected]8cc71d42013-03-02 17:26:081380#if defined(OS_ANDROID)
1381 {
1382 "disable-gesture-requirement-for-media-playback",
1383 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1384 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1385 kOsAndroid,
1386 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1387 },
1388#endif
[email protected]e79f2fd52013-03-08 23:52:471389#if defined(OS_CHROMEOS)
1390 {
1391 "enable-experimental-bluetooth",
1392 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1393 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1394 kOsCrOS,
1395 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1396 },
1397#endif
[email protected]6077cab2013-03-11 19:36:141398#if defined(ENABLE_GOOGLE_NOW)
1399 {
1400 "enable-google-now",
1401 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1402 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1403 kOsWin | kOsCrOS,
1404 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1405 },
1406#endif
[email protected]4a9e2e02013-04-08 16:19:491407 {
1408 "enable-translate-alpha-languages",
1409 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1410 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1411 kOsAll,
1412 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1413 },
[email protected]86459e2c2013-04-10 13:39:241414#if defined(OS_CHROMEOS)
1415 {
1416 "enable-virtual-keyboard",
1417 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1418 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1419 kOsCrOS,
1420 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1421 },
1422#endif
[email protected]38484df12013-04-10 16:42:031423 {
1424 "enable-simple-cache-backend",
1425 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1426 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1427 kOsAndroid,
1428 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1429 },
[email protected]717e4e22013-04-10 20:52:231430 {
1431 "enable-tcp-fast-open",
1432 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1433 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111434 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231435 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1436 },
[email protected]8027acd2013-04-18 08:35:151437 {
1438 "enable-webp-in-accept-header",
1439 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1440 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1441 kOsAll,
1442 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1443 },
[email protected]58c740f2013-05-06 05:25:441444 {
1445 "apps-use-native-frame",
1446 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME,
1447 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION,
1448 kOsWin,
1449 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame)
1450 },
[email protected]896d86b32013-05-09 19:36:441451 {
1452 "enable-syncfs-directory-operation",
1453 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME,
1454 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION,
1455 kOsAll,
1456 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
1457 },
[email protected]a0e4b072011-08-17 01:47:071458};
[email protected]ad2a3ded2010-08-27 13:19:051459
[email protected]a314ee5a2010-10-26 21:23:281460const Experiment* experiments = kExperiments;
1461size_t num_experiments = arraysize(kExperiments);
1462
[email protected]e2ddbc92010-10-15 20:02:071463// Stores and encapsulates the little state that about:flags has.
1464class FlagsState {
1465 public:
1466 FlagsState() : needs_restart_(false) {}
1467 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1468 bool IsRestartNeededToCommitChanges();
1469 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281470 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071471 void RemoveFlagsSwitches(
1472 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001473 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071474 void reset();
1475
1476 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551477 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071478 return Singleton<FlagsState>::get();
1479 }
1480
1481 private:
1482 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531483 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071484
1485 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1486};
1487
[email protected]c7b7800a2010-10-07 18:51:351488// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491489// in a set.
[email protected]1a47d7e2010-10-15 00:37:241490void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051491 const ListValue* enabled_experiments = prefs->GetList(
1492 prefs::kEnabledLabsExperiments);
1493 if (!enabled_experiments)
1494 return;
1495
1496 for (ListValue::const_iterator it = enabled_experiments->begin();
1497 it != enabled_experiments->end();
1498 ++it) {
1499 std::string experiment_name;
1500 if (!(*it)->GetAsString(&experiment_name)) {
1501 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1502 continue;
1503 }
1504 result->insert(experiment_name);
1505 }
1506}
1507
[email protected]c6343372013-03-13 17:05:491508// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241509void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051510 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381511 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1512 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051513
1514 experiments_list->Clear();
1515 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1516 it != enabled_experiments.end();
1517 ++it) {
1518 experiments_list->Append(new StringValue(*it));
1519 }
1520}
1521
[email protected]8a6ff28d2010-12-02 16:35:191522// Adds the internal names for the specified experiment to |names|.
1523void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1524 if (e.type == Experiment::SINGLE_VALUE) {
1525 names->insert(e.internal_name);
1526 } else {
[email protected]83e9fa702013-02-25 19:30:441527 DCHECK(e.type == Experiment::MULTI_VALUE ||
1528 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191529 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441530 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191531 }
1532}
1533
[email protected]28e35af2011-02-09 12:56:221534// Confirms that an experiment is valid, used in a DCHECK in
1535// SanitizeList below.
1536bool ValidateExperiment(const Experiment& e) {
1537 switch (e.type) {
1538 case Experiment::SINGLE_VALUE:
1539 DCHECK_EQ(0, e.num_choices);
1540 DCHECK(!e.choices);
1541 break;
1542 case Experiment::MULTI_VALUE:
1543 DCHECK_GT(e.num_choices, 0);
1544 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531545 DCHECK(e.choices[0].command_line_switch);
1546 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221547 break;
[email protected]83e9fa702013-02-25 19:30:441548 case Experiment::ENABLE_DISABLE_VALUE:
1549 DCHECK_EQ(3, e.num_choices);
1550 DCHECK(!e.choices);
1551 DCHECK(e.command_line_switch);
1552 DCHECK(e.command_line_value);
1553 DCHECK(e.disable_command_line_switch);
1554 DCHECK(e.disable_command_line_value);
1555 break;
[email protected]28e35af2011-02-09 12:56:221556 default:
1557 NOTREACHED();
1558 }
1559 return true;
1560}
1561
[email protected]ad2a3ded2010-08-27 13:19:051562// Removes all experiments from prefs::kEnabledLabsExperiments that are
1563// unknown, to prevent this list to become very long as experiments are added
1564// and removed.
1565void SanitizeList(PrefService* prefs) {
1566 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221567 for (size_t i = 0; i < num_experiments; ++i) {
1568 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191569 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221570 }
[email protected]ad2a3ded2010-08-27 13:19:051571
1572 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241573 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051574
1575 std::set<std::string> new_enabled_experiments;
1576 std::set_intersection(
1577 known_experiments.begin(), known_experiments.end(),
1578 enabled_experiments.begin(), enabled_experiments.end(),
1579 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1580
[email protected]4c8853f2012-07-23 01:29:161581 if (new_enabled_experiments != enabled_experiments)
1582 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051583}
1584
[email protected]1a47d7e2010-10-15 00:37:241585void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051586 PrefService* prefs, std::set<std::string>* result) {
1587 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241588 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051589}
1590
[email protected]a314ee5a2010-10-26 21:23:281591// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1592// enabled on the current platform.
1593void GetSanitizedEnabledFlagsForCurrentPlatform(
1594 PrefService* prefs, std::set<std::string>* result) {
1595 GetSanitizedEnabledFlags(prefs, result);
1596
1597 // Filter out any experiments that aren't enabled on the current platform. We
1598 // don't remove these from prefs else syncing to a platform with a different
1599 // set of experiments would be lossy.
1600 std::set<std::string> platform_experiments;
1601 int current_platform = GetCurrentPlatform();
1602 for (size_t i = 0; i < num_experiments; ++i) {
1603 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191604 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581605#if defined(OS_CHROMEOS)
1606 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1607 AddInternalName(experiments[i], &platform_experiments);
1608#endif
[email protected]a314ee5a2010-10-26 21:23:281609 }
1610
1611 std::set<std::string> new_enabled_experiments;
1612 std::set_intersection(
1613 platform_experiments.begin(), platform_experiments.end(),
1614 result->begin(), result->end(),
1615 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1616
1617 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051618}
1619
[email protected]8a6ff28d2010-12-02 16:35:191620// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191621Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221622 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441623 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1624 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191625 ListValue* result = new ListValue;
1626 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191627 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441628 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191629 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441630 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221631 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191632 result->Append(value);
1633 }
1634 return result;
1635}
1636
[email protected]e2ddbc92010-10-15 20:02:071637} // namespace
1638
[email protected]83e9fa702013-02-25 19:30:441639std::string Experiment::NameForChoice(int index) const {
1640 DCHECK(type == Experiment::MULTI_VALUE ||
1641 type == Experiment::ENABLE_DISABLE_VALUE);
1642 DCHECK_LT(index, num_choices);
1643 return std::string(internal_name) + testing::kMultiSeparator +
1644 base::IntToString(index);
1645}
1646
1647string16 Experiment::DescriptionForChoice(int index) const {
1648 DCHECK(type == Experiment::MULTI_VALUE ||
1649 type == Experiment::ENABLE_DISABLE_VALUE);
1650 DCHECK_LT(index, num_choices);
1651 int description_id;
1652 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1653 const int kEnableDisableDescriptionIds[] = {
1654 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1655 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1656 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1657 };
1658 description_id = kEnableDisableDescriptionIds[index];
1659 } else {
1660 description_id = choices[index].description_id;
1661 }
1662 return l10n_util::GetStringUTF16(description_id);
1663}
1664
[email protected]1a47d7e2010-10-15 00:37:241665void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551666 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051667}
1668
[email protected]37736bd2013-04-18 11:53:581669ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051670 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241671 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051672
1673 int current_platform = GetCurrentPlatform();
1674
1675 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281676 for (size_t i = 0; i < num_experiments; ++i) {
1677 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051678
1679 DictionaryValue* data = new DictionaryValue();
1680 data->SetString("internal_name", experiment.internal_name);
1681 data->SetString("name",
1682 l10n_util::GetStringUTF16(experiment.visible_name_id));
1683 data->SetString("description",
1684 l10n_util::GetStringUTF16(
1685 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581686 bool supported = (experiment.supported_platforms & current_platform) != 0;
1687#if defined(OS_CHROMEOS)
1688 if (access == kOwnerAccessToFlags &&
1689 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1690 supported = true;
1691#endif
[email protected]cc3e2052011-12-20 01:01:401692 data->SetBoolean("supported", supported);
1693
1694 ListValue* supported_platforms = new ListValue();
1695 AddOsStrings(experiment.supported_platforms, supported_platforms);
1696 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051697
[email protected]28e35af2011-02-09 12:56:221698 switch (experiment.type) {
1699 case Experiment::SINGLE_VALUE:
1700 data->SetBoolean(
1701 "enabled",
1702 enabled_experiments.count(experiment.internal_name) > 0);
1703 break;
1704 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441705 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221706 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1707 break;
1708 default:
1709 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191710 }
1711
[email protected]ad2a3ded2010-08-27 13:19:051712 experiments_data->Append(data);
1713 }
1714 return experiments_data;
1715}
1716
[email protected]ad2a3ded2010-08-27 13:19:051717bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551718 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051719}
1720
1721void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351722 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551723 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071724}
1725
1726void RemoveFlagsSwitches(
1727 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551728 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071729}
1730
[email protected]cb93bf52013-02-20 01:20:001731void ResetAllFlags(PrefService* prefs) {
1732 FlagsState::GetInstance()->ResetAllFlags(prefs);
1733}
1734
[email protected]a314ee5a2010-10-26 21:23:281735int GetCurrentPlatform() {
1736#if defined(OS_MACOSX)
1737 return kOsMac;
1738#elif defined(OS_WIN)
1739 return kOsWin;
1740#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1741 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211742#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281743 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401744#elif defined(OS_ANDROID)
1745 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281746#else
1747#error Unknown platform
1748#endif
1749}
1750
[email protected]4bc5050c2010-11-18 17:55:541751void RecordUMAStatistics(const PrefService* prefs) {
1752 std::set<std::string> flags;
1753 GetEnabledFlags(prefs, &flags);
1754 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1755 ++it) {
1756 std::string action("AboutFlags_");
1757 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381758 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541759 }
1760 // Since flag metrics are recorded every startup, add a tick so that the
1761 // stats can be made meaningful.
1762 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381763 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1764 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541765}
1766
[email protected]e2ddbc92010-10-15 20:02:071767//////////////////////////////////////////////////////////////////////////////
1768// FlagsState implementation.
1769
1770namespace {
1771
[email protected]83e9fa702013-02-25 19:30:441772typedef std::map<std::string, std::pair<std::string, std::string> >
1773 NameToSwitchAndValueMap;
1774
1775void SetFlagToSwitchMapping(const std::string& key,
1776 const std::string& switch_name,
1777 const std::string& switch_value,
1778 NameToSwitchAndValueMap* name_to_switch_map) {
1779 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1780 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1781}
1782
[email protected]e2ddbc92010-10-15 20:02:071783void FlagsState::ConvertFlagsToSwitches(
1784 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071785 if (command_line->HasSwitch(switches::kNoExperiments))
1786 return;
1787
1788 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001789
[email protected]a314ee5a2010-10-26 21:23:281790 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071791
[email protected]a82744532011-02-11 16:15:531792 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191793 for (size_t i = 0; i < num_experiments; ++i) {
1794 const Experiment& e = experiments[i];
1795 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441796 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1797 e.command_line_value, &name_to_switch_map);
1798 } else if (e.type == Experiment::MULTI_VALUE) {
1799 for (int j = 0; j < e.num_choices; ++j) {
1800 SetFlagToSwitchMapping(e.NameForChoice(j),
1801 e.choices[j].command_line_switch,
1802 e.choices[j].command_line_value,
1803 &name_to_switch_map);
1804 }
[email protected]8a6ff28d2010-12-02 16:35:191805 } else {
[email protected]83e9fa702013-02-25 19:30:441806 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1807 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1808 &name_to_switch_map);
1809 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1810 e.command_line_value, &name_to_switch_map);
1811 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1812 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191813 }
1814 }
[email protected]e2ddbc92010-10-15 20:02:071815
1816 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531817 flags_switches_.insert(
1818 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1819 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071820 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1821 it != enabled_experiments.end();
1822 ++it) {
1823 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531824 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191825 name_to_switch_map.find(experiment_name);
1826 if (name_to_switch_it == name_to_switch_map.end()) {
1827 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071828 continue;
[email protected]8a6ff28d2010-12-02 16:35:191829 }
[email protected]e2ddbc92010-10-15 20:02:071830
[email protected]a82744532011-02-11 16:15:531831 const std::pair<std::string, std::string>&
1832 switch_and_value_pair = name_to_switch_it->second;
1833
1834 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1835 switch_and_value_pair.second);
1836 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071837 }
1838 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531839 flags_switches_.insert(
1840 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1841 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071842}
1843
1844bool FlagsState::IsRestartNeededToCommitChanges() {
1845 return needs_restart_;
1846}
1847
1848void FlagsState::SetExperimentEnabled(
1849 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441850 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191851 if (at_index != std::string::npos) {
1852 DCHECK(enable);
1853 // We're being asked to enable a multi-choice experiment. Disable the
1854 // currently selected choice.
1855 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221856 const std::string experiment_name = internal_name.substr(0, at_index);
1857 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191858
[email protected]28e35af2011-02-09 12:56:221859 // And enable the new choice, if it is not the default first choice.
1860 if (internal_name != experiment_name + "@0") {
1861 std::set<std::string> enabled_experiments;
1862 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081863 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221864 SetEnabledFlags(prefs, enabled_experiments);
1865 }
[email protected]8a6ff28d2010-12-02 16:35:191866 return;
1867 }
1868
[email protected]ad2a3ded2010-08-27 13:19:051869 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241870 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051871
[email protected]8a6ff28d2010-12-02 16:35:191872 const Experiment* e = NULL;
1873 for (size_t i = 0; i < num_experiments; ++i) {
1874 if (experiments[i].internal_name == internal_name) {
1875 e = experiments + i;
1876 break;
1877 }
1878 }
1879 DCHECK(e);
1880
1881 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591882 if (enable)
[email protected]147492b2013-03-19 23:52:081883 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591884 else
[email protected]147492b2013-03-19 23:52:081885 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191886 } else {
1887 if (enable) {
1888 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081889 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191890 } else {
1891 // Find the currently enabled choice and disable it.
1892 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441893 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191894 if (enabled_experiments.find(choice_name) !=
1895 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081896 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191897 enabled_experiments.erase(choice_name);
1898 // Continue on just in case there's a bug and more than one
1899 // experiment for this choice was enabled.
1900 }
1901 }
1902 }
1903 }
[email protected]ad2a3ded2010-08-27 13:19:051904
[email protected]1a47d7e2010-10-15 00:37:241905 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051906}
1907
[email protected]e2ddbc92010-10-15 20:02:071908void FlagsState::RemoveFlagsSwitches(
1909 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531910 for (std::map<std::string, std::string>::const_iterator
1911 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1912 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071913 }
1914}
1915
[email protected]cb93bf52013-02-20 01:20:001916void FlagsState::ResetAllFlags(PrefService* prefs) {
1917 needs_restart_ = true;
1918
1919 std::set<std::string> no_experiments;
1920 SetEnabledFlags(prefs, no_experiments);
1921}
1922
[email protected]e2ddbc92010-10-15 20:02:071923void FlagsState::reset() {
1924 needs_restart_ = false;
1925 flags_switches_.clear();
1926}
1927
[email protected]38e46812011-05-09 20:49:221928} // namespace
[email protected]e2ddbc92010-10-15 20:02:071929
1930namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191931
1932// WARNING: '@' is also used in the html file. If you update this constant you
1933// also need to update the html file.
1934const char kMultiSeparator[] = "@";
1935
[email protected]e2ddbc92010-10-15 20:02:071936void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551937 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071938}
[email protected]a314ee5a2010-10-26 21:23:281939
1940void SetExperiments(const Experiment* e, size_t count) {
1941 if (!e) {
1942 experiments = kExperiments;
1943 num_experiments = arraysize(kExperiments);
1944 } else {
1945 experiments = e;
1946 num_experiments = count;
1947 }
1948}
1949
[email protected]8a6ff28d2010-12-02 16:35:191950const Experiment* GetExperiments(size_t* count) {
1951 *count = num_experiments;
1952 return experiments;
1953}
1954
[email protected]e2ddbc92010-10-15 20:02:071955} // namespace testing
1956
[email protected]1a47d7e2010-10-15 00:37:241957} // namespace about_flags