blob: 72c4acd93a5b4480e030689bd1ee3f483ee5c2e3 [file] [log] [blame]
[email protected]9c66adc2012-01-05 02:10:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
7#include <algorithm>
8#include <iterator>
9#include <map>
10#include <set>
[email protected]83e9fa702013-02-25 19:30:4411#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0512
[email protected]ad2a3ded2010-08-27 13:19:0513#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1514#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5715#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4116#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0317#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0518#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5219#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3820#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0321#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0522#include "chrome/common/chrome_switches.h"
23#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3824#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0225#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0526#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0227#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0228#include "media/base/media_switches.h"
[email protected]c051a1b2011-01-21 23:30:1729#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5930#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4831#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2732#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2433#include "ui/keyboard/keyboard_switches.h"
[email protected]9a224572013-05-12 23:08:5634#include "ui/message_center/message_center_switches.h"
[email protected]fb1aac14e2013-05-14 05:30:2435#include "ui/surface/surface_switches.h"
[email protected]9a224572013-05-12 23:08:5636
[email protected]dc04be7c2012-03-15 23:57:4937#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3138#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4939#endif
40
[email protected]badba1ad2012-11-16 17:21:4641#if defined(OS_CHROMEOS)
42#include "chromeos/chromeos_switches.h"
43#endif
44
[email protected]7f6f44c2011-12-14 13:23:3845using content::UserMetricsAction;
46
[email protected]1a47d7e2010-10-15 00:37:2447namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0548
[email protected]8a6ff28d2010-12-02 16:35:1949// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5350#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4451 Experiment::SINGLE_VALUE, \
52 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5353#define SINGLE_VALUE_TYPE(command_line_switch) \
54 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4455#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
56 disable_switch, disable_value) \
57 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
58 disable_switch, disable_value, NULL, 3
59#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
60 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5361#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4462 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1963
[email protected]e2ddbc92010-10-15 20:02:0764namespace {
65
[email protected]9c7453d2012-01-21 00:45:4066const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5667const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0568
[email protected]cc3e2052011-12-20 01:01:4069// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
70// whether the experiment is available on that platform.
71void AddOsStrings(unsigned bitmask, ListValue* list) {
72 struct {
73 unsigned bit;
74 const char* const name;
75 } kBitsToOs[] = {
76 {kOsMac, "Mac"},
77 {kOsWin, "Windows"},
78 {kOsLinux, "Linux"},
79 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0180 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:5881 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[email protected]cc3e2052011-12-20 01:01:4082 };
83 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
84 if (bitmask & kBitsToOs[i].bit)
85 list->Append(new StringValue(kBitsToOs[i].name));
86}
87
[email protected]128dc6c2012-06-22 20:30:3588const Experiment::Choice
89 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
90 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
91 "",
92 "" },
93 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
94 switches::kOmniboxHistoryQuickProviderReorderForInlining,
95 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
97 switches::kOmniboxHistoryQuickProviderReorderForInlining,
98 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
99};
100
[email protected]032d5e6c2012-02-17 17:53:55101const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
102 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
103 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
104 switches::kOmniboxInlineHistoryQuickProvider,
105 switches::kOmniboxInlineHistoryQuickProviderAllowed },
106 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
107 switches::kOmniboxInlineHistoryQuickProvider,
108 switches::kOmniboxInlineHistoryQuickProviderProhibited }
109};
110
[email protected]fb854192013-02-06 01:30:04111const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
112 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
113 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
114 switches::kEnableCompositingForFixedPosition, ""},
115 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
116 switches::kDisableCompositingForFixedPosition, ""},
117 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
118 switches::kEnableHighDpiCompositingForFixedPosition, ""}
119};
120
[email protected]d8221b22013-05-23 05:35:43121const Experiment::Choice kEnableCompositingForTransitionChoices[] = {
122 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
123 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
124 switches::kEnableCompositingForTransition, ""},
125 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
126 switches::kDisableCompositingForTransition, ""},
127};
128
[email protected]8b1c3c72013-01-25 01:48:43129const Experiment::Choice kGDIPresentChoices[] = {
130 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
131 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
132 switches::kDoFirstShowPresentWithGDI, ""},
133 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
134 switches::kDoAllShowPresentWithGDI, ""}
135};
136
[email protected]d7932532012-11-21 21:10:31137const Experiment::Choice kTouchEventsChoices[] = {
138 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
139 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
140 switches::kTouchEvents,
141 switches::kTouchEventsEnabled },
142 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
143 switches::kTouchEvents,
144 switches::kTouchEventsDisabled }
145};
146
[email protected]347a0c72012-05-14 20:28:06147const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31148 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06150 switches::kTouchOptimizedUI,
151 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20152 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06153 switches::kTouchOptimizedUI,
154 switches::kTouchOptimizedUIDisabled }
155};
156
[email protected]66f409c2012-10-04 20:59:04157const Experiment::Choice kNaClDebugMaskChoices[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
159 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
160 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
161 // an option to switch off its debugging.
162 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
163 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
164 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
165 switches::kNaClDebugMask, "*://*/*debug.nmf" }
166};
167
[email protected]ea2f3342012-09-21 21:13:36168#if defined(OS_CHROMEOS)
[email protected]d96aef22012-10-30 11:47:02169
170const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]2f2d6c32013-05-10 02:56:24171 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]d96aef22012-10-30 11:47:02172 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24173 chromeos::switches::kEnableChromeCaptivePortalDetector, "" },
[email protected]ad2fe9f2012-11-15 11:03:19174 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
[email protected]2f2d6c32013-05-10 02:56:24175 chromeos::switches::kDisableChromeCaptivePortalDetector, "" }
[email protected]d96aef22012-10-30 11:47:02176};
[email protected]a78c7432013-03-13 06:22:43177
[email protected]ea2f3342012-09-21 21:13:36178#endif
179
[email protected]9323fdd12013-02-23 00:31:36180const Experiment::Choice kImplSidePaintingChoices[] = {
181 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
182 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
183 cc::switches::kEnableImplSidePainting, ""},
184 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
185 cc::switches::kDisableImplSidePainting, ""}
186};
187
[email protected]a42c85f2013-04-04 18:15:12188const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
189 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
190 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
191 cc::switches::kMaxTilesForInterestArea, "64"},
192 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
193 cc::switches::kMaxTilesForInterestArea, "128"},
194 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
195 cc::switches::kMaxTilesForInterestArea, "256"},
196 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
197 cc::switches::kMaxTilesForInterestArea, "512"}
198};
199
[email protected]a3618122013-04-26 21:15:34200const Experiment::Choice kDefaultTileWidthChoices[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
202 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
203 switches::kDefaultTileWidth, "128"},
204 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
205 switches::kDefaultTileWidth, "256"},
206 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
207 switches::kDefaultTileWidth, "512"},
208 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
209 switches::kDefaultTileWidth, "1024"}
210};
211
212const Experiment::Choice kDefaultTileHeightChoices[] = {
213 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
214 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
215 switches::kDefaultTileHeight, "128"},
216 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
217 switches::kDefaultTileHeight, "256"},
218 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
219 switches::kDefaultTileHeight, "512"},
220 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
221 switches::kDefaultTileHeight, "1024"}
222};
223
[email protected]38484df12013-04-10 16:42:03224const Experiment::Choice kSimpleCacheBackendChoices[] = {
[email protected]9a3de3e32013-04-23 19:05:21225 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
227 switches::kUseSimpleCacheBackend, "off" },
[email protected]38484df12013-04-10 16:42:03228 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
229 switches::kUseSimpleCacheBackend, "on"}
230};
231
[email protected]4bc5050c2010-11-18 17:55:54232// RECORDING USER METRICS FOR FLAGS:
233// -----------------------------------------------------------------------------
234// The first line of the experiment is the internal name. If you'd like to
235// gather statistics about the usage of your flag, you should append a marker
236// comment to the end of the feature name, like so:
237// "my-special-feature", // FLAGS:RECORD_UMA
238//
239// After doing that, run //chrome/tools/extract_actions.py (see instructions at
240// the top of that file for details) to update the chromeactions.txt file, which
241// will enable UMA to record your feature flag.
242//
[email protected]783d5bb2012-10-24 03:47:14243// After your feature has shipped under a flag, you can locate the metrics under
244// the action name AboutFlags_internal-action-name. Actions are recorded once
245// per startup, so you should divide this number by AboutFlags_StartupTick to
246// get a sense of usage. Note that this will not be the same as number of users
247// with a given feature enabled because users can quit and relaunch the
248// application multiple times over a given time interval. The dashboard also
249// shows you how many (metrics reporting) users have enabled the flag over the
250// last seven days. However, note that this is not the same as the number of
251// users who have the flag enabled, since enabling the flag happens once,
252// whereas running with the flag enabled happens until the user flips the flag
253// again.
[email protected]4bc5050c2010-11-18 17:55:54254
[email protected]8a6ff28d2010-12-02 16:35:19255// To add a new experiment add to the end of kExperiments. There are two
256// distinct types of experiments:
257// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
258// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22259// . MULTI_VALUE: a list of choices, the first of which should correspond to a
260// deactivated state for this lab (i.e. no command line option). To specify
261// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
262// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19263// See the documentation of Experiment for details on the fields.
264//
265// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05266const Experiment kExperiments[] = {
267 {
[email protected]aac169d2011-03-18 19:53:03268 "expose-for-tabs", // FLAGS:RECORD_UMA
269 IDS_FLAGS_TABPOSE_NAME,
270 IDS_FLAGS_TABPOSE_DESCRIPTION,
271 kOsMac,
272#if defined(OS_MACOSX)
273 // The switch exists only on OS X.
274 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
275#else
276 SINGLE_VALUE_TYPE("")
277#endif
278 },
279 {
[email protected]4bc5050c2010-11-18 17:55:54280 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05281 IDS_FLAGS_CONFLICTS_CHECK_NAME,
282 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
283 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19284 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05285 },
286 {
[email protected]4bc5050c2010-11-18 17:55:54287 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
289 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45290 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22291 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31292 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22293 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
294 // always have PDF rasterization available, so no flag needed there.
295#if !defined(GOOGLE_CHROME_BUILD)
296 kOsWin,
297#else
298 0,
[email protected]fa6d2a2f2010-11-30 21:47:19299#endif
[email protected]8a6ff28d2010-12-02 16:35:19300 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42301 },
[email protected]0209b442012-07-18 00:38:05302 {
[email protected]96c6f4c2011-05-18 19:36:22303 "ignore-gpu-blacklist",
304 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
305 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
306 kOsAll,
307 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
308 },
309 {
[email protected]0110cf112011-07-02 00:39:43310 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22311 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
312 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23313 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44314 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
315 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22316 },
317 {
[email protected]72787e392012-03-23 05:55:43318 "threaded-compositing-mode",
319 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
320 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58321 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44322 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
323 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59324 },
325 {
[email protected]17e27692013-02-06 17:02:09326 "force-accelerated-composited-scrolling",
327 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
328 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
329 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44330 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
331 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09332 },
333 {
[email protected]8b1c3c72013-01-25 01:48:43334 "present-with-GDI",
335 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
336 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
337 kOsWin,
338 MULTI_VALUE_TYPE(kGDIPresentChoices)
339 },
340 {
[email protected]2b608752013-05-01 03:34:36341 "enable-experimental-canvas-features",
342 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
343 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
344 kOsAll,
345 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
346 },
347 {
[email protected]81c64af62012-06-06 20:15:52348 "disable-accelerated-2d-canvas",
349 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
350 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
351 kOsAll,
352 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
353 },
354 {
[email protected]efcde132012-05-30 01:05:18355 "disable-threaded-animation",
356 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
357 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59358 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37359 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59360 },
361 {
[email protected]5963b772011-02-09 22:55:38362 "composited-layer-borders",
363 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
364 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
365 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57366 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38367 },
368 {
[email protected]a8f1eaa2011-03-07 19:00:58369 "show-fps-counter",
370 IDS_FLAGS_SHOW_FPS_COUNTER,
371 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
372 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57373 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58374 },
[email protected]8ff7f342011-05-25 01:49:47375 {
[email protected]70c98a332011-12-21 20:51:52376 "accelerated-filters",
377 IDS_FLAGS_ACCELERATED_FILTERS,
378 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
379 kOsAll,
380 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
381 },
382 {
[email protected]8ff7f342011-05-25 01:49:47383 "disable-gpu-vsync",
384 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
385 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56386 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47387 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
388 },
[email protected]deaba6d52011-09-23 14:47:12389 {
[email protected]4052d832013-01-16 05:31:01390 "enable-webgl",
391 IDS_FLAGS_ENABLE_WEBGL_NAME,
392 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
393 kOsAndroid,
394#if defined(OS_ANDROID)
395 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
396#else
397 SINGLE_VALUE_TYPE("")
398#endif
399 },
400 {
[email protected]deaba6d52011-09-23 14:47:12401 "disable-webgl",
402 IDS_FLAGS_DISABLE_WEBGL_NAME,
403 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56404 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01405#if defined(OS_ANDROID)
406 SINGLE_VALUE_TYPE("")
407#else
[email protected]deaba6d52011-09-23 14:47:12408 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01409#endif
[email protected]deaba6d52011-09-23 14:47:12410 },
[email protected]09096e02012-05-24 11:12:04411 {
[email protected]ce585bf2013-03-14 16:25:16412 "disable-webrtc",
413 IDS_FLAGS_DISABLE_WEBRTC_NAME,
414 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05415 kOsAndroid,
416#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16417 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05418#else
419 SINGLE_VALUE_TYPE("")
420#endif
421 },
[email protected]5e2bc8c2013-05-28 22:59:57422#if defined(ENABLE_WEBRTC)
[email protected]d816ddc2013-05-23 14:28:30423 {
424 "enable-sctp-data-channels",
425 IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_NAME,
426 IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_DESCRIPTION,
427 kOsAll,
428 SINGLE_VALUE_TYPE(switches::kEnableSCTPDataChannels)
429 },
[email protected]5e2bc8c2013-05-28 22:59:57430#endif
[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]d8221b22013-05-23 05:35:43456 {
457 "enable-compositing-for-transition",
458 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME,
459 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION,
460 kOsAll,
461 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices)
462 },
[email protected]a7640ef22012-10-06 00:52:08463 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53464 {
[email protected]e3791ce92011-08-09 01:03:32465 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40466 IDS_FLAGS_ENABLE_NACL_NAME,
467 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56468 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19469 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40470 },
471 {
[email protected]9addd1c2012-09-15 14:28:24472 "enable-nacl-debug", // FLAGS:RECORD_UMA
473 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
474 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56475 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24476 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13477 },
478 {
[email protected]66f409c2012-10-04 20:59:04479 "nacl-debug-mask", // FLAGS:RECORD_UMA
480 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
481 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56482 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04483 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
484 },
485 {
[email protected]7babd1c2012-08-08 20:35:29486 "enable-pnacl", // FLAGS:RECORD_UMA
487 IDS_FLAGS_ENABLE_PNACL_NAME,
488 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56489 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29490 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
491 },
492 {
[email protected]4bc5050c2010-11-18 17:55:54493 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32494 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
495 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56496 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19497 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32498 },
[email protected]3627b06d2010-11-12 16:36:16499 {
[email protected]ac2e2acd2013-03-21 12:57:29500 "extensions-on-chrome-urls",
501 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
502 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
503 kOsAll,
504 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
505 },
506 {
[email protected]e9cddd52013-03-23 17:37:53507 "enable-adview",
508 IDS_FLAGS_ENABLE_ADVIEW_NAME,
509 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
510 kOsDesktop,
511 SINGLE_VALUE_TYPE(switches::kEnableAdview)
512 },
513 {
514 "enable-adview-src-attribute",
515 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
516 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
517 kOsDesktop,
518 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
519 },
520 {
[email protected]544471a2012-10-13 05:27:09521 "action-box",
[email protected]cab18ef2012-04-27 07:22:03522 IDS_FLAGS_ACTION_BOX_NAME,
523 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56524 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44525 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
526 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03527 },
528 {
[email protected]3a362432012-06-18 20:39:51529 "script-badges",
530 IDS_FLAGS_SCRIPT_BADGES_NAME,
531 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56532 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09533 SINGLE_VALUE_TYPE(switches::kScriptBadges)
534 },
535 {
536 "script-bubble",
537 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
538 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56539 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44540 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
541 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51542 },
543 {
[email protected]cbe224d2011-08-04 22:12:49544 "apps-new-install-bubble",
545 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
546 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56547 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49548 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
549 },
550 {
[email protected]80bd24e2010-11-30 09:34:38551 "disable-hyperlink-auditing",
552 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
553 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
554 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19555 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51556 },
557 {
558 "experimental-location-features", // FLAGS:RECORD_UMA
559 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
560 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
561 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19562 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
563 },
564 {
[email protected]5aea1862011-03-23 23:55:39565 "tab-groups-context-menu",
566 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
567 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
568 kOsWin,
569 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
570 },
[email protected]c94cebd2012-06-21 00:55:28571 {
572 "enable-instant-extended-api",
573 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
574 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56575 kOsDesktop,
[email protected]73444382013-02-26 19:31:51576 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
577 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28578 },
[email protected]e9bf9d92011-03-31 20:57:15579 {
[email protected]8cc9e532013-05-06 21:01:47580 "enable-local-first-load-ntp",
581 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP,
582 IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP_DESCRIPTION,
583 kOsDesktop,
584 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalFirstLoadNTP,
585 switches::kDisableLocalFirstLoadNTP)
586 },
587 {
[email protected]07fd48a2013-04-13 02:53:27588 "enable-local-only-instant-extended-api",
589 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
590 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
591 kOsDesktop,
592 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
593 switches::kDisableLocalOnlyInstantExtendedAPI)
594 },
595 {
[email protected]354e33b2011-06-15 00:29:10596 "static-ip-config",
597 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
598 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
599 kOsCrOS,
600#if defined(OS_CHROMEOS)
601 // This switch exists only on Chrome OS.
[email protected]2f2d6c32013-05-10 02:56:24602 SINGLE_VALUE_TYPE(chromeos::switches::kEnableStaticIPConfig)
[email protected]354e33b2011-06-15 00:29:10603#else
604 SINGLE_VALUE_TYPE("")
605#endif
606 },
[email protected]3eb5728c2011-06-20 22:32:24607 {
608 "show-autofill-type-predictions",
609 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
610 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
611 kOsAll,
[email protected]e217c5632013-04-12 19:11:48612 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24613 },
[email protected]bff4d3e2011-06-21 23:58:52614 {
[email protected]a5e9faa2013-03-19 09:58:38615 "enable-sync-favicons",
616 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
617 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55618 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38619 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55620 },
621 {
[email protected]5d90a0a2012-11-15 02:43:40622 "sync-keystore-encryption",
623 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
624 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
625 kOsAll,
626 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
627 },
628 {
[email protected]e755a382012-09-13 17:16:35629 "enable-gesture-tap-highlight",
630 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
631 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
632 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47633 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
634 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35635 },
636 {
[email protected]a22ebd812011-06-23 00:05:39637 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
638 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
639 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
640 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40641 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25642 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39643 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
644 },
[email protected]81a6b0b2011-06-24 17:55:40645 {
[email protected]128dc6c2012-06-22 20:30:35646 "omnibox-history-quick-provider-reorder-for-inlining",
647 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
648 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
649 kOsAll,
650 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
651 },
652 {
[email protected]032d5e6c2012-02-17 17:53:55653 "omnibox-inline-history-quick-provider",
654 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
655 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
656 kOsAll,
657 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
658 },
659 {
[email protected]7e7a28092011-12-09 22:24:55660 "enable-panels",
661 IDS_FLAGS_ENABLE_PANELS_NAME,
662 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56663 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55664 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54665 },
[email protected]e3749d12011-07-25 22:22:12666 {
[email protected]27c14f02012-06-22 17:29:58667 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27668 "save-page-as-mhtml", // FLAGS:RECORD_UMA
669 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
670 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
671 kOsMac | kOsWin | kOsLinux,
672 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
673 },
674 {
[email protected]b7bb44f2011-09-01 05:17:03675 "enable-autologin",
676 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
677 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
678 kOsMac | kOsWin | kOsLinux,
679 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
680 },
[email protected]b9841172011-09-26 23:36:09681 {
[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 },
[email protected]85dd7ca2013-05-30 23:53:00689#if defined(ANDROID) && !defined(GOOGLE_TV)
690 {
691 "enable-media-source",
692 IDS_FLAGS_ENABLE_WEBKIT_MEDIA_SOURCE_NAME,
693 IDS_FLAGS_ENABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION,
694 kOsAll,
695 SINGLE_VALUE_TYPE(switches::kEnableWebKitMediaSource)
696 },
697#else
[email protected]27b3fe92012-03-21 05:35:06698 {
[email protected]1eb93802012-09-11 18:57:56699 "disable-media-source",
[email protected]5bf1223a52013-05-14 21:42:31700 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_NAME,
701 IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32702 kOsAll,
[email protected]5bf1223a52013-05-14 21:42:31703 SINGLE_VALUE_TYPE(switches::kDisableWebKitMediaSource)
[email protected]6aa03b32011-10-27 21:44:44704 },
[email protected]85dd7ca2013-05-30 23:53:00705#endif
[email protected]e4e68dbb2011-11-18 01:50:22706 {
[email protected]16c242d2013-05-31 23:56:47707 "enable-encrypted-media",
708 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
709 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56710 kOsDesktop,
[email protected]16c242d2013-05-31 23:56:47711 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
712 },
713 {
714 "disable-encrypted-media",
715 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
716 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
717 kOsDesktop,
718 SINGLE_VALUE_TYPE(switches::kDisableLegacyEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03719 },
[email protected]f88628792012-12-18 07:07:50720 {
721 "enable-opus-playback",
722 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
723 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56724 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50725 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
726 },
[email protected]ca6eaa5a2013-01-24 16:16:04727 {
[email protected]c54e1aa2013-01-25 09:26:17728 "enable-vp9-playback",
729 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
730 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
731 kOsDesktop,
732 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
733 },
734 {
[email protected]6ac955b2013-04-19 23:43:32735 "enable-vp8-alpha-playback",
736 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME,
737 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION,
738 kOsDesktop,
739 SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback)
740 },
741 {
[email protected]ca6eaa5a2013-01-24 16:16:04742 "enable-managed-users",
743 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
744 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58745 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04746 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
747 },
[email protected]dc04be7c2012-03-15 23:57:49748#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50749 {
[email protected]2a13a9a2013-04-19 04:00:21750 "ash-disable-auto-maximizing",
751 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
752 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
753 kOsWin | kOsLinux | kOsCrOS,
754 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
755 },
756 {
[email protected]cda278d2012-10-30 20:31:40757 "ash-disable-auto-window-placement",
758 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
759 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
760 kOsWin | kOsLinux | kOsCrOS,
761 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
762 },
[email protected]b4e4ec42012-11-29 21:42:40763 {
[email protected]16f55a22013-02-13 23:47:34764 "ash-disable-per-app-launcher",
765 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
766 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40767 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34768 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40769 },
[email protected]dc04be7c2012-03-15 23:57:49770#endif
[email protected]eaae8b462012-01-20 22:20:39771 {
[email protected]db543d322011-12-15 20:40:15772 "per-tile-painting",
773 IDS_FLAGS_PER_TILE_PAINTING_NAME,
774 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37775 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37776 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15777 },
[email protected]bf88c032011-12-22 19:05:47778 {
779 "enable-javascript-harmony",
780 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
781 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
782 kOsAll,
783 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
784 },
[email protected]7e7f378a2012-01-05 14:35:37785 {
[email protected]85646172012-01-09 22:45:54786 "enable-tab-browser-dragging",
787 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
788 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
789 kOsWin,
790 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
791 },
792 {
[email protected]068b7b52012-02-27 12:41:44793 "disable-restore-session-state",
794 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
795 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37796 kOsAll,
[email protected]068b7b52012-02-27 12:41:44797 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37798 },
[email protected]88864db2012-01-18 20:56:35799 {
800 "disable-software-rasterizer",
801 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
802 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
803#if defined(ENABLE_SWIFTSHADER)
804 kOsAll,
805#else
806 0,
807#endif
808 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
809 },
[email protected]15a5d722012-01-23 09:11:14810 {
[email protected]ff7b6dd2012-09-15 20:20:03811 "enable-experimental-webkit-features",
812 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
813 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16814 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03815 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49816 },
817 {
[email protected]0f95a252012-09-13 22:30:04818 "enable-css-shaders",
819 IDS_FLAGS_CSS_SHADERS_NAME,
820 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
821 kOsAll,
822 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
823 },
824 {
[email protected]3e8befc2012-03-13 01:17:03825 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16826 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
827 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56828 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03829 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16830 },
[email protected]dc04be7c2012-03-15 23:57:49831#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01832 {
[email protected]3cd198a22012-03-12 20:38:01833 "enable-ash-oak",
834 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
835 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
836 kOsAll,
837 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
838 },
[email protected]31cf1c52012-02-29 20:55:01839#endif
[email protected]184ec592012-03-01 11:54:28840 {
841 "enable-devtools-experiments",
842 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
843 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56844 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28845 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
846 },
[email protected]76d1854e2012-03-02 23:57:44847 {
[email protected]2fefdb32013-02-26 14:28:10848 "silent-debugger-extension-api",
849 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
850 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
851 kOsDesktop,
852 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
853 },
854 {
[email protected]76d1854e2012-03-02 23:57:44855 "enable-suggestions-ntp",
856 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
857 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56858 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44859 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
860 },
[email protected]a3d54252012-04-05 20:04:13861 {
[email protected]1dbaf5e2012-11-30 05:51:32862 "spellcheck-autocorrect",
863 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
864 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
865 kOsWin | kOsLinux | kOsCrOS,
866 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
867 },
868 {
[email protected]d7932532012-11-21 21:10:31869 "touch-events",
870 IDS_TOUCH_EVENTS_NAME,
871 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56872 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31873 MULTI_VALUE_TYPE(kTouchEventsChoices)
874 },
875 {
[email protected]c9c73ad42012-04-18 03:35:59876 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06877 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
878 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55879 kOsWin,
[email protected]347a0c72012-05-14 20:28:06880 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59881 },
[email protected]8a6aaa72012-04-20 20:53:58882 {
[email protected]b9c96ff2012-11-26 22:24:40883 "disable-touch-adjustment",
884 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
885 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
886 kOsWin | kOsLinux | kOsCrOS,
887 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
888 },
889 {
[email protected]0b9383a2012-10-26 00:58:16890 "enable-tab-capture",
891 IDS_ENABLE_TAB_CAPTURE_NAME,
892 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25893 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44894 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
895 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16896 },
[email protected]0b60afa2012-04-19 17:36:39897#if defined(OS_CHROMEOS)
898 {
[email protected]7c4a9bc2012-09-11 22:10:05899 "enable-background-loader",
900 IDS_ENABLE_BACKLOADER_NAME,
901 IDS_ENABLE_BACKLOADER_DESCRIPTION,
902 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24903 SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader)
[email protected]7c4a9bc2012-09-11 22:10:05904 },
905 {
[email protected]c5667b282012-08-31 00:32:50906 "enable-bezel-touch",
907 IDS_ENABLE_BEZEL_TOUCH_NAME,
908 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47909 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50910 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47911 },
912 {
[email protected]3f4181a2013-02-01 21:31:07913 "enable-screensaver-extension",
914 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
915 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
916 kOsCrOS,
917 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
918 },
919 {
[email protected]0b60afa2012-04-19 17:36:39920 "no-discard-tabs",
921 IDS_FLAGS_NO_DISCARD_TABS_NAME,
922 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
923 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24924 SINGLE_VALUE_TYPE(chromeos::switches::kNoDiscardTabs)
[email protected]0b60afa2012-04-19 17:36:39925 },
926#endif
[email protected]79be6d32012-04-24 20:47:44927 {
[email protected]8d68a3e02013-01-12 15:57:10928 "enable-download-resumption",
929 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
930 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56931 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10932 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
933 },
934 {
[email protected]9a5940d2012-04-27 19:16:23935 "allow-nacl-socket-api",
936 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
937 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56938 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23939 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
940 },
[email protected]85333732012-05-01 19:02:24941 {
[email protected]60673ad72012-05-02 06:16:33942 "stacked-tab-strip",
943 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
944 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
945 kOsWin,
946 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
947 },
948 {
[email protected]4bd20202012-06-14 17:35:01949 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24950 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
951 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
952 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01953 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24954 },
[email protected]190349fd2012-05-02 00:10:47955#if defined(OS_CHROMEOS)
956 {
957 "allow-touchpad-three-finger-click",
958 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
959 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
960 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24961 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
[email protected]190349fd2012-05-02 00:10:47962 },
[email protected]fbc176b62012-10-27 02:19:58963 {
964 "allow-touchpad-three-finger-swipe",
965 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
966 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
967 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24968 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerSwipe)
[email protected]fbc176b62012-10-27 02:19:58969 },
[email protected]190349fd2012-05-02 00:10:47970#endif
[email protected]1992a2f42012-10-23 18:32:21971 {
[email protected]a585e462013-01-26 00:37:15972 "use-client-login-signin-flow",
973 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
974 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21975 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15976 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21977 },
[email protected]8ee02242012-12-04 15:23:32978 {
979 "enable-desktop-guest-mode",
980 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
981 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
982 kOsMac | kOsWin | kOsLinux,
983 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
984 },
[email protected]53520b1b2012-05-07 21:43:37985#if defined(USE_ASH)
986 {
[email protected]8257d382013-03-26 13:08:42987 "show-launcher-alignment-menu",
988 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
989 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42990 kOsAll,
[email protected]8257d382013-03-26 13:08:42991 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42992 },
993 {
[email protected]2ddf37b2013-04-20 01:15:58994 "disable-minimize-on-second-launcher-item-click",
995 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
996 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
997 kOsAll,
998 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
999 },
1000 {
[email protected]73074742012-05-17 01:44:411001 "show-touch-hud",
1002 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
1003 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
1004 kOsAll,
1005 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
1006 },
1007 {
[email protected]9f0940b62012-05-23 22:56:351008 "enable-pinch",
1009 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
1010 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:061011 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:381012 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
1013 },
1014 {
[email protected]de0aaed2013-05-27 18:16:431015 "enable-pinch-virtual-viewport",
1016 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
1017 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
1018 kOsLinux | kOsWin | kOsCrOS,
1019 SINGLE_VALUE_TYPE(cc::switches::kEnablePinchVirtualViewport),
1020 },
1021 {
[email protected]a4016f12013-05-02 07:53:471022 "forced-maximize-mode",
1023 IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME,
1024 IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION,
1025 kOsLinux | kOsWin | kOsCrOS,
1026 SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode),
1027 },
[email protected]73074742012-05-17 01:44:411028#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281029#if defined(OS_CHROMEOS)
1030 {
[email protected]8b04a1652012-08-04 02:59:491031 "disable-boot-animation",
1032 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1033 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581034 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241035 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:491036 },
[email protected]95058572012-08-20 14:57:291037 {
[email protected]d96aef22012-10-30 11:47:021038 "captive-portal-detector",
1039 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1040 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581041 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021042 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1043 },
1044 {
[email protected]c11aa8f12012-12-18 18:43:141045 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571046 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1047 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1048 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141049 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571050 },
[email protected]f0280952012-11-06 20:30:501051 {
[email protected]ea2fab32013-04-16 06:55:021052 "file-manager-legacy",
1053 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1054 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231055 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241056 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231057 },
[email protected]3e035e82012-11-27 20:54:321058 {
[email protected]828d99052013-04-22 08:15:031059 "file-manager-legacy-ui",
1060 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_NAME,
1061 IDS_FLAGS_FILE_MANAGER_LEGACY_UI_DESCRIPTION,
[email protected]bc545292013-04-18 14:33:101062 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241063 SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerLegacyUI),
[email protected]bc545292013-04-18 14:33:101064 },
1065 {
[email protected]c64d7732013-03-25 18:09:501066 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521067 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1068 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581069 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:241070 SINGLE_VALUE_TYPE(chromeos::switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471071 },
[email protected]6ad015c2013-03-06 00:49:511072 {
[email protected]c64d7732013-03-25 18:09:501073 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521074 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1075 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511076 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521077 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511078 },
[email protected]099b890c2013-04-25 19:16:261079 {
1080 "disable-quickoffice-component-app",
1081 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME,
1082 IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION,
1083 kOsCrOS,
1084 SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp),
1085 },
[email protected]62018dc2012-12-13 00:37:351086#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391087 {
[email protected]6247aba2013-03-04 22:57:181088 "views-textfield",
1089 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1090 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391091 kOsWin,
[email protected]6247aba2013-03-04 22:57:181092 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1093 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391094 },
[email protected]bd0cd3bb2012-06-14 03:03:381095 {
[email protected]ffbe5782013-05-09 23:22:081096 "new-dialog-style",
1097 IDS_FLAGS_NEW_DIALOG_STYLE_NAME,
1098 IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321099 kOsWin | kOsCrOS,
[email protected]ffbe5782013-05-09 23:22:081100 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle,
1101 switches::kDisableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321102 },
[email protected]7db8893a2012-07-26 00:49:401103 { "disable-accelerated-video-decode",
1104 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1105 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191106 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401107 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151108 },
[email protected]66ae9fc2012-06-19 21:33:521109#if defined(USE_ASH)
1110 {
1111 "ash-debug-shortcuts",
1112 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1113 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1114 kOsAll,
1115 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1116 },
1117#endif
[email protected]37fee0942012-08-07 21:07:451118 {
[email protected]ad3f6d22012-08-29 02:34:191119 "enable-contacts",
1120 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1121 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1122 kOsCrOS,
1123 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1124 },
[email protected]1d9bb9cd2012-08-28 22:02:501125#if defined(USE_ASH)
1126 { "ash-enable-advanced-gestures",
1127 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1128 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1129 kOsCrOS,
1130 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1131 },
[email protected]cfa24e62013-02-13 21:19:111132 { "ash-disable-tab-scrubbing",
1133 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1134 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161135 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111136 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161137 },
[email protected]ad6fcc32013-05-30 03:46:481138 { "ash-disable-drag-and-drop-applist-to-launcher",
[email protected]00c8469e22013-05-08 21:40:081139 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME,
1140 IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION,
1141 kOsCrOS,
[email protected]ad6fcc32013-05-30 03:46:481142 SINGLE_VALUE_TYPE(ash::switches::kAshDisableDragAndDropAppListToLauncher),
[email protected]00c8469e22013-05-08 21:40:081143 },
[email protected]83eef802012-12-02 07:43:521144 { "ash-enable-workspace-scrubbing",
1145 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1146 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1147 kOsCrOS,
1148 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1149 },
[email protected]cf2b1a82013-04-20 01:05:431150 { "ash-immersive-fullscreen-2",
[email protected]819e58d22013-03-20 00:16:111151 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1152 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241153 kOsCrOS,
[email protected]cf2b1a82013-04-20 01:05:431154 ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen,
1155 ash::switches::kAshDisableImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241156 },
[email protected]316708a2012-11-05 22:57:021157#if defined(OS_LINUX)
1158 { "ash-enable-memory-monitor",
1159 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1160 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1161 kOsCrOS,
1162 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1163 },
1164#endif
[email protected]1d9bb9cd2012-08-28 22:02:501165#endif
[email protected]9b7ab882012-09-10 23:46:361166#if defined(OS_CHROMEOS)
[email protected]1f9fa302013-05-17 21:11:131167 { "use-new-network-configuration-handlers",
1168 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_NAME,
1169 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_DESCRIPTION,
1170 kOsCrOS,
1171 SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConfigurationHandlers),
1172 },
[email protected]ce98ef82013-05-31 22:43:241173 { "use-new-network-connection-handler",
1174 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_NAME,
1175 IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_DESCRIPTION,
1176 kOsCrOS,
1177 SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConnectionHandler),
1178 },
[email protected]9b7ab882012-09-10 23:46:361179 {
[email protected]354ff2d2013-05-01 17:06:311180 "ash-enable-new-audio-handler2",
[email protected]db5be732013-04-24 05:21:121181 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_NAME,
1182 IDS_FLAGS_ASH_ENABLE_NEW_AUDIO_HANDLER_DESCRIPTION,
1183 kOsCrOS,
[email protected]354ff2d2013-05-01 17:06:311184 ENABLE_DISABLE_VALUE_TYPE("", ash::switches::kAshDisableNewAudioHandler)
1185 },
1186 {
1187 "ash-audio-device-menu",
1188 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME,
1189 IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION,
1190 kOsCrOS,
1191 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu)
[email protected]db5be732013-04-24 05:21:121192 },
1193 {
[email protected]205f07892012-10-16 20:26:221194 "enable-carrier-switching",
1195 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1196 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1197 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241198 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221199 },
1200 {
[email protected]9b7ab882012-09-10 23:46:361201 "enable-request-tablet-site",
1202 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1203 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1204 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241205 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361206 },
1207#endif
[email protected]dab49c0b2012-10-04 05:55:351208 {
1209 "debug-packed-apps",
1210 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1211 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561212 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351213 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1214 },
[email protected]d1459ed2012-10-10 01:29:331215 {
1216 "enable-password-generation",
1217 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1218 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561219 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331220 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1221 },
[email protected]26d045f2012-10-18 21:18:431222 {
[email protected]76f7d4882012-10-26 21:09:221223 "enable-deferred-image-decoding",
1224 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1225 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221226 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221227 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1228 },
1229 {
[email protected]075543d2012-10-24 01:29:141230 "performance-monitor-gathering",
1231 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1232 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1233 kOsAll,
1234 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1235 },
[email protected]783d5bb2012-10-24 03:47:141236 {
[email protected]90b482d2013-04-04 10:45:581237 "disable-native-autofill-ui",
1238 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1239 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431240 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581241 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431242 },
1243 {
[email protected]a7259fb2012-11-08 06:22:231244 "enable-experimental-form-filling",
1245 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1246 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1247 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481248 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231249 },
[email protected]6e6efe42013-01-30 00:04:501250 {
[email protected]db3178c2013-03-21 14:54:541251 "wallet-service-use-prod",
1252 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1253 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1254 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481255 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541256 },
1257 {
[email protected]6e6efe42013-01-30 00:04:501258 "enable-interactive-autocomplete",
1259 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1260 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]dc1cb7d82013-05-22 18:00:001261 kOsWin | kOsCrOS | kOsAndroid,
[email protected]000f3ad2013-05-16 02:19:171262 ENABLE_DISABLE_VALUE_TYPE(
1263 autofill::switches::kEnableInteractiveAutocomplete,
1264 autofill::switches::kDisableInteractiveAutocomplete)
[email protected]6e6efe42013-01-30 00:04:501265 },
[email protected]177260c2013-04-24 01:47:381266#if defined(USE_AURA)
1267 {
1268 "overscroll-history-navigation",
1269 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1270 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1271 kOsAll,
1272 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1273 switches::kOverscrollHistoryNavigation, "1",
1274 switches::kOverscrollHistoryNavigation, "0")
1275 },
1276#endif
[email protected]edbea622012-11-28 20:39:381277 {
1278 "enable-touch-drag-drop",
1279 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1280 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1281 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271282 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1283 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381284 },
[email protected]0e2f43b62013-02-21 00:47:151285 {
1286 "enable-touch-editing",
1287 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1288 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1289 kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271290 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1291 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151292 },
[email protected]92e12dd92012-12-11 03:33:201293 {
1294 "enable-rich-notifications",
1295 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1296 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
[email protected]ed4004b52013-05-07 13:25:001297 kOsWin | kOsCrOS | kOsMac,
[email protected]aee412aa2013-04-02 20:01:231298 ENABLE_DISABLE_VALUE_TYPE(
1299 message_center::switches::kEnableRichNotifications,
1300 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201301 },
[email protected]4d51c682012-12-11 11:34:551302 {
[email protected]ddec1aa2013-04-28 23:22:451303 "enable-sync-synced-notifications",
1304 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1305 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
[email protected]43168932013-05-24 06:35:181306 kOsDesktop,
[email protected]ddec1aa2013-04-28 23:22:451307 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1308 switches::kDisableSyncSyncedNotifications)
1309 },
1310 {
[email protected]a50e16a2013-04-25 14:07:171311 "disable-full-history-sync",
[email protected]4d51c682012-12-11 11:34:551312 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1313 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1314 kOsAll,
[email protected]a50e16a2013-04-25 14:07:171315 SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync)
[email protected]4d51c682012-12-11 11:34:551316 },
[email protected]628a69a92012-12-23 04:09:341317 {
[email protected]fd030142013-02-08 02:04:381318 "enable-usermedia-screen-capture",
1319 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1320 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1321 kOsDesktop,
1322 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1323 },
[email protected]5b93e162013-02-19 06:33:091324 {
1325 "enable-apps-devtool-app",
1326 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1327 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1328 kOsDesktop,
1329 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1330 },
[email protected]9323fdd12013-02-23 00:31:361331 {
1332 "impl-side-painting",
1333 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1334 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041335 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361336 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1337 },
[email protected]a42c85f2013-04-04 18:15:121338 {
[email protected]1c92d3e2013-04-18 05:31:391339 "enable-websocket-experimental-implementation",
1340 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1341 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1342 kOsAll,
1343 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1344 },
1345 {
[email protected]a42c85f2013-04-04 18:15:121346 "max-tiles-for-interest-area",
1347 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1348 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1349 kOsAndroid | kOsLinux | kOsCrOS,
1350 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1351 },
[email protected]7cf7ccb2013-04-20 02:53:081352 {
1353 "enable-offline-mode",
1354 IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME,
1355 IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION,
1356 kOsAll,
1357 SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess)
1358 },
[email protected]a3618122013-04-26 21:15:341359 {
1360 "default-tile-width",
1361 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1362 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1363 kOsAll,
1364 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1365 },
1366 {
1367 "default-tile-height",
1368 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1369 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1370 kOsAll,
1371 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1372 },
[email protected]2f2f72b2013-03-08 22:37:311373 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1374#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371375 {
1376 "track-active-visit-time",
1377 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1378 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1379 kOsWin,
1380 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1381 },
[email protected]2f2f72b2013-03-08 22:37:311382#endif
[email protected]8cc71d42013-03-02 17:26:081383#if defined(OS_ANDROID)
1384 {
1385 "disable-gesture-requirement-for-media-playback",
1386 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1387 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1388 kOsAndroid,
1389 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1390 },
1391#endif
[email protected]6077cab2013-03-11 19:36:141392#if defined(ENABLE_GOOGLE_NOW)
1393 {
1394 "enable-google-now",
1395 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1396 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1397 kOsWin | kOsCrOS,
1398 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1399 },
1400#endif
[email protected]4a9e2e02013-04-08 16:19:491401 {
1402 "enable-translate-alpha-languages",
1403 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1404 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1405 kOsAll,
1406 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1407 },
[email protected]86459e2c2013-04-10 13:39:241408#if defined(OS_CHROMEOS)
1409 {
1410 "enable-virtual-keyboard",
1411 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1412 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1413 kOsCrOS,
1414 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1415 },
1416#endif
[email protected]38484df12013-04-10 16:42:031417 {
1418 "enable-simple-cache-backend",
1419 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1420 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1421 kOsAndroid,
1422 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1423 },
[email protected]717e4e22013-04-10 20:52:231424 {
1425 "enable-tcp-fast-open",
1426 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1427 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111428 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231429 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1430 },
[email protected]8027acd2013-04-18 08:35:151431 {
1432 "enable-webp-in-accept-header",
1433 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1434 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1435 kOsAll,
1436 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1437 },
[email protected]58c740f2013-05-06 05:25:441438 {
1439 "apps-use-native-frame",
1440 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME,
1441 IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION,
1442 kOsWin,
1443 SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame)
1444 },
[email protected]896d86b32013-05-09 19:36:441445 {
1446 "enable-syncfs-directory-operation",
1447 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME,
1448 IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION,
1449 kOsAll,
1450 SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation),
1451 },
[email protected]a4ed7e12013-05-24 01:00:281452 {
1453 "enable-draggable-menu-button",
1454 IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_NAME,
1455 IDS_FLAGS_ENABLE_DRAGGABLE_MENU_BUTTON_DESCRIPTION,
1456 kOsAndroid,
1457 SINGLE_VALUE_TYPE(switches::kEnableDraggableMenuButton)
1458 },
[email protected]380532aa2013-05-24 11:59:351459 {
1460 "enable-reset-profile-settings",
1461 IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_NAME,
1462 IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_DESCRIPTION,
1463 kOsAll,
1464 SINGLE_VALUE_TYPE(switches::kEnableResetProfileSettings)
1465 },
[email protected]289704062013-05-31 01:49:401466 {
1467 "enable-device-discovery",
1468 IDS_FLAGS_ENABLE_DEVICE_DISCOVERY_NAME,
1469 IDS_FLAGS_ENABLE_DEVICE_DISCOVERY_DESCRIPTION,
1470 kOsDesktop,
1471 SINGLE_VALUE_TYPE(switches::kEnableDeviceDiscovery)
1472 },
[email protected]56d3c6e42013-05-29 11:28:011473#if defined(OS_MACOSX)
1474 {
1475 "enable-app-list-shim",
1476 IDS_FLAGS_ENABLE_APP_LIST_SHIM_NAME,
1477 IDS_FLAGS_ENABLE_APP_LIST_SHIM_DESCRIPTION,
1478 kOsMac,
1479 SINGLE_VALUE_TYPE(switches::kEnableAppListShim)
1480 },
[email protected]cb29e162013-05-31 07:47:021481 {
1482 "enable-app-shims",
1483 IDS_FLAGS_ENABLE_APP_SHIMS_NAME,
1484 IDS_FLAGS_ENABLE_APP_SHIMS_DESCRIPTION,
1485 kOsMac,
1486 SINGLE_VALUE_TYPE(switches::kEnableAppShims)
1487 },
[email protected]56d3c6e42013-05-29 11:28:011488#endif
[email protected]13177832013-05-31 07:46:051489#if defined(OS_CHROMEOS) || defined(OS_WIN)
1490 {
1491 "enable-omnibox-auto-completion-for-ime",
1492 IDS_FLAGS_ENABLE_OMNIBOX_AUTO_COMPLETION_FOR_IME_NAME,
1493 IDS_FLAGS_ENABLE_OMNIBOX_AUTO_COMPLETION_FOR_IME_DESCRIPTION,
1494 kOsCrOS,
1495 SINGLE_VALUE_TYPE(switches::kEnableOmniboxAutoCompletionForIme)
1496 },
1497#endif
[email protected]a0e4b072011-08-17 01:47:071498};
[email protected]ad2a3ded2010-08-27 13:19:051499
[email protected]a314ee5a2010-10-26 21:23:281500const Experiment* experiments = kExperiments;
1501size_t num_experiments = arraysize(kExperiments);
1502
[email protected]e2ddbc92010-10-15 20:02:071503// Stores and encapsulates the little state that about:flags has.
1504class FlagsState {
1505 public:
1506 FlagsState() : needs_restart_(false) {}
1507 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1508 bool IsRestartNeededToCommitChanges();
1509 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281510 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071511 void RemoveFlagsSwitches(
1512 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001513 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071514 void reset();
1515
1516 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551517 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071518 return Singleton<FlagsState>::get();
1519 }
1520
1521 private:
1522 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531523 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071524
1525 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1526};
1527
[email protected]c7b7800a2010-10-07 18:51:351528// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491529// in a set.
[email protected]1a47d7e2010-10-15 00:37:241530void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051531 const ListValue* enabled_experiments = prefs->GetList(
1532 prefs::kEnabledLabsExperiments);
1533 if (!enabled_experiments)
1534 return;
1535
1536 for (ListValue::const_iterator it = enabled_experiments->begin();
1537 it != enabled_experiments->end();
1538 ++it) {
1539 std::string experiment_name;
1540 if (!(*it)->GetAsString(&experiment_name)) {
1541 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1542 continue;
1543 }
1544 result->insert(experiment_name);
1545 }
1546}
1547
[email protected]c6343372013-03-13 17:05:491548// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241549void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051550 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381551 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1552 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051553
1554 experiments_list->Clear();
1555 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1556 it != enabled_experiments.end();
1557 ++it) {
1558 experiments_list->Append(new StringValue(*it));
1559 }
1560}
1561
[email protected]8a6ff28d2010-12-02 16:35:191562// Adds the internal names for the specified experiment to |names|.
1563void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1564 if (e.type == Experiment::SINGLE_VALUE) {
1565 names->insert(e.internal_name);
1566 } else {
[email protected]83e9fa702013-02-25 19:30:441567 DCHECK(e.type == Experiment::MULTI_VALUE ||
1568 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191569 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441570 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191571 }
1572}
1573
[email protected]28e35af2011-02-09 12:56:221574// Confirms that an experiment is valid, used in a DCHECK in
1575// SanitizeList below.
1576bool ValidateExperiment(const Experiment& e) {
1577 switch (e.type) {
1578 case Experiment::SINGLE_VALUE:
1579 DCHECK_EQ(0, e.num_choices);
1580 DCHECK(!e.choices);
1581 break;
1582 case Experiment::MULTI_VALUE:
1583 DCHECK_GT(e.num_choices, 0);
1584 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531585 DCHECK(e.choices[0].command_line_switch);
1586 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221587 break;
[email protected]83e9fa702013-02-25 19:30:441588 case Experiment::ENABLE_DISABLE_VALUE:
1589 DCHECK_EQ(3, e.num_choices);
1590 DCHECK(!e.choices);
1591 DCHECK(e.command_line_switch);
1592 DCHECK(e.command_line_value);
1593 DCHECK(e.disable_command_line_switch);
1594 DCHECK(e.disable_command_line_value);
1595 break;
[email protected]28e35af2011-02-09 12:56:221596 default:
1597 NOTREACHED();
1598 }
1599 return true;
1600}
1601
[email protected]ad2a3ded2010-08-27 13:19:051602// Removes all experiments from prefs::kEnabledLabsExperiments that are
1603// unknown, to prevent this list to become very long as experiments are added
1604// and removed.
1605void SanitizeList(PrefService* prefs) {
1606 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221607 for (size_t i = 0; i < num_experiments; ++i) {
1608 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191609 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221610 }
[email protected]ad2a3ded2010-08-27 13:19:051611
1612 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241613 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051614
1615 std::set<std::string> new_enabled_experiments;
1616 std::set_intersection(
1617 known_experiments.begin(), known_experiments.end(),
1618 enabled_experiments.begin(), enabled_experiments.end(),
1619 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1620
[email protected]4c8853f2012-07-23 01:29:161621 if (new_enabled_experiments != enabled_experiments)
1622 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051623}
1624
[email protected]1a47d7e2010-10-15 00:37:241625void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051626 PrefService* prefs, std::set<std::string>* result) {
1627 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241628 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051629}
1630
[email protected]a314ee5a2010-10-26 21:23:281631// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1632// enabled on the current platform.
1633void GetSanitizedEnabledFlagsForCurrentPlatform(
1634 PrefService* prefs, std::set<std::string>* result) {
1635 GetSanitizedEnabledFlags(prefs, result);
1636
1637 // Filter out any experiments that aren't enabled on the current platform. We
1638 // don't remove these from prefs else syncing to a platform with a different
1639 // set of experiments would be lossy.
1640 std::set<std::string> platform_experiments;
1641 int current_platform = GetCurrentPlatform();
1642 for (size_t i = 0; i < num_experiments; ++i) {
1643 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191644 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581645#if defined(OS_CHROMEOS)
1646 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1647 AddInternalName(experiments[i], &platform_experiments);
1648#endif
[email protected]a314ee5a2010-10-26 21:23:281649 }
1650
1651 std::set<std::string> new_enabled_experiments;
1652 std::set_intersection(
1653 platform_experiments.begin(), platform_experiments.end(),
1654 result->begin(), result->end(),
1655 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1656
1657 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051658}
1659
[email protected]8a6ff28d2010-12-02 16:35:191660// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191661Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221662 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441663 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1664 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191665 ListValue* result = new ListValue;
1666 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191667 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441668 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191669 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441670 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221671 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191672 result->Append(value);
1673 }
1674 return result;
1675}
1676
[email protected]e2ddbc92010-10-15 20:02:071677} // namespace
1678
[email protected]83e9fa702013-02-25 19:30:441679std::string Experiment::NameForChoice(int index) const {
1680 DCHECK(type == Experiment::MULTI_VALUE ||
1681 type == Experiment::ENABLE_DISABLE_VALUE);
1682 DCHECK_LT(index, num_choices);
1683 return std::string(internal_name) + testing::kMultiSeparator +
1684 base::IntToString(index);
1685}
1686
1687string16 Experiment::DescriptionForChoice(int index) const {
1688 DCHECK(type == Experiment::MULTI_VALUE ||
1689 type == Experiment::ENABLE_DISABLE_VALUE);
1690 DCHECK_LT(index, num_choices);
1691 int description_id;
1692 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1693 const int kEnableDisableDescriptionIds[] = {
1694 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1695 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1696 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1697 };
1698 description_id = kEnableDisableDescriptionIds[index];
1699 } else {
1700 description_id = choices[index].description_id;
1701 }
1702 return l10n_util::GetStringUTF16(description_id);
1703}
1704
[email protected]1a47d7e2010-10-15 00:37:241705void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551706 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051707}
1708
[email protected]ee28495a2013-05-20 04:10:521709void GetFlagsExperimentsData(PrefService* prefs,
1710 FlagAccess access,
1711 base::ListValue* supported_experiments,
1712 base::ListValue* unsupported_experiments) {
[email protected]ad2a3ded2010-08-27 13:19:051713 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241714 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051715
1716 int current_platform = GetCurrentPlatform();
1717
[email protected]a314ee5a2010-10-26 21:23:281718 for (size_t i = 0; i < num_experiments; ++i) {
1719 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051720
1721 DictionaryValue* data = new DictionaryValue();
1722 data->SetString("internal_name", experiment.internal_name);
1723 data->SetString("name",
1724 l10n_util::GetStringUTF16(experiment.visible_name_id));
1725 data->SetString("description",
1726 l10n_util::GetStringUTF16(
1727 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401728
1729 ListValue* supported_platforms = new ListValue();
1730 AddOsStrings(experiment.supported_platforms, supported_platforms);
1731 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051732
[email protected]28e35af2011-02-09 12:56:221733 switch (experiment.type) {
1734 case Experiment::SINGLE_VALUE:
1735 data->SetBoolean(
1736 "enabled",
1737 enabled_experiments.count(experiment.internal_name) > 0);
1738 break;
1739 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441740 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221741 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1742 break;
1743 default:
1744 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191745 }
1746
[email protected]ee28495a2013-05-20 04:10:521747 bool supported = (experiment.supported_platforms & current_platform) != 0;
1748#if defined(OS_CHROMEOS)
1749 if (access == kOwnerAccessToFlags &&
1750 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
1751 supported = true;
1752 }
1753#endif
1754 if (supported)
1755 supported_experiments->Append(data);
1756 else
1757 unsupported_experiments->Append(data);
[email protected]ad2a3ded2010-08-27 13:19:051758 }
[email protected]ad2a3ded2010-08-27 13:19:051759}
1760
[email protected]ad2a3ded2010-08-27 13:19:051761bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551762 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051763}
1764
1765void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351766 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551767 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071768}
1769
1770void RemoveFlagsSwitches(
1771 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551772 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071773}
1774
[email protected]cb93bf52013-02-20 01:20:001775void ResetAllFlags(PrefService* prefs) {
1776 FlagsState::GetInstance()->ResetAllFlags(prefs);
1777}
1778
[email protected]a314ee5a2010-10-26 21:23:281779int GetCurrentPlatform() {
1780#if defined(OS_MACOSX)
1781 return kOsMac;
1782#elif defined(OS_WIN)
1783 return kOsWin;
1784#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1785 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211786#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281787 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401788#elif defined(OS_ANDROID)
1789 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281790#else
1791#error Unknown platform
1792#endif
1793}
1794
[email protected]4bc5050c2010-11-18 17:55:541795void RecordUMAStatistics(const PrefService* prefs) {
1796 std::set<std::string> flags;
1797 GetEnabledFlags(prefs, &flags);
1798 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1799 ++it) {
1800 std::string action("AboutFlags_");
1801 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381802 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541803 }
1804 // Since flag metrics are recorded every startup, add a tick so that the
1805 // stats can be made meaningful.
1806 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381807 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1808 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541809}
1810
[email protected]e2ddbc92010-10-15 20:02:071811//////////////////////////////////////////////////////////////////////////////
1812// FlagsState implementation.
1813
1814namespace {
1815
[email protected]83e9fa702013-02-25 19:30:441816typedef std::map<std::string, std::pair<std::string, std::string> >
1817 NameToSwitchAndValueMap;
1818
1819void SetFlagToSwitchMapping(const std::string& key,
1820 const std::string& switch_name,
1821 const std::string& switch_value,
1822 NameToSwitchAndValueMap* name_to_switch_map) {
1823 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1824 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1825}
1826
[email protected]e2ddbc92010-10-15 20:02:071827void FlagsState::ConvertFlagsToSwitches(
1828 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071829 if (command_line->HasSwitch(switches::kNoExperiments))
1830 return;
1831
1832 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001833
[email protected]a314ee5a2010-10-26 21:23:281834 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071835
[email protected]a82744532011-02-11 16:15:531836 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191837 for (size_t i = 0; i < num_experiments; ++i) {
1838 const Experiment& e = experiments[i];
1839 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441840 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1841 e.command_line_value, &name_to_switch_map);
1842 } else if (e.type == Experiment::MULTI_VALUE) {
1843 for (int j = 0; j < e.num_choices; ++j) {
1844 SetFlagToSwitchMapping(e.NameForChoice(j),
1845 e.choices[j].command_line_switch,
1846 e.choices[j].command_line_value,
1847 &name_to_switch_map);
1848 }
[email protected]8a6ff28d2010-12-02 16:35:191849 } else {
[email protected]83e9fa702013-02-25 19:30:441850 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1851 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1852 &name_to_switch_map);
1853 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1854 e.command_line_value, &name_to_switch_map);
1855 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1856 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191857 }
1858 }
[email protected]e2ddbc92010-10-15 20:02:071859
1860 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531861 flags_switches_.insert(
1862 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1863 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071864 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1865 it != enabled_experiments.end();
1866 ++it) {
1867 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531868 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191869 name_to_switch_map.find(experiment_name);
1870 if (name_to_switch_it == name_to_switch_map.end()) {
1871 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071872 continue;
[email protected]8a6ff28d2010-12-02 16:35:191873 }
[email protected]e2ddbc92010-10-15 20:02:071874
[email protected]a82744532011-02-11 16:15:531875 const std::pair<std::string, std::string>&
1876 switch_and_value_pair = name_to_switch_it->second;
1877
1878 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1879 switch_and_value_pair.second);
1880 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071881 }
1882 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531883 flags_switches_.insert(
1884 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1885 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071886}
1887
1888bool FlagsState::IsRestartNeededToCommitChanges() {
1889 return needs_restart_;
1890}
1891
1892void FlagsState::SetExperimentEnabled(
1893 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441894 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191895 if (at_index != std::string::npos) {
1896 DCHECK(enable);
1897 // We're being asked to enable a multi-choice experiment. Disable the
1898 // currently selected choice.
1899 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221900 const std::string experiment_name = internal_name.substr(0, at_index);
1901 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191902
[email protected]28e35af2011-02-09 12:56:221903 // And enable the new choice, if it is not the default first choice.
1904 if (internal_name != experiment_name + "@0") {
1905 std::set<std::string> enabled_experiments;
1906 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081907 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221908 SetEnabledFlags(prefs, enabled_experiments);
1909 }
[email protected]8a6ff28d2010-12-02 16:35:191910 return;
1911 }
1912
[email protected]ad2a3ded2010-08-27 13:19:051913 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241914 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051915
[email protected]8a6ff28d2010-12-02 16:35:191916 const Experiment* e = NULL;
1917 for (size_t i = 0; i < num_experiments; ++i) {
1918 if (experiments[i].internal_name == internal_name) {
1919 e = experiments + i;
1920 break;
1921 }
1922 }
1923 DCHECK(e);
1924
1925 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591926 if (enable)
[email protected]147492b2013-03-19 23:52:081927 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591928 else
[email protected]147492b2013-03-19 23:52:081929 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191930 } else {
1931 if (enable) {
1932 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081933 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191934 } else {
1935 // Find the currently enabled choice and disable it.
1936 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441937 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191938 if (enabled_experiments.find(choice_name) !=
1939 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081940 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191941 enabled_experiments.erase(choice_name);
1942 // Continue on just in case there's a bug and more than one
1943 // experiment for this choice was enabled.
1944 }
1945 }
1946 }
1947 }
[email protected]ad2a3ded2010-08-27 13:19:051948
[email protected]1a47d7e2010-10-15 00:37:241949 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051950}
1951
[email protected]e2ddbc92010-10-15 20:02:071952void FlagsState::RemoveFlagsSwitches(
1953 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531954 for (std::map<std::string, std::string>::const_iterator
1955 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1956 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071957 }
1958}
1959
[email protected]cb93bf52013-02-20 01:20:001960void FlagsState::ResetAllFlags(PrefService* prefs) {
1961 needs_restart_ = true;
1962
1963 std::set<std::string> no_experiments;
1964 SetEnabledFlags(prefs, no_experiments);
1965}
1966
[email protected]e2ddbc92010-10-15 20:02:071967void FlagsState::reset() {
1968 needs_restart_ = false;
1969 flags_switches_.clear();
1970}
1971
[email protected]38e46812011-05-09 20:49:221972} // namespace
[email protected]e2ddbc92010-10-15 20:02:071973
1974namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191975
1976// WARNING: '@' is also used in the html file. If you update this constant you
1977// also need to update the html file.
1978const char kMultiSeparator[] = "@";
1979
[email protected]e2ddbc92010-10-15 20:02:071980void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551981 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071982}
[email protected]a314ee5a2010-10-26 21:23:281983
1984void SetExperiments(const Experiment* e, size_t count) {
1985 if (!e) {
1986 experiments = kExperiments;
1987 num_experiments = arraysize(kExperiments);
1988 } else {
1989 experiments = e;
1990 num_experiments = count;
1991 }
1992}
1993
[email protected]8a6ff28d2010-12-02 16:35:191994const Experiment* GetExperiments(size_t* count) {
1995 *count = num_experiments;
1996 return experiments;
1997}
1998
[email protected]e2ddbc92010-10-15 20:02:071999} // namespace testing
2000
[email protected]1a47d7e2010-10-15 00:37:242001} // namespace about_flags