blob: 47e19ff594d20586cab6e5c2406a4476a27ca36c [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]0bc6c272012-07-17 03:32:0329#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1730#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5931#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4832#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2733#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2434#include "ui/keyboard/keyboard_switches.h"
[email protected]9a224572013-05-12 23:08:5635#include "ui/message_center/message_center_switches.h"
[email protected]fb1aac14e2013-05-14 05:30:2436#include "ui/surface/surface_switches.h"
[email protected]9a224572013-05-12 23:08:5637
[email protected]dc04be7c2012-03-15 23:57:4938#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3139#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4940#endif
41
[email protected]badba1ad2012-11-16 17:21:4642#if defined(OS_CHROMEOS)
43#include "chromeos/chromeos_switches.h"
44#endif
45
[email protected]7f6f44c2011-12-14 13:23:3846using content::UserMetricsAction;
47
[email protected]1a47d7e2010-10-15 00:37:2448namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0549
[email protected]8a6ff28d2010-12-02 16:35:1950// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5351#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4452 Experiment::SINGLE_VALUE, \
53 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5354#define SINGLE_VALUE_TYPE(command_line_switch) \
55 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4456#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
57 disable_switch, disable_value) \
58 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
59 disable_switch, disable_value, NULL, 3
60#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
61 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5362#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4463 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1964
[email protected]e2ddbc92010-10-15 20:02:0765namespace {
66
[email protected]9c7453d2012-01-21 00:45:4067const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5668const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0569
[email protected]cc3e2052011-12-20 01:01:4070// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
71// whether the experiment is available on that platform.
72void AddOsStrings(unsigned bitmask, ListValue* list) {
73 struct {
74 unsigned bit;
75 const char* const name;
76 } kBitsToOs[] = {
77 {kOsMac, "Mac"},
78 {kOsWin, "Windows"},
79 {kOsLinux, "Linux"},
80 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0181 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:5882 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[email protected]cc3e2052011-12-20 01:01:4083 };
84 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
85 if (bitmask & kBitsToOs[i].bit)
86 list->Append(new StringValue(kBitsToOs[i].name));
87}
88
[email protected]128dc6c2012-06-22 20:30:3589const Experiment::Choice
90 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
91 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
92 "",
93 "" },
94 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
95 switches::kOmniboxHistoryQuickProviderReorderForInlining,
96 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
98 switches::kOmniboxHistoryQuickProviderReorderForInlining,
99 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
100};
101
[email protected]032d5e6c2012-02-17 17:53:55102const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
103 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
104 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
105 switches::kOmniboxInlineHistoryQuickProvider,
106 switches::kOmniboxInlineHistoryQuickProviderAllowed },
107 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
108 switches::kOmniboxInlineHistoryQuickProvider,
109 switches::kOmniboxInlineHistoryQuickProviderProhibited }
110};
111
[email protected]fb854192013-02-06 01:30:04112const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
113 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
114 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
115 switches::kEnableCompositingForFixedPosition, ""},
116 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
117 switches::kDisableCompositingForFixedPosition, ""},
118 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
119 switches::kEnableHighDpiCompositingForFixedPosition, ""}
120};
121
[email protected]8b1c3c72013-01-25 01:48:43122const Experiment::Choice kGDIPresentChoices[] = {
123 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
124 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
125 switches::kDoFirstShowPresentWithGDI, ""},
126 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
127 switches::kDoAllShowPresentWithGDI, ""}
128};
129
[email protected]d7932532012-11-21 21:10:31130const Experiment::Choice kTouchEventsChoices[] = {
131 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
132 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
133 switches::kTouchEvents,
134 switches::kTouchEventsEnabled },
135 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
136 switches::kTouchEvents,
137 switches::kTouchEventsDisabled }
138};
139
[email protected]347a0c72012-05-14 20:28:06140const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31141 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20142 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06143 switches::kTouchOptimizedUI,
144 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20145 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06146 switches::kTouchOptimizedUI,
147 switches::kTouchOptimizedUIDisabled }
148};
149
[email protected]66f409c2012-10-04 20:59:04150const Experiment::Choice kNaClDebugMaskChoices[] = {
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
152 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
153 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
154 // an option to switch off its debugging.
155 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
156 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
157 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
158 switches::kNaClDebugMask, "*://*/*debug.nmf" }
159};
160
[email protected]ea2f3342012-09-21 21:13:36161#if defined(OS_CHROMEOS)
162const Experiment::Choice kAshBootAnimationFunction[] = {
163 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
164 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
165 ash::switches::kAshBootAnimationFunction2, ""},
166 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
167 ash::switches::kAshBootAnimationFunction3, ""}
168};
[email protected]d96aef22012-10-30 11:47:02169
170const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]2f2d6c32013-05-10 02:56:24171 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]d96aef22012-10-30 11:47:02172 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24173 chromeos::switches::kEnableChromeCaptivePortalDetector, "" },
[email protected]ad2fe9f2012-11-15 11:03:19174 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24175 chromeos::switches::kDisableChromeCaptivePortalDetector, "" }
[email protected]d96aef22012-10-30 11:47:02176};
[email protected]a78c7432013-03-13 06:22:43177
[email protected]ea2f3342012-09-21 21:13:36178#endif
179
[email protected]9323fdd12013-02-23 00:31:36180const Experiment::Choice kImplSidePaintingChoices[] = {
181 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
182 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
183 cc::switches::kEnableImplSidePainting, ""},
184 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
185 cc::switches::kDisableImplSidePainting, ""}
186};
187
[email protected]a42c85f2013-04-04 18:15:12188const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
189 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
190 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
191 cc::switches::kMaxTilesForInterestArea, "64"},
192 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
193 cc::switches::kMaxTilesForInterestArea, "128"},
194 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
195 cc::switches::kMaxTilesForInterestArea, "256"},
196 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
197 cc::switches::kMaxTilesForInterestArea, "512"}
198};
199
[email protected]a3618122013-04-26 21:15:34200const Experiment::Choice kDefaultTileWidthChoices[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
202 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
203 switches::kDefaultTileWidth, "128"},
204 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
205 switches::kDefaultTileWidth, "256"},
206 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
207 switches::kDefaultTileWidth, "512"},
208 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
209 switches::kDefaultTileWidth, "1024"}
210};
211
212const Experiment::Choice kDefaultTileHeightChoices[] = {
213 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
214 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
215 switches::kDefaultTileHeight, "128"},
216 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
217 switches::kDefaultTileHeight, "256"},
218 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
219 switches::kDefaultTileHeight, "512"},
220 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
221 switches::kDefaultTileHeight, "1024"}
222};
223
[email protected]38484df12013-04-10 16:42:03224const Experiment::Choice kSimpleCacheBackendChoices[] = {
[email protected]9a3de3e32013-04-23 19:05:21225 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
227 switches::kUseSimpleCacheBackend, "off" },
[email protected]38484df12013-04-10 16:42:03228 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
229 switches::kUseSimpleCacheBackend, "on"}
230};
231
[email protected]4bc5050c2010-11-18 17:55:54232// RECORDING USER METRICS FOR FLAGS:
233// -----------------------------------------------------------------------------
234// The first line of the experiment is the internal name. If you'd like to
235// gather statistics about the usage of your flag, you should append a marker
236// comment to the end of the feature name, like so:
237// "my-special-feature", // FLAGS:RECORD_UMA
238//
239// After doing that, run //chrome/tools/extract_actions.py (see instructions at
240// the top of that file for details) to update the chromeactions.txt file, which
241// will enable UMA to record your feature flag.
242//
[email protected]783d5bb2012-10-24 03:47:14243// After your feature has shipped under a flag, you can locate the metrics under
244// the action name AboutFlags_internal-action-name. Actions are recorded once
245// per startup, so you should divide this number by AboutFlags_StartupTick to
246// get a sense of usage. Note that this will not be the same as number of users
247// with a given feature enabled because users can quit and relaunch the
248// application multiple times over a given time interval. The dashboard also
249// shows you how many (metrics reporting) users have enabled the flag over the
250// last seven days. However, note that this is not the same as the number of
251// users who have the flag enabled, since enabling the flag happens once,
252// whereas running with the flag enabled happens until the user flips the flag
253// again.
[email protected]4bc5050c2010-11-18 17:55:54254
[email protected]8a6ff28d2010-12-02 16:35:19255// To add a new experiment add to the end of kExperiments. There are two
256// distinct types of experiments:
257// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
258// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22259// . MULTI_VALUE: a list of choices, the first of which should correspond to a
260// deactivated state for this lab (i.e. no command line option). To specify
261// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
262// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19263// See the documentation of Experiment for details on the fields.
264//
265// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05266const Experiment kExperiments[] = {
267 {
[email protected]aac169d2011-03-18 19:53:03268 "expose-for-tabs", // FLAGS:RECORD_UMA
269 IDS_FLAGS_TABPOSE_NAME,
270 IDS_FLAGS_TABPOSE_DESCRIPTION,
271 kOsMac,
272#if defined(OS_MACOSX)
273 // The switch exists only on OS X.
274 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
275#else
276 SINGLE_VALUE_TYPE("")
277#endif
278 },
279 {
[email protected]4bc5050c2010-11-18 17:55:54280 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05281 IDS_FLAGS_CONFLICTS_CHECK_NAME,
282 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
283 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19284 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05285 },
286 {
[email protected]4bc5050c2010-11-18 17:55:54287 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
289 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45290 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22291 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31292 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22293 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
294 // always have PDF rasterization available, so no flag needed there.
295#if !defined(GOOGLE_CHROME_BUILD)
296 kOsWin,
297#else
298 0,
[email protected]fa6d2a2f2010-11-30 21:47:19299#endif
[email protected]8a6ff28d2010-12-02 16:35:19300 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42301 },
[email protected]60d77bd2012-08-22 00:10:07302#if defined(OS_WIN)
303 {
304 "print-raster",
305 IDS_FLAGS_PRINT_RASTER_NAME,
306 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
307 kOsWin,
308 SINGLE_VALUE_TYPE(switches::kPrintRaster)
309 },
310#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05311 {
[email protected]96c6f4c2011-05-18 19:36:22312 "ignore-gpu-blacklist",
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
314 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
315 kOsAll,
316 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
317 },
318 {
[email protected]0110cf112011-07-02 00:39:43319 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22320 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
321 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23322 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44323 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
324 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22325 },
326 {
[email protected]72787e392012-03-23 05:55:43327 "threaded-compositing-mode",
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
329 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58330 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44331 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
332 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59333 },
334 {
[email protected]17e27692013-02-06 17:02:09335 "force-accelerated-composited-scrolling",
336 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
337 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
338 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44339 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
340 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09341 },
342 {
[email protected]8b1c3c72013-01-25 01:48:43343 "present-with-GDI",
344 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
345 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
346 kOsWin,
347 MULTI_VALUE_TYPE(kGDIPresentChoices)
348 },
349 {
[email protected]2b608752013-05-01 03:34:36350 "enable-experimental-canvas-features",
351 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
352 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
353 kOsAll,
354 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
355 },
356 {
[email protected]81c64af62012-06-06 20:15:52357 "disable-accelerated-2d-canvas",
358 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
359 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
360 kOsAll,
361 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
362 },
363 {
[email protected]efcde132012-05-30 01:05:18364 "disable-threaded-animation",
365 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
366 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59367 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37368 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59369 },
370 {
[email protected]5963b772011-02-09 22:55:38371 "composited-layer-borders",
372 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
373 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
374 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57375 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38376 },
377 {
[email protected]a8f1eaa2011-03-07 19:00:58378 "show-fps-counter",
379 IDS_FLAGS_SHOW_FPS_COUNTER,
380 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
381 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57382 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58383 },
[email protected]8ff7f342011-05-25 01:49:47384 {
[email protected]70c98a332011-12-21 20:51:52385 "accelerated-filters",
386 IDS_FLAGS_ACCELERATED_FILTERS,
387 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
388 kOsAll,
389 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
390 },
391 {
[email protected]8ff7f342011-05-25 01:49:47392 "disable-gpu-vsync",
393 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
394 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56395 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47396 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
397 },
[email protected]deaba6d52011-09-23 14:47:12398 {
[email protected]4052d832013-01-16 05:31:01399 "enable-webgl",
400 IDS_FLAGS_ENABLE_WEBGL_NAME,
401 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
402 kOsAndroid,
403#if defined(OS_ANDROID)
404 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
405#else
406 SINGLE_VALUE_TYPE("")
407#endif
408 },
409 {
[email protected]deaba6d52011-09-23 14:47:12410 "disable-webgl",
411 IDS_FLAGS_DISABLE_WEBGL_NAME,
412 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56413 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01414#if defined(OS_ANDROID)
415 SINGLE_VALUE_TYPE("")
416#else
[email protected]deaba6d52011-09-23 14:47:12417 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01418#endif
[email protected]deaba6d52011-09-23 14:47:12419 },
[email protected]09096e02012-05-24 11:12:04420 {
[email protected]ce585bf2013-03-14 16:25:16421 "disable-webrtc",
422 IDS_FLAGS_DISABLE_WEBRTC_NAME,
423 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05424 kOsAndroid,
425#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16426 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05427#else
428 SINGLE_VALUE_TYPE("")
429#endif
430 },
[email protected]34cb5292013-04-15 06:06:31431#if defined(OS_ANDROID)
432 {
433 "enable-webaudio",
434 IDS_FLAGS_ENABLE_WEBAUDIO_NAME,
435 IDS_FLAGS_ENABLE_WEBAUDIO_DESCRIPTION,
436 kOsAndroid,
437 SINGLE_VALUE_TYPE(switches::kEnableWebAudio)
438 },
439#endif
[email protected]d9da9582013-01-31 04:59:05440 {
[email protected]96bcdc102012-05-24 23:42:10441 "fixed-position-creates-stacking-context",
442 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
443 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
444 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44445 ENABLE_DISABLE_VALUE_TYPE(
446 switches::kEnableFixedPositionCreatesStackingContext,
447 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10448 },
[email protected]fb854192013-02-06 01:30:04449 {
450 "enable-compositing-for-fixed-position",
451 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
452 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
453 kOsAll,
454 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
455 },
[email protected]a7640ef22012-10-06 00:52:08456 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53457 {
[email protected]e3791ce92011-08-09 01:03:32458 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40459 IDS_FLAGS_ENABLE_NACL_NAME,
460 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56461 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19462 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40463 },
464 {
[email protected]9addd1c2012-09-15 14:28:24465 "enable-nacl-debug", // FLAGS:RECORD_UMA
466 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
467 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56468 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24469 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13470 },
471 {
[email protected]66f409c2012-10-04 20:59:04472 "nacl-debug-mask", // FLAGS:RECORD_UMA
473 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
474 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56475 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04476 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
477 },
478 {
[email protected]7babd1c2012-08-08 20:35:29479 "enable-pnacl", // FLAGS:RECORD_UMA
480 IDS_FLAGS_ENABLE_PNACL_NAME,
481 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56482 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29483 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
484 },
485 {
[email protected]4bc5050c2010-11-18 17:55:54486 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32487 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
488 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56489 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19490 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32491 },
[email protected]3627b06d2010-11-12 16:36:16492 {
[email protected]ac2e2acd2013-03-21 12:57:29493 "extensions-on-chrome-urls",
494 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
495 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
496 kOsAll,
497 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
498 },
499 {
[email protected]e9cddd52013-03-23 17:37:53500 "enable-adview",
501 IDS_FLAGS_ENABLE_ADVIEW_NAME,
502 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
503 kOsDesktop,
504 SINGLE_VALUE_TYPE(switches::kEnableAdview)
505 },
506 {
507 "enable-adview-src-attribute",
508 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
509 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
510 kOsDesktop,
511 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
512 },
513 {
[email protected]544471a2012-10-13 05:27:09514 "action-box",
[email protected]cab18ef2012-04-27 07:22:03515 IDS_FLAGS_ACTION_BOX_NAME,
516 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56517 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44518 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
519 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03520 },
521 {
[email protected]3a362432012-06-18 20:39:51522 "script-badges",
523 IDS_FLAGS_SCRIPT_BADGES_NAME,
524 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56525 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09526 SINGLE_VALUE_TYPE(switches::kScriptBadges)
527 },
528 {
529 "script-bubble",
530 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
531 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56532 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44533 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
534 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51535 },
536 {
[email protected]cbe224d2011-08-04 22:12:49537 "apps-new-install-bubble",
538 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
539 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56540 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49541 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
542 },
543 {
[email protected]80bd24e2010-11-30 09:34:38544 "disable-hyperlink-auditing",
545 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
546 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
547 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19548 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51549 },
550 {
551 "experimental-location-features", // FLAGS:RECORD_UMA
552 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
553 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
554 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19555 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
556 },
557 {
[email protected]5aea1862011-03-23 23:55:39558 "tab-groups-context-menu",
559 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
560 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
561 kOsWin,
562 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
563 },
[email protected]c94cebd2012-06-21 00:55:28564 {
565 "enable-instant-extended-api",
566 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
567 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56568 kOsDesktop,
[email protected]73444382013-02-26 19:31:51569 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
570 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28571 },
[email protected]e9bf9d92011-03-31 20:57:15572 {
[email protected]8cc9e532013-05-06 21:01:47573 "enable-local-first-load-ntp",
574 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP,
575 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP_DESCRIPTION,
576 kOsDesktop,
577 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalFirstLoadNTP,
578 switches::kDisableLocalFirstLoadNTP)
579 },
580 {
[email protected]07fd48a2013-04-13 02:53:27581 "enable-local-only-instant-extended-api",
582 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
583 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
584 kOsDesktop,
585 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
586 switches::kDisableLocalOnlyInstantExtendedAPI)
587 },
588 {
[email protected]354e33b2011-06-15 00:29:10589 "static-ip-config",
590 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
591 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
592 kOsCrOS,
593#if defined(OS_CHROMEOS)
594 // This switch exists only on Chrome OS.
[email protected]2f2d6c32013-05-10 02:56:24595 SINGLE_VALUE_TYPE(chromeos::switches::kEnableStaticIPConfig)
[email protected]354e33b2011-06-15 00:29:10596#else
597 SINGLE_VALUE_TYPE("")
598#endif
599 },
[email protected]3eb5728c2011-06-20 22:32:24600 {
601 "show-autofill-type-predictions",
602 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
603 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
604 kOsAll,
[email protected]e217c5632013-04-12 19:11:48605 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24606 },
[email protected]bff4d3e2011-06-21 23:58:52607 {
[email protected]a5e9faa2013-03-19 09:58:38608 "enable-sync-favicons",
609 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
610 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55611 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38612 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55613 },
614 {
[email protected]5d90a0a2012-11-15 02:43:40615 "sync-keystore-encryption",
616 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
617 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
618 kOsAll,
619 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
620 },
621 {
[email protected]e755a382012-09-13 17:16:35622 "enable-gesture-tap-highlight",
623 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
624 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
625 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47626 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
627 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35628 },
629 {
[email protected]a22ebd812011-06-23 00:05:39630 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
631 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
632 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
633 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40634 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25635 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39636 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
637 },
[email protected]81a6b0b2011-06-24 17:55:40638 {
[email protected]128dc6c2012-06-22 20:30:35639 "omnibox-history-quick-provider-reorder-for-inlining",
640 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
641 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
642 kOsAll,
643 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
644 },
645 {
[email protected]032d5e6c2012-02-17 17:53:55646 "omnibox-inline-history-quick-provider",
647 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
648 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
649 kOsAll,
650 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
651 },
652 {
[email protected]7e7a28092011-12-09 22:24:55653 "enable-panels",
654 IDS_FLAGS_ENABLE_PANELS_NAME,
655 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56656 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55657 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54658 },
[email protected]e3749d12011-07-25 22:22:12659 {
[email protected]27c14f02012-06-22 17:29:58660 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27661 "save-page-as-mhtml", // FLAGS:RECORD_UMA
662 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
663 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
664 kOsMac | kOsWin | kOsLinux,
665 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
666 },
667 {
[email protected]b7bb44f2011-09-01 05:17:03668 "enable-autologin",
669 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
670 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
671 kOsMac | kOsWin | kOsLinux,
672 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
673 },
[email protected]b9841172011-09-26 23:36:09674 {
[email protected]18cf89d2013-04-12 02:42:32675 "enable-spdy4a1",
676 IDS_FLAGS_ENABLE_SPDY4A1_NAME,
677 IDS_FLAGS_ENABLE_SPDY4A1_DESCRIPTION,
678 kOsAll,
679 SINGLE_VALUE_TYPE(switches::kEnableSpdy4a1)
680 },
681 {
[email protected]27b3fe92012-03-21 05:35:06682 "enable-async-dns",
683 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
684 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46685 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44686 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
687 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06688 },
689 {
[email protected]1eb93802012-09-11 18:57:56690 "disable-media-source",
[email protected]5bf1223a52013-05-14 21:42:31691 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_NAME,
692 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32693 kOsAll,
[email protected]5bf1223a52013-05-14 21:42:31694 SINGLE_VALUE_TYPE(switches::kDisableWebKitMediaSource)
[email protected]6aa03b32011-10-27 21:44:44695 },
[email protected]e4e68dbb2011-11-18 01:50:22696 {
[email protected]36d98412013-01-31 20:28:53697 "disable-encrypted-media",
698 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
699 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56700 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53701 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03702 },
[email protected]f88628792012-12-18 07:07:50703 {
704 "enable-opus-playback",
705 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
706 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56707 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50708 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
709 },
[email protected]ca6eaa5a2013-01-24 16:16:04710 {
[email protected]c54e1aa2013-01-25 09:26:17711 "enable-vp9-playback",
712 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
713 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
714 kOsDesktop,
715 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
716 },
717 {
[email protected]6ac955b2013-04-19 23:43:32718 "enable-vp8-alpha-playback",
719 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME,
720 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION,
721 kOsDesktop,
722 SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback)
723 },
724 {
[email protected]ca6eaa5a2013-01-24 16:16:04725 "enable-managed-users",
726 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
727 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58728 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04729 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
730 },
[email protected]dc04be7c2012-03-15 23:57:49731#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50732 {
[email protected]2a13a9a2013-04-19 04:00:21733 "ash-disable-auto-maximizing",
734 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
735 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
736 kOsWin | kOsLinux | kOsCrOS,
737 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
738 },
739 {
[email protected]cda278d2012-10-30 20:31:40740 "ash-disable-auto-window-placement",
741 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
742 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
743 kOsWin | kOsLinux | kOsCrOS,
744 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
745 },
[email protected]b4e4ec42012-11-29 21:42:40746 {
[email protected]16f55a22013-02-13 23:47:34747 "ash-disable-per-app-launcher",
748 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
749 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40750 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34751 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40752 },
[email protected]dc04be7c2012-03-15 23:57:49753#endif
[email protected]eaae8b462012-01-20 22:20:39754 {
[email protected]db543d322011-12-15 20:40:15755 "per-tile-painting",
756 IDS_FLAGS_PER_TILE_PAINTING_NAME,
757 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37758 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37759 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15760 },
[email protected]bf88c032011-12-22 19:05:47761 {
762 "enable-javascript-harmony",
763 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
764 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
765 kOsAll,
766 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
767 },
[email protected]7e7f378a2012-01-05 14:35:37768 {
[email protected]85646172012-01-09 22:45:54769 "enable-tab-browser-dragging",
770 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
771 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
772 kOsWin,
773 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
774 },
775 {
[email protected]068b7b52012-02-27 12:41:44776 "disable-restore-session-state",
777 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
778 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37779 kOsAll,
[email protected]068b7b52012-02-27 12:41:44780 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37781 },
[email protected]88864db2012-01-18 20:56:35782 {
783 "disable-software-rasterizer",
784 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
785 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
786#if defined(ENABLE_SWIFTSHADER)
787 kOsAll,
788#else
789 0,
790#endif
791 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
792 },
[email protected]15a5d722012-01-23 09:11:14793 {
[email protected]ff7b6dd2012-09-15 20:20:03794 "enable-experimental-webkit-features",
795 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
796 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16797 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03798 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49799 },
800 {
[email protected]0f95a252012-09-13 22:30:04801 "enable-css-shaders",
802 IDS_FLAGS_CSS_SHADERS_NAME,
803 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
804 kOsAll,
805 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
806 },
807 {
[email protected]9860c68b2012-02-02 01:58:09808 "enable-extension-activity-ui",
809 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
810 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56811 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09812 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00813 },
[email protected]54ae4e92012-02-16 15:19:05814 {
[email protected]3e8befc2012-03-13 01:17:03815 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16816 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
817 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56818 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03819 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16820 },
[email protected]dc04be7c2012-03-15 23:57:49821#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01822 {
[email protected]3cd198a22012-03-12 20:38:01823 "enable-ash-oak",
824 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
825 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
826 kOsAll,
827 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
828 },
[email protected]31cf1c52012-02-29 20:55:01829#endif
[email protected]184ec592012-03-01 11:54:28830 {
831 "enable-devtools-experiments",
832 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
833 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56834 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28835 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
836 },
[email protected]76d1854e2012-03-02 23:57:44837 {
[email protected]2fefdb32013-02-26 14:28:10838 "silent-debugger-extension-api",
839 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
840 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
841 kOsDesktop,
842 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
843 },
844 {
[email protected]76d1854e2012-03-02 23:57:44845 "enable-suggestions-ntp",
846 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
847 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56848 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44849 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
850 },
[email protected]a3d54252012-04-05 20:04:13851 {
[email protected]1dbaf5e2012-11-30 05:51:32852 "spellcheck-autocorrect",
853 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
854 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
855 kOsWin | kOsLinux | kOsCrOS,
856 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
857 },
858 {
[email protected]d7932532012-11-21 21:10:31859 "touch-events",
860 IDS_TOUCH_EVENTS_NAME,
861 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56862 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31863 MULTI_VALUE_TYPE(kTouchEventsChoices)
864 },
865 {
[email protected]c9c73ad42012-04-18 03:35:59866 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06867 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
868 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55869 kOsWin,
[email protected]347a0c72012-05-14 20:28:06870 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59871 },
[email protected]8a6aaa72012-04-20 20:53:58872 {
[email protected]b9c96ff2012-11-26 22:24:40873 "disable-touch-adjustment",
874 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
875 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
876 kOsWin | kOsLinux | kOsCrOS,
877 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
878 },
879 {
[email protected]0b9383a2012-10-26 00:58:16880 "enable-tab-capture",
881 IDS_ENABLE_TAB_CAPTURE_NAME,
882 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25883 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44884 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
885 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16886 },
[email protected]0b60afa2012-04-19 17:36:39887#if defined(OS_CHROMEOS)
888 {
[email protected]7c4a9bc2012-09-11 22:10:05889 "enable-background-loader",
890 IDS_ENABLE_BACKLOADER_NAME,
891 IDS_ENABLE_BACKLOADER_DESCRIPTION,
892 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24893 SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader)
[email protected]7c4a9bc2012-09-11 22:10:05894 },
895 {
[email protected]c5667b282012-08-31 00:32:50896 "enable-bezel-touch",
897 IDS_ENABLE_BEZEL_TOUCH_NAME,
898 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47899 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50900 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47901 },
902 {
[email protected]3f4181a2013-02-01 21:31:07903 "enable-screensaver-extension",
904 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
905 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
906 kOsCrOS,
907 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
908 },
909 {
[email protected]0b60afa2012-04-19 17:36:39910 "no-discard-tabs",
911 IDS_FLAGS_NO_DISCARD_TABS_NAME,
912 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
913 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24914 SINGLE_VALUE_TYPE(chromeos::switches::kNoDiscardTabs)
[email protected]0b60afa2012-04-19 17:36:39915 },
916#endif
[email protected]79be6d32012-04-24 20:47:44917 {
[email protected]8d68a3e02013-01-12 15:57:10918 "enable-download-resumption",
919 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
920 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56921 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10922 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
923 },
924 {
[email protected]9a5940d2012-04-27 19:16:23925 "allow-nacl-socket-api",
926 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
927 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56928 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23929 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
930 },
[email protected]85333732012-05-01 19:02:24931 {
[email protected]60673ad72012-05-02 06:16:33932 "stacked-tab-strip",
933 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
934 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
935 kOsWin,
936 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
937 },
938 {
[email protected]4bd20202012-06-14 17:35:01939 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24940 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
941 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
942 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01943 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24944 },
[email protected]190349fd2012-05-02 00:10:47945#if defined(OS_CHROMEOS)
946 {
947 "allow-touchpad-three-finger-click",
948 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
949 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
950 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24951 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
[email protected]190349fd2012-05-02 00:10:47952 },
[email protected]fbc176b62012-10-27 02:19:58953 {
954 "allow-touchpad-three-finger-swipe",
955 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
956 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
957 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24958 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerSwipe)
[email protected]fbc176b62012-10-27 02:19:58959 },
[email protected]190349fd2012-05-02 00:10:47960#endif
[email protected]1992a2f42012-10-23 18:32:21961 {
[email protected]a585e462013-01-26 00:37:15962 "use-client-login-signin-flow",
963 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
964 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21965 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15966 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21967 },
[email protected]8ee02242012-12-04 15:23:32968 {
969 "enable-desktop-guest-mode",
970 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
971 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
972 kOsMac | kOsWin | kOsLinux,
973 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
974 },
[email protected]53520b1b2012-05-07 21:43:37975#if defined(USE_ASH)
976 {
[email protected]8257d382013-03-26 13:08:42977 "show-launcher-alignment-menu",
978 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
979 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42980 kOsAll,
[email protected]8257d382013-03-26 13:08:42981 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42982 },
983 {
[email protected]2ddf37b2013-04-20 01:15:58984 "disable-minimize-on-second-launcher-item-click",
985 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
986 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
987 kOsAll,
988 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
989 },
990 {
[email protected]73074742012-05-17 01:44:41991 "show-touch-hud",
992 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
993 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
994 kOsAll,
995 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
996 },
997 {
[email protected]9f0940b62012-05-23 22:56:35998 "enable-pinch",
999 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
1000 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:061001 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:381002 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
1003 },
1004 {
1005 "pinch-zoom-scrollbars",
1006 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
1007 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
1008 kOsCrOS,
1009 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
1010 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:351011 },
[email protected]a8379312012-06-15 00:20:431012 {
1013 "app-list-show-apps-only",
1014 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
1015 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
1016 kOsAll,
[email protected]0bc6c272012-07-17 03:32:031017 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:431018 },
[email protected]a4016f12013-05-02 07:53:471019 {
1020 "forced-maximize-mode",
1021 IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME,
1022 IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION,
1023 kOsLinux | kOsWin | kOsCrOS,
1024 SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode),
1025 },
[email protected]73074742012-05-17 01:44:411026#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281027#if defined(OS_CHROMEOS)
1028 {
[email protected]8b04a1652012-08-04 02:59:491029 "disable-boot-animation",
1030 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1031 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581032 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241033 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:491034 },
[email protected]95058572012-08-20 14:57:291035 {
[email protected]b4557192012-09-19 11:29:581036 "disable-boot-animation2",
1037 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1038 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581039 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581040 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1041 },
1042 {
[email protected]ea2f3342012-09-21 21:13:361043 "boot-animation-fucntion",
1044 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1045 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581046 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361047 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1048 },
[email protected]839667d62012-10-23 19:38:571049 {
[email protected]d96aef22012-10-30 11:47:021050 "captive-portal-detector",
1051 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1052 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581053 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021054 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1055 },
1056 {
[email protected]c11aa8f12012-12-18 18:43:141057 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571058 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1059 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1060 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141061 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571062 },
[email protected]f0280952012-11-06 20:30:501063 {
[email protected]ea2fab32013-04-16 06:55:021064 "file-manager-legacy",
1065 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1066 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231067 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241068 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231069 },
[email protected]3e035e82012-11-27 20:54:321070 {
[email protected]828d99052013-04-22 08:15:031071 "file-manager-legacy-ui",
1072 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_NAME,
1073 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_DESCRIPTION,
[email protected]bc545292013-04-18 14:33:101074 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241075 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacyUI),
[email protected]bc545292013-04-18 14:33:101076 },
1077 {
[email protected]c64d7732013-03-25 18:09:501078 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521079 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1080 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581081 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241082 SINGLE_VALUE_TYPE(chromeos::switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471083 },
[email protected]6ad015c2013-03-06 00:49:511084 {
[email protected]c64d7732013-03-25 18:09:501085 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521086 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1087 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511088 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521089 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511090 },
[email protected]099b890c2013-04-25 19:16:261091 {
1092 "disable-quickoffice-component-app",
1093 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
1094 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
1095 kOsCrOS,
1096 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp),
1097 },
[email protected]62018dc2012-12-13 00:37:351098#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391099 {
[email protected]6247aba2013-03-04 22:57:181100 "views-textfield",
1101 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1102 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391103 kOsWin,
[email protected]6247aba2013-03-04 22:57:181104 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1105 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391106 },
[email protected]bd0cd3bb2012-06-14 03:03:381107 {
[email protected]ffbe5782013-05-09 23:22:081108 "new-dialog-style",
1109 IDS_FLAGS_NEW_DIALOG_STYLE_NAME,
1110 IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321111 kOsWin | kOsCrOS,
[email protected]ffbe5782013-05-09 23:22:081112 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle,
1113 switches::kDisableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321114 },
[email protected]7db8893a2012-07-26 00:49:401115 { "disable-accelerated-video-decode",
1116 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1117 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191118 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401119 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151120 },
[email protected]66ae9fc2012-06-19 21:33:521121#if defined(USE_ASH)
1122 {
1123 "ash-debug-shortcuts",
1124 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1125 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1126 kOsAll,
1127 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1128 },
1129#endif
[email protected]37fee0942012-08-07 21:07:451130 {
[email protected]ad3f6d22012-08-29 02:34:191131 "enable-contacts",
1132 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1133 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1134 kOsCrOS,
1135 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1136 },
[email protected]1d9bb9cd2012-08-28 22:02:501137#if defined(USE_ASH)
1138 { "ash-enable-advanced-gestures",
1139 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1140 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1141 kOsCrOS,
1142 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1143 },
[email protected]cfa24e62013-02-13 21:19:111144 { "ash-disable-tab-scrubbing",
1145 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1146 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161147 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111148 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161149 },
[email protected]00c8469e22013-05-08 21:40:081150 { "ash-drag-and-drop-applist-to-launcher",
1151 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME,
1152 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION,
1153 kOsCrOS,
1154 SINGLE_VALUE_TYPE(ash::switches::kAshDragAndDropAppListToLauncher),
1155 },
[email protected]83eef802012-12-02 07:43:521156 { "ash-enable-workspace-scrubbing",
1157 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1158 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1159 kOsCrOS,
1160 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1161 },
[email protected]cf2b1a82013-04-20 01:05:431162 { "ash-immersive-fullscreen-2",
[email protected]819e58d22013-03-20 00:16:111163 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1164 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241165 kOsCrOS,
[email protected]cf2b1a82013-04-20 01:05:431166 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen,
1167 ash::switches::kAshDisableImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241168 },
[email protected]316708a2012-11-05 22:57:021169#if defined(OS_LINUX)
1170 { "ash-enable-memory-monitor",
1171 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1172 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1173 kOsCrOS,
1174 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1175 },
1176#endif
[email protected]1d9bb9cd2012-08-28 22:02:501177#endif
[email protected]9b7ab882012-09-10 23:46:361178#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091179 { "ash-disable-new-network-status-area",
1180 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1181 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461182 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091183 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461184 },
[email protected]9b7ab882012-09-10 23:46:361185 {
[email protected]354ff2d2013-05-01 17:06:311186 "ash-enable-new-audio-handler2",
[email protected]db5be732013-04-24 05:21:121187 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME,
1188 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_DESCRIPTION,
1189 kOsCrOS,
[email protected]354ff2d2013-05-01 17:06:311190 ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableNewAudioHandler)
1191 },
1192 {
1193 "ash-audio-device-menu",
1194 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME,
1195 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION,
1196 kOsCrOS,
1197 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu)
[email protected]db5be732013-04-24 05:21:121198 },
1199 {
[email protected]205f07892012-10-16 20:26:221200 "enable-carrier-switching",
1201 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1202 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1203 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241204 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221205 },
1206 {
[email protected]9b7ab882012-09-10 23:46:361207 "enable-request-tablet-site",
1208 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1209 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1210 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241211 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361212 },
1213#endif
[email protected]dab49c0b2012-10-04 05:55:351214 {
1215 "debug-packed-apps",
1216 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1217 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561218 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351219 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1220 },
[email protected]d1459ed2012-10-10 01:29:331221 {
1222 "enable-password-generation",
1223 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1224 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561225 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331226 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1227 },
[email protected]26d045f2012-10-18 21:18:431228 {
[email protected]76f7d4882012-10-26 21:09:221229 "enable-deferred-image-decoding",
1230 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1231 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221232 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221233 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1234 },
1235 {
[email protected]075543d2012-10-24 01:29:141236 "performance-monitor-gathering",
1237 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1238 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1239 kOsAll,
1240 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1241 },
[email protected]783d5bb2012-10-24 03:47:141242 {
[email protected]90b482d2013-04-04 10:45:581243 "disable-native-autofill-ui",
1244 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1245 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431246 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581247 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431248 },
1249 {
[email protected]a7259fb2012-11-08 06:22:231250 "enable-experimental-form-filling",
1251 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1252 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1253 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481254 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231255 },
[email protected]6e6efe42013-01-30 00:04:501256 {
[email protected]db3178c2013-03-21 14:54:541257 "wallet-service-use-prod",
1258 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1259 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1260 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481261 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541262 },
1263 {
[email protected]6e6efe42013-01-30 00:04:501264 "enable-interactive-autocomplete",
1265 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1266 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221267 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501268 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1269 },
[email protected]177260c2013-04-24 01:47:381270#if defined(USE_AURA)
1271 {
1272 "overscroll-history-navigation",
1273 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1274 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1275 kOsAll,
1276 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1277 switches::kOverscrollHistoryNavigation, "1",
1278 switches::kOverscrollHistoryNavigation, "0")
1279 },
1280#endif
[email protected]edbea622012-11-28 20:39:381281 {
1282 "enable-touch-drag-drop",
1283 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1284 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1285 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271286 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1287 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381288 },
[email protected]0e2f43b62013-02-21 00:47:151289 {
1290 "enable-touch-editing",
1291 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1292 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1293 kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271294 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1295 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151296 },
[email protected]92e12dd92012-12-11 03:33:201297 {
1298 "enable-rich-notifications",
1299 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1300 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
[email protected]ed4004b52013-05-07 13:25:001301 kOsWin | kOsCrOS | kOsMac,
[email protected]aee412aa2013-04-02 20:01:231302 ENABLE_DISABLE_VALUE_TYPE(
1303 message_center::switches::kEnableRichNotifications,
1304 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201305 },
[email protected]4d51c682012-12-11 11:34:551306 {
[email protected]ddec1aa2013-04-28 23:22:451307 "enable-sync-synced-notifications",
1308 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1309 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
1310 kOsWin | kOsCrOS,
1311 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1312 switches::kDisableSyncSyncedNotifications)
1313 },
1314 {
[email protected]a50e16a2013-04-25 14:07:171315 "disable-full-history-sync",
[email protected]4d51c682012-12-11 11:34:551316 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1317 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1318 kOsAll,
[email protected]a50e16a2013-04-25 14:07:171319 SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync)
[email protected]4d51c682012-12-11 11:34:551320 },
[email protected]628a69a92012-12-23 04:09:341321 {
[email protected]fd030142013-02-08 02:04:381322 "enable-usermedia-screen-capture",
1323 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1324 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1325 kOsDesktop,
1326 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1327 },
[email protected]5b93e162013-02-19 06:33:091328 {
1329 "enable-apps-devtool-app",
1330 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1331 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1332 kOsDesktop,
1333 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1334 },
[email protected]9323fdd12013-02-23 00:31:361335 {
1336 "impl-side-painting",
1337 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1338 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041339 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361340 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1341 },
[email protected]a42c85f2013-04-04 18:15:121342 {
[email protected]1c92d3e2013-04-18 05:31:391343 "enable-websocket-experimental-implementation",
1344 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1345 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1346 kOsAll,
1347 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1348 },
1349 {
[email protected]a42c85f2013-04-04 18:15:121350 "max-tiles-for-interest-area",
1351 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1352 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1353 kOsAndroid | kOsLinux | kOsCrOS,
1354 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1355 },
[email protected]7cf7ccb2013-04-20 02:53:081356 {
1357 "enable-offline-mode",
1358 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME,
1359 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION,
1360 kOsAll,
1361 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess)
1362 },
[email protected]a3618122013-04-26 21:15:341363 {
1364 "default-tile-width",
1365 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1366 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1367 kOsAll,
1368 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1369 },
1370 {
1371 "default-tile-height",
1372 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1373 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1374 kOsAll,
1375 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1376 },
[email protected]2f2f72b2013-03-08 22:37:311377 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1378#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371379 {
1380 "track-active-visit-time",
1381 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1382 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1383 kOsWin,
1384 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1385 },
[email protected]2f2f72b2013-03-08 22:37:311386#endif
[email protected]8cc71d42013-03-02 17:26:081387#if defined(OS_ANDROID)
1388 {
1389 "disable-gesture-requirement-for-media-playback",
1390 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1391 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1392 kOsAndroid,
1393 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1394 },
1395#endif
[email protected]e79f2fd52013-03-08 23:52:471396#if defined(OS_CHROMEOS)
1397 {
1398 "enable-experimental-bluetooth",
1399 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1400 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1401 kOsCrOS,
1402 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1403 },
1404#endif
[email protected]6077cab2013-03-11 19:36:141405#if defined(ENABLE_GOOGLE_NOW)
1406 {
1407 "enable-google-now",
1408 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1409 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1410 kOsWin | kOsCrOS,
1411 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1412 },
1413#endif
[email protected]4a9e2e02013-04-08 16:19:491414 {
1415 "enable-translate-alpha-languages",
1416 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1417 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1418 kOsAll,
1419 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1420 },
[email protected]86459e2c2013-04-10 13:39:241421#if defined(OS_CHROMEOS)
1422 {
1423 "enable-virtual-keyboard",
1424 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1425 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1426 kOsCrOS,
1427 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1428 },
1429#endif
[email protected]38484df12013-04-10 16:42:031430 {
1431 "enable-simple-cache-backend",
1432 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1433 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1434 kOsAndroid,
1435 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1436 },
[email protected]717e4e22013-04-10 20:52:231437 {
1438 "enable-tcp-fast-open",
1439 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1440 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111441 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231442 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1443 },
[email protected]8027acd2013-04-18 08:35:151444 {
1445 "enable-webp-in-accept-header",
1446 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1447 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1448 kOsAll,
1449 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1450 },
[email protected]58c740f2013-05-06 05:25:441451 {
1452 "apps-use-native-frame",
1453 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME,
1454 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION,
1455 kOsWin,
1456 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame)
1457 },
[email protected]896d86b32013-05-09 19:36:441458 {
1459 "enable-syncfs-directory-operation",
1460 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME,
1461 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION,
1462 kOsAll,
1463 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
1464 },
[email protected]a0e4b072011-08-17 01:47:071465};
[email protected]ad2a3ded2010-08-27 13:19:051466
[email protected]a314ee5a2010-10-26 21:23:281467const Experiment* experiments = kExperiments;
1468size_t num_experiments = arraysize(kExperiments);
1469
[email protected]e2ddbc92010-10-15 20:02:071470// Stores and encapsulates the little state that about:flags has.
1471class FlagsState {
1472 public:
1473 FlagsState() : needs_restart_(false) {}
1474 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1475 bool IsRestartNeededToCommitChanges();
1476 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281477 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071478 void RemoveFlagsSwitches(
1479 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001480 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071481 void reset();
1482
1483 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551484 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071485 return Singleton<FlagsState>::get();
1486 }
1487
1488 private:
1489 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531490 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071491
1492 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1493};
1494
[email protected]c7b7800a2010-10-07 18:51:351495// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491496// in a set.
[email protected]1a47d7e2010-10-15 00:37:241497void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051498 const ListValue* enabled_experiments = prefs->GetList(
1499 prefs::kEnabledLabsExperiments);
1500 if (!enabled_experiments)
1501 return;
1502
1503 for (ListValue::const_iterator it = enabled_experiments->begin();
1504 it != enabled_experiments->end();
1505 ++it) {
1506 std::string experiment_name;
1507 if (!(*it)->GetAsString(&experiment_name)) {
1508 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1509 continue;
1510 }
1511 result->insert(experiment_name);
1512 }
1513}
1514
[email protected]c6343372013-03-13 17:05:491515// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241516void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051517 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381518 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1519 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051520
1521 experiments_list->Clear();
1522 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1523 it != enabled_experiments.end();
1524 ++it) {
1525 experiments_list->Append(new StringValue(*it));
1526 }
1527}
1528
[email protected]8a6ff28d2010-12-02 16:35:191529// Adds the internal names for the specified experiment to |names|.
1530void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1531 if (e.type == Experiment::SINGLE_VALUE) {
1532 names->insert(e.internal_name);
1533 } else {
[email protected]83e9fa702013-02-25 19:30:441534 DCHECK(e.type == Experiment::MULTI_VALUE ||
1535 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191536 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441537 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191538 }
1539}
1540
[email protected]28e35af2011-02-09 12:56:221541// Confirms that an experiment is valid, used in a DCHECK in
1542// SanitizeList below.
1543bool ValidateExperiment(const Experiment& e) {
1544 switch (e.type) {
1545 case Experiment::SINGLE_VALUE:
1546 DCHECK_EQ(0, e.num_choices);
1547 DCHECK(!e.choices);
1548 break;
1549 case Experiment::MULTI_VALUE:
1550 DCHECK_GT(e.num_choices, 0);
1551 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531552 DCHECK(e.choices[0].command_line_switch);
1553 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221554 break;
[email protected]83e9fa702013-02-25 19:30:441555 case Experiment::ENABLE_DISABLE_VALUE:
1556 DCHECK_EQ(3, e.num_choices);
1557 DCHECK(!e.choices);
1558 DCHECK(e.command_line_switch);
1559 DCHECK(e.command_line_value);
1560 DCHECK(e.disable_command_line_switch);
1561 DCHECK(e.disable_command_line_value);
1562 break;
[email protected]28e35af2011-02-09 12:56:221563 default:
1564 NOTREACHED();
1565 }
1566 return true;
1567}
1568
[email protected]ad2a3ded2010-08-27 13:19:051569// Removes all experiments from prefs::kEnabledLabsExperiments that are
1570// unknown, to prevent this list to become very long as experiments are added
1571// and removed.
1572void SanitizeList(PrefService* prefs) {
1573 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221574 for (size_t i = 0; i < num_experiments; ++i) {
1575 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191576 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221577 }
[email protected]ad2a3ded2010-08-27 13:19:051578
1579 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241580 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051581
1582 std::set<std::string> new_enabled_experiments;
1583 std::set_intersection(
1584 known_experiments.begin(), known_experiments.end(),
1585 enabled_experiments.begin(), enabled_experiments.end(),
1586 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1587
[email protected]4c8853f2012-07-23 01:29:161588 if (new_enabled_experiments != enabled_experiments)
1589 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051590}
1591
[email protected]1a47d7e2010-10-15 00:37:241592void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051593 PrefService* prefs, std::set<std::string>* result) {
1594 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241595 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051596}
1597
[email protected]a314ee5a2010-10-26 21:23:281598// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1599// enabled on the current platform.
1600void GetSanitizedEnabledFlagsForCurrentPlatform(
1601 PrefService* prefs, std::set<std::string>* result) {
1602 GetSanitizedEnabledFlags(prefs, result);
1603
1604 // Filter out any experiments that aren't enabled on the current platform. We
1605 // don't remove these from prefs else syncing to a platform with a different
1606 // set of experiments would be lossy.
1607 std::set<std::string> platform_experiments;
1608 int current_platform = GetCurrentPlatform();
1609 for (size_t i = 0; i < num_experiments; ++i) {
1610 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191611 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581612#if defined(OS_CHROMEOS)
1613 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1614 AddInternalName(experiments[i], &platform_experiments);
1615#endif
[email protected]a314ee5a2010-10-26 21:23:281616 }
1617
1618 std::set<std::string> new_enabled_experiments;
1619 std::set_intersection(
1620 platform_experiments.begin(), platform_experiments.end(),
1621 result->begin(), result->end(),
1622 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1623
1624 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051625}
1626
[email protected]8a6ff28d2010-12-02 16:35:191627// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191628Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221629 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441630 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1631 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191632 ListValue* result = new ListValue;
1633 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191634 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441635 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191636 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441637 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221638 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191639 result->Append(value);
1640 }
1641 return result;
1642}
1643
[email protected]e2ddbc92010-10-15 20:02:071644} // namespace
1645
[email protected]83e9fa702013-02-25 19:30:441646std::string Experiment::NameForChoice(int index) const {
1647 DCHECK(type == Experiment::MULTI_VALUE ||
1648 type == Experiment::ENABLE_DISABLE_VALUE);
1649 DCHECK_LT(index, num_choices);
1650 return std::string(internal_name) + testing::kMultiSeparator +
1651 base::IntToString(index);
1652}
1653
1654string16 Experiment::DescriptionForChoice(int index) const {
1655 DCHECK(type == Experiment::MULTI_VALUE ||
1656 type == Experiment::ENABLE_DISABLE_VALUE);
1657 DCHECK_LT(index, num_choices);
1658 int description_id;
1659 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1660 const int kEnableDisableDescriptionIds[] = {
1661 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1662 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1663 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1664 };
1665 description_id = kEnableDisableDescriptionIds[index];
1666 } else {
1667 description_id = choices[index].description_id;
1668 }
1669 return l10n_util::GetStringUTF16(description_id);
1670}
1671
[email protected]1a47d7e2010-10-15 00:37:241672void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551673 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051674}
1675
[email protected]37736bd2013-04-18 11:53:581676ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051677 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241678 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051679
1680 int current_platform = GetCurrentPlatform();
1681
1682 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281683 for (size_t i = 0; i < num_experiments; ++i) {
1684 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051685
1686 DictionaryValue* data = new DictionaryValue();
1687 data->SetString("internal_name", experiment.internal_name);
1688 data->SetString("name",
1689 l10n_util::GetStringUTF16(experiment.visible_name_id));
1690 data->SetString("description",
1691 l10n_util::GetStringUTF16(
1692 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581693 bool supported = (experiment.supported_platforms & current_platform) != 0;
1694#if defined(OS_CHROMEOS)
1695 if (access == kOwnerAccessToFlags &&
1696 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1697 supported = true;
1698#endif
[email protected]cc3e2052011-12-20 01:01:401699 data->SetBoolean("supported", supported);
1700
1701 ListValue* supported_platforms = new ListValue();
1702 AddOsStrings(experiment.supported_platforms, supported_platforms);
1703 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051704
[email protected]28e35af2011-02-09 12:56:221705 switch (experiment.type) {
1706 case Experiment::SINGLE_VALUE:
1707 data->SetBoolean(
1708 "enabled",
1709 enabled_experiments.count(experiment.internal_name) > 0);
1710 break;
1711 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441712 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221713 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1714 break;
1715 default:
1716 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191717 }
1718
[email protected]ad2a3ded2010-08-27 13:19:051719 experiments_data->Append(data);
1720 }
1721 return experiments_data;
1722}
1723
[email protected]ad2a3ded2010-08-27 13:19:051724bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551725 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051726}
1727
1728void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351729 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551730 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071731}
1732
1733void RemoveFlagsSwitches(
1734 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551735 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071736}
1737
[email protected]cb93bf52013-02-20 01:20:001738void ResetAllFlags(PrefService* prefs) {
1739 FlagsState::GetInstance()->ResetAllFlags(prefs);
1740}
1741
[email protected]a314ee5a2010-10-26 21:23:281742int GetCurrentPlatform() {
1743#if defined(OS_MACOSX)
1744 return kOsMac;
1745#elif defined(OS_WIN)
1746 return kOsWin;
1747#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1748 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211749#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281750 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401751#elif defined(OS_ANDROID)
1752 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281753#else
1754#error Unknown platform
1755#endif
1756}
1757
[email protected]4bc5050c2010-11-18 17:55:541758void RecordUMAStatistics(const PrefService* prefs) {
1759 std::set<std::string> flags;
1760 GetEnabledFlags(prefs, &flags);
1761 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1762 ++it) {
1763 std::string action("AboutFlags_");
1764 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381765 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541766 }
1767 // Since flag metrics are recorded every startup, add a tick so that the
1768 // stats can be made meaningful.
1769 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381770 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1771 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541772}
1773
[email protected]e2ddbc92010-10-15 20:02:071774//////////////////////////////////////////////////////////////////////////////
1775// FlagsState implementation.
1776
1777namespace {
1778
[email protected]83e9fa702013-02-25 19:30:441779typedef std::map<std::string, std::pair<std::string, std::string> >
1780 NameToSwitchAndValueMap;
1781
1782void SetFlagToSwitchMapping(const std::string& key,
1783 const std::string& switch_name,
1784 const std::string& switch_value,
1785 NameToSwitchAndValueMap* name_to_switch_map) {
1786 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1787 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1788}
1789
[email protected]e2ddbc92010-10-15 20:02:071790void FlagsState::ConvertFlagsToSwitches(
1791 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071792 if (command_line->HasSwitch(switches::kNoExperiments))
1793 return;
1794
1795 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001796
[email protected]a314ee5a2010-10-26 21:23:281797 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071798
[email protected]a82744532011-02-11 16:15:531799 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191800 for (size_t i = 0; i < num_experiments; ++i) {
1801 const Experiment& e = experiments[i];
1802 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441803 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1804 e.command_line_value, &name_to_switch_map);
1805 } else if (e.type == Experiment::MULTI_VALUE) {
1806 for (int j = 0; j < e.num_choices; ++j) {
1807 SetFlagToSwitchMapping(e.NameForChoice(j),
1808 e.choices[j].command_line_switch,
1809 e.choices[j].command_line_value,
1810 &name_to_switch_map);
1811 }
[email protected]8a6ff28d2010-12-02 16:35:191812 } else {
[email protected]83e9fa702013-02-25 19:30:441813 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1814 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1815 &name_to_switch_map);
1816 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1817 e.command_line_value, &name_to_switch_map);
1818 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1819 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191820 }
1821 }
[email protected]e2ddbc92010-10-15 20:02:071822
1823 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531824 flags_switches_.insert(
1825 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1826 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071827 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1828 it != enabled_experiments.end();
1829 ++it) {
1830 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531831 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191832 name_to_switch_map.find(experiment_name);
1833 if (name_to_switch_it == name_to_switch_map.end()) {
1834 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071835 continue;
[email protected]8a6ff28d2010-12-02 16:35:191836 }
[email protected]e2ddbc92010-10-15 20:02:071837
[email protected]a82744532011-02-11 16:15:531838 const std::pair<std::string, std::string>&
1839 switch_and_value_pair = name_to_switch_it->second;
1840
1841 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1842 switch_and_value_pair.second);
1843 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071844 }
1845 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531846 flags_switches_.insert(
1847 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1848 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071849}
1850
1851bool FlagsState::IsRestartNeededToCommitChanges() {
1852 return needs_restart_;
1853}
1854
1855void FlagsState::SetExperimentEnabled(
1856 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441857 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191858 if (at_index != std::string::npos) {
1859 DCHECK(enable);
1860 // We're being asked to enable a multi-choice experiment. Disable the
1861 // currently selected choice.
1862 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221863 const std::string experiment_name = internal_name.substr(0, at_index);
1864 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191865
[email protected]28e35af2011-02-09 12:56:221866 // And enable the new choice, if it is not the default first choice.
1867 if (internal_name != experiment_name + "@0") {
1868 std::set<std::string> enabled_experiments;
1869 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081870 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221871 SetEnabledFlags(prefs, enabled_experiments);
1872 }
[email protected]8a6ff28d2010-12-02 16:35:191873 return;
1874 }
1875
[email protected]ad2a3ded2010-08-27 13:19:051876 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241877 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051878
[email protected]8a6ff28d2010-12-02 16:35:191879 const Experiment* e = NULL;
1880 for (size_t i = 0; i < num_experiments; ++i) {
1881 if (experiments[i].internal_name == internal_name) {
1882 e = experiments + i;
1883 break;
1884 }
1885 }
1886 DCHECK(e);
1887
1888 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591889 if (enable)
[email protected]147492b2013-03-19 23:52:081890 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591891 else
[email protected]147492b2013-03-19 23:52:081892 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191893 } else {
1894 if (enable) {
1895 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081896 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191897 } else {
1898 // Find the currently enabled choice and disable it.
1899 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441900 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191901 if (enabled_experiments.find(choice_name) !=
1902 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081903 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191904 enabled_experiments.erase(choice_name);
1905 // Continue on just in case there's a bug and more than one
1906 // experiment for this choice was enabled.
1907 }
1908 }
1909 }
1910 }
[email protected]ad2a3ded2010-08-27 13:19:051911
[email protected]1a47d7e2010-10-15 00:37:241912 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051913}
1914
[email protected]e2ddbc92010-10-15 20:02:071915void FlagsState::RemoveFlagsSwitches(
1916 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531917 for (std::map<std::string, std::string>::const_iterator
1918 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1919 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071920 }
1921}
1922
[email protected]cb93bf52013-02-20 01:20:001923void FlagsState::ResetAllFlags(PrefService* prefs) {
1924 needs_restart_ = true;
1925
1926 std::set<std::string> no_experiments;
1927 SetEnabledFlags(prefs, no_experiments);
1928}
1929
[email protected]e2ddbc92010-10-15 20:02:071930void FlagsState::reset() {
1931 needs_restart_ = false;
1932 flags_switches_.clear();
1933}
1934
[email protected]38e46812011-05-09 20:49:221935} // namespace
[email protected]e2ddbc92010-10-15 20:02:071936
1937namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191938
1939// WARNING: '@' is also used in the html file. If you update this constant you
1940// also need to update the html file.
1941const char kMultiSeparator[] = "@";
1942
[email protected]e2ddbc92010-10-15 20:02:071943void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551944 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071945}
[email protected]a314ee5a2010-10-26 21:23:281946
1947void SetExperiments(const Experiment* e, size_t count) {
1948 if (!e) {
1949 experiments = kExperiments;
1950 num_experiments = arraysize(kExperiments);
1951 } else {
1952 experiments = e;
1953 num_experiments = count;
1954 }
1955}
1956
[email protected]8a6ff28d2010-12-02 16:35:191957const Experiment* GetExperiments(size_t* count) {
1958 *count = num_experiments;
1959 return experiments;
1960}
1961
[email protected]e2ddbc92010-10-15 20:02:071962} // namespace testing
1963
[email protected]1a47d7e2010-10-15 00:37:241964} // namespace about_flags