blob: cbd734f6e3dbb5d95f797d350d134162b6308998 [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
[email protected]1fd1f292013-03-23 23:08:407#include <string.h>
8
[email protected]ad2a3ded2010-08-27 13:19:059#include <algorithm>
10#include <iterator>
11#include <map>
12#include <set>
[email protected]83e9fa702013-02-25 19:30:4413#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0514
[email protected]7d1d2092013-03-04 04:12:4315#include "apps/switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0516#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1517#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5718#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4119#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0320#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0521#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5222#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3823#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0324#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0525#include "chrome/common/chrome_switches.h"
[email protected]1fd1f292013-03-23 23:08:4026#include "chrome/common/chrome_version_info.h"
[email protected]ad2a3ded2010-08-27 13:19:0527#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3828#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0229#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0530#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0231#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0232#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0333#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1734#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5935#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4836#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2737#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2438#include "ui/keyboard/keyboard_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4339#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0540
[email protected]f1c39242013-01-29 16:13:0141#if defined(ENABLE_MESSAGE_CENTER)
42#include "ui/message_center/message_center_switches.h"
43#endif
44
[email protected]dc04be7c2012-03-15 23:57:4945#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3146#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4947#endif
48
[email protected]badba1ad2012-11-16 17:21:4649#if defined(OS_CHROMEOS)
50#include "chromeos/chromeos_switches.h"
51#endif
52
[email protected]7f6f44c2011-12-14 13:23:3853using content::UserMetricsAction;
54
[email protected]1a47d7e2010-10-15 00:37:2455namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0556
[email protected]8a6ff28d2010-12-02 16:35:1957// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5358#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4459 Experiment::SINGLE_VALUE, \
60 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5361#define SINGLE_VALUE_TYPE(command_line_switch) \
62 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4463#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
64 disable_switch, disable_value) \
65 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
66 disable_switch, disable_value, NULL, 3
67#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
68 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5369#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4470 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1971
[email protected]e2ddbc92010-10-15 20:02:0772namespace {
73
[email protected]9c7453d2012-01-21 00:45:4074const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5675const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0576
[email protected]cc3e2052011-12-20 01:01:4077// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
78// whether the experiment is available on that platform.
79void AddOsStrings(unsigned bitmask, ListValue* list) {
80 struct {
81 unsigned bit;
82 const char* const name;
83 } kBitsToOs[] = {
84 {kOsMac, "Mac"},
85 {kOsWin, "Windows"},
86 {kOsLinux, "Linux"},
87 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0188 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:5889 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[email protected]cc3e2052011-12-20 01:01:4090 };
91 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
92 if (bitmask & kBitsToOs[i].bit)
93 list->Append(new StringValue(kBitsToOs[i].name));
94}
95
[email protected]68317802012-06-07 19:13:2396const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
98 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
99 switches::kOmniboxHistoryQuickProviderNewScoring,
100 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
101 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
102 switches::kOmniboxHistoryQuickProviderNewScoring,
103 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
104};
105
[email protected]128dc6c2012-06-22 20:30:35106const Experiment::Choice
107 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
108 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
109 "",
110 "" },
111 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
112 switches::kOmniboxHistoryQuickProviderReorderForInlining,
113 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
114 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
115 switches::kOmniboxHistoryQuickProviderReorderForInlining,
116 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
117};
118
[email protected]032d5e6c2012-02-17 17:53:55119const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
120 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
121 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
122 switches::kOmniboxInlineHistoryQuickProvider,
123 switches::kOmniboxInlineHistoryQuickProviderAllowed },
124 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
125 switches::kOmniboxInlineHistoryQuickProvider,
126 switches::kOmniboxInlineHistoryQuickProviderProhibited }
127};
128
[email protected]fb854192013-02-06 01:30:04129const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
130 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
131 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
132 switches::kEnableCompositingForFixedPosition, ""},
133 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
134 switches::kDisableCompositingForFixedPosition, ""},
135 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
136 switches::kEnableHighDpiCompositingForFixedPosition, ""}
137};
138
[email protected]8b1c3c72013-01-25 01:48:43139const Experiment::Choice kGDIPresentChoices[] = {
140 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
141 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
142 switches::kDoFirstShowPresentWithGDI, ""},
143 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
144 switches::kDoAllShowPresentWithGDI, ""}
145};
146
[email protected]d7932532012-11-21 21:10:31147const Experiment::Choice kTouchEventsChoices[] = {
148 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
150 switches::kTouchEvents,
151 switches::kTouchEventsEnabled },
152 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
153 switches::kTouchEvents,
154 switches::kTouchEventsDisabled }
155};
156
[email protected]347a0c72012-05-14 20:28:06157const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31158 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20159 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06160 switches::kTouchOptimizedUI,
161 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20162 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06163 switches::kTouchOptimizedUI,
164 switches::kTouchOptimizedUIDisabled }
165};
166
[email protected]66f409c2012-10-04 20:59:04167const Experiment::Choice kNaClDebugMaskChoices[] = {
168 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
169 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
170 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
171 // an option to switch off its debugging.
172 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
173 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
174 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
175 switches::kNaClDebugMask, "*://*/*debug.nmf" }
176};
177
[email protected]ea2f3342012-09-21 21:13:36178#if defined(OS_CHROMEOS)
179const Experiment::Choice kAshBootAnimationFunction[] = {
180 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
181 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
182 ash::switches::kAshBootAnimationFunction2, ""},
183 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
184 ash::switches::kAshBootAnimationFunction3, ""}
185};
[email protected]d96aef22012-10-30 11:47:02186
187const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19188 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02189 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19190 switches::kEnableChromeCaptivePortalDetector, ""},
191 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
192 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02193};
[email protected]a78c7432013-03-13 06:22:43194
[email protected]ea2f3342012-09-21 21:13:36195#endif
196
[email protected]9323fdd12013-02-23 00:31:36197const Experiment::Choice kImplSidePaintingChoices[] = {
198 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
199 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
200 cc::switches::kEnableImplSidePainting, ""},
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
202 cc::switches::kDisableImplSidePainting, ""}
203};
204
[email protected]a42c85f2013-04-04 18:15:12205const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
206 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
207 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
208 cc::switches::kMaxTilesForInterestArea, "64"},
209 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
210 cc::switches::kMaxTilesForInterestArea, "128"},
211 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
212 cc::switches::kMaxTilesForInterestArea, "256"},
213 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
214 cc::switches::kMaxTilesForInterestArea, "512"}
215};
216
[email protected]38484df12013-04-10 16:42:03217const Experiment::Choice kSimpleCacheBackendChoices[] = {
218 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, "", "off" },
219 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
220 switches::kUseSimpleCacheBackend, "on"}
221};
222
[email protected]4bc5050c2010-11-18 17:55:54223// RECORDING USER METRICS FOR FLAGS:
224// -----------------------------------------------------------------------------
225// The first line of the experiment is the internal name. If you'd like to
226// gather statistics about the usage of your flag, you should append a marker
227// comment to the end of the feature name, like so:
228// "my-special-feature", // FLAGS:RECORD_UMA
229//
230// After doing that, run //chrome/tools/extract_actions.py (see instructions at
231// the top of that file for details) to update the chromeactions.txt file, which
232// will enable UMA to record your feature flag.
233//
[email protected]783d5bb2012-10-24 03:47:14234// After your feature has shipped under a flag, you can locate the metrics under
235// the action name AboutFlags_internal-action-name. Actions are recorded once
236// per startup, so you should divide this number by AboutFlags_StartupTick to
237// get a sense of usage. Note that this will not be the same as number of users
238// with a given feature enabled because users can quit and relaunch the
239// application multiple times over a given time interval. The dashboard also
240// shows you how many (metrics reporting) users have enabled the flag over the
241// last seven days. However, note that this is not the same as the number of
242// users who have the flag enabled, since enabling the flag happens once,
243// whereas running with the flag enabled happens until the user flips the flag
244// again.
[email protected]4bc5050c2010-11-18 17:55:54245
[email protected]8a6ff28d2010-12-02 16:35:19246// To add a new experiment add to the end of kExperiments. There are two
247// distinct types of experiments:
248// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
249// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22250// . MULTI_VALUE: a list of choices, the first of which should correspond to a
251// deactivated state for this lab (i.e. no command line option). To specify
252// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
253// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19254// See the documentation of Experiment for details on the fields.
255//
256// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05257const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44258#if defined(OS_ANDROID)
259 {
[email protected]199def22013-02-21 17:52:29260 "enable-spdy-proxy-auth",
261 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
262 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44263 kOsAndroid,
[email protected]199def22013-02-21 17:52:29264 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44265 },
266#endif
[email protected]ad2a3ded2010-08-27 13:19:05267 {
[email protected]aac169d2011-03-18 19:53:03268 "expose-for-tabs", // FLAGS:RECORD_UMA
269 IDS_FLAGS_TABPOSE_NAME,
270 IDS_FLAGS_TABPOSE_DESCRIPTION,
271 kOsMac,
272#if defined(OS_MACOSX)
273 // The switch exists only on OS X.
274 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
275#else
276 SINGLE_VALUE_TYPE("")
277#endif
278 },
279 {
[email protected]4bc5050c2010-11-18 17:55:54280 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05281 IDS_FLAGS_CONFLICTS_CHECK_NAME,
282 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
283 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19284 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05285 },
286 {
[email protected]4bc5050c2010-11-18 17:55:54287 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
289 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45290 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22291 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31292 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22293 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
294 // always have PDF rasterization available, so no flag needed there.
295#if !defined(GOOGLE_CHROME_BUILD)
296 kOsWin,
297#else
298 0,
[email protected]fa6d2a2f2010-11-30 21:47:19299#endif
[email protected]8a6ff28d2010-12-02 16:35:19300 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42301 },
[email protected]60d77bd2012-08-22 00:10:07302#if defined(OS_WIN)
303 {
304 "print-raster",
305 IDS_FLAGS_PRINT_RASTER_NAME,
306 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
307 kOsWin,
308 SINGLE_VALUE_TYPE(switches::kPrintRaster)
309 },
310#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05311 {
[email protected]96c6f4c2011-05-18 19:36:22312 "ignore-gpu-blacklist",
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
314 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
315 kOsAll,
316 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
317 },
318 {
[email protected]0110cf112011-07-02 00:39:43319 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22320 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
321 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23322 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44323 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
324 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22325 },
326 {
[email protected]72787e392012-03-23 05:55:43327 "threaded-compositing-mode",
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
329 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58330 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44331 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
332 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59333 },
334 {
[email protected]17e27692013-02-06 17:02:09335 "force-accelerated-composited-scrolling",
336 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
337 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
338 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44339 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
340 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09341 },
342 {
[email protected]8b1c3c72013-01-25 01:48:43343 "present-with-GDI",
344 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
345 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
346 kOsWin,
347 MULTI_VALUE_TYPE(kGDIPresentChoices)
348 },
349 {
[email protected]81c64af62012-06-06 20:15:52350 "disable-accelerated-2d-canvas",
351 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
352 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
353 kOsAll,
354 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
355 },
356 {
[email protected]efcde132012-05-30 01:05:18357 "disable-threaded-animation",
358 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
359 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59360 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37361 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59362 },
363 {
[email protected]5963b772011-02-09 22:55:38364 "composited-layer-borders",
365 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
366 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
367 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57368 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38369 },
370 {
[email protected]a8f1eaa2011-03-07 19:00:58371 "show-fps-counter",
372 IDS_FLAGS_SHOW_FPS_COUNTER,
373 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
374 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57375 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58376 },
[email protected]8ff7f342011-05-25 01:49:47377 {
[email protected]70c98a332011-12-21 20:51:52378 "accelerated-filters",
379 IDS_FLAGS_ACCELERATED_FILTERS,
380 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
381 kOsAll,
382 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
383 },
384 {
[email protected]8ff7f342011-05-25 01:49:47385 "disable-gpu-vsync",
386 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
387 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56388 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47389 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
390 },
[email protected]deaba6d52011-09-23 14:47:12391 {
[email protected]4052d832013-01-16 05:31:01392 "enable-webgl",
393 IDS_FLAGS_ENABLE_WEBGL_NAME,
394 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
395 kOsAndroid,
396#if defined(OS_ANDROID)
397 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
398#else
399 SINGLE_VALUE_TYPE("")
400#endif
401 },
402 {
[email protected]deaba6d52011-09-23 14:47:12403 "disable-webgl",
404 IDS_FLAGS_DISABLE_WEBGL_NAME,
405 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56406 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01407#if defined(OS_ANDROID)
408 SINGLE_VALUE_TYPE("")
409#else
[email protected]deaba6d52011-09-23 14:47:12410 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01411#endif
[email protected]deaba6d52011-09-23 14:47:12412 },
[email protected]09096e02012-05-24 11:12:04413 {
[email protected]ce585bf2013-03-14 16:25:16414 "disable-webrtc",
415 IDS_FLAGS_DISABLE_WEBRTC_NAME,
416 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05417 kOsAndroid,
418#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16419 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05420#else
421 SINGLE_VALUE_TYPE("")
422#endif
423 },
[email protected]34cb5292013-04-15 06:06:31424#if defined(OS_ANDROID)
425 {
426 "enable-webaudio",
427 IDS_FLAGS_ENABLE_WEBAUDIO_NAME,
428 IDS_FLAGS_ENABLE_WEBAUDIO_DESCRIPTION,
429 kOsAndroid,
430 SINGLE_VALUE_TYPE(switches::kEnableWebAudio)
431 },
432#endif
[email protected]d9da9582013-01-31 04:59:05433 {
[email protected]96bcdc102012-05-24 23:42:10434 "fixed-position-creates-stacking-context",
435 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
436 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
437 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44438 ENABLE_DISABLE_VALUE_TYPE(
439 switches::kEnableFixedPositionCreatesStackingContext,
440 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10441 },
[email protected]fb854192013-02-06 01:30:04442 {
443 "enable-compositing-for-fixed-position",
444 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
445 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
446 kOsAll,
447 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
448 },
[email protected]a7640ef22012-10-06 00:52:08449 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53450 {
[email protected]e3791ce92011-08-09 01:03:32451 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40452 IDS_FLAGS_ENABLE_NACL_NAME,
453 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56454 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19455 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40456 },
[email protected]4ff87d202010-11-06 01:28:40457 {
[email protected]9addd1c2012-09-15 14:28:24458 "enable-nacl-debug", // FLAGS:RECORD_UMA
459 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
460 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56461 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24462 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13463 },
464 {
[email protected]66f409c2012-10-04 20:59:04465 "nacl-debug-mask", // FLAGS:RECORD_UMA
466 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
467 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56468 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04469 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
470 },
471 {
[email protected]7babd1c2012-08-08 20:35:29472 "enable-pnacl", // FLAGS:RECORD_UMA
473 IDS_FLAGS_ENABLE_PNACL_NAME,
474 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56475 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29476 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
477 },
478 {
[email protected]4bc5050c2010-11-18 17:55:54479 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32480 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
481 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56482 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19483 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32484 },
[email protected]3627b06d2010-11-12 16:36:16485 {
[email protected]ac2e2acd2013-03-21 12:57:29486 "extensions-on-chrome-urls",
487 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
488 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
489 kOsAll,
490 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
491 },
492 {
[email protected]e9cddd52013-03-23 17:37:53493 "enable-adview",
494 IDS_FLAGS_ENABLE_ADVIEW_NAME,
495 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
496 kOsDesktop,
497 SINGLE_VALUE_TYPE(switches::kEnableAdview)
498 },
499 {
500 "enable-adview-src-attribute",
501 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
502 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
503 kOsDesktop,
504 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
505 },
506 {
[email protected]544471a2012-10-13 05:27:09507 "action-box",
[email protected]cab18ef2012-04-27 07:22:03508 IDS_FLAGS_ACTION_BOX_NAME,
509 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56510 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44511 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
512 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03513 },
514 {
[email protected]3a362432012-06-18 20:39:51515 "script-badges",
516 IDS_FLAGS_SCRIPT_BADGES_NAME,
517 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56518 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09519 SINGLE_VALUE_TYPE(switches::kScriptBadges)
520 },
521 {
522 "script-bubble",
523 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
524 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56525 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44526 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
527 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51528 },
529 {
[email protected]cbe224d2011-08-04 22:12:49530 "apps-new-install-bubble",
531 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
532 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56533 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49534 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
535 },
536 {
[email protected]80bd24e2010-11-30 09:34:38537 "disable-hyperlink-auditing",
538 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
539 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
540 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19541 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51542 },
543 {
544 "experimental-location-features", // FLAGS:RECORD_UMA
545 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
546 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
547 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19548 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
549 },
550 {
[email protected]5aea1862011-03-23 23:55:39551 "tab-groups-context-menu",
552 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
553 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
554 kOsWin,
555 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
556 },
[email protected]c94cebd2012-06-21 00:55:28557 {
558 "enable-instant-extended-api",
559 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
560 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56561 kOsDesktop,
[email protected]73444382013-02-26 19:31:51562 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
563 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28564 },
[email protected]e9bf9d92011-03-31 20:57:15565 {
[email protected]07fd48a2013-04-13 02:53:27566 "enable-local-only-instant-extended-api",
567 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
568 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
569 kOsDesktop,
570 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
571 switches::kDisableLocalOnlyInstantExtendedAPI)
572 },
573 {
[email protected]354e33b2011-06-15 00:29:10574 "static-ip-config",
575 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
576 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
577 kOsCrOS,
578#if defined(OS_CHROMEOS)
579 // This switch exists only on Chrome OS.
580 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
581#else
582 SINGLE_VALUE_TYPE("")
583#endif
584 },
[email protected]3eb5728c2011-06-20 22:32:24585 {
586 "show-autofill-type-predictions",
587 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
588 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
589 kOsAll,
[email protected]e217c5632013-04-12 19:11:48590 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24591 },
[email protected]bff4d3e2011-06-21 23:58:52592 {
[email protected]a5e9faa2013-03-19 09:58:38593 "enable-sync-favicons",
594 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
595 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55596 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38597 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55598 },
599 {
[email protected]5d90a0a2012-11-15 02:43:40600 "sync-keystore-encryption",
601 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
602 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
603 kOsAll,
604 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
605 },
606 {
[email protected]e755a382012-09-13 17:16:35607 "enable-gesture-tap-highlight",
608 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
609 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
610 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47611 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
612 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35613 },
614 {
[email protected]a22ebd812011-06-23 00:05:39615 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
616 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
617 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
618 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40619 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25620 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39621 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
622 },
[email protected]81a6b0b2011-06-24 17:55:40623 {
[email protected]68317802012-06-07 19:13:23624 "omnibox-history-quick-provider-new-scoring",
625 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
626 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
627 kOsAll,
628 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
629 },
630 {
[email protected]128dc6c2012-06-22 20:30:35631 "omnibox-history-quick-provider-reorder-for-inlining",
632 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
633 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
634 kOsAll,
635 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
636 },
637 {
[email protected]032d5e6c2012-02-17 17:53:55638 "omnibox-inline-history-quick-provider",
639 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
640 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
641 kOsAll,
642 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
643 },
644 {
[email protected]7e7a28092011-12-09 22:24:55645 "enable-panels",
646 IDS_FLAGS_ENABLE_PANELS_NAME,
647 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56648 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55649 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54650 },
[email protected]e3749d12011-07-25 22:22:12651 {
[email protected]27c14f02012-06-22 17:29:58652 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27653 "save-page-as-mhtml", // FLAGS:RECORD_UMA
654 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
655 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
656 kOsMac | kOsWin | kOsLinux,
657 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
658 },
659 {
[email protected]b7bb44f2011-09-01 05:17:03660 "enable-autologin",
661 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
662 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
663 kOsMac | kOsWin | kOsLinux,
664 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
665 },
[email protected]b9841172011-09-26 23:36:09666 {
[email protected]18cf89d2013-04-12 02:42:32667 "enable-spdy4a1",
668 IDS_FLAGS_ENABLE_SPDY4A1_NAME,
669 IDS_FLAGS_ENABLE_SPDY4A1_DESCRIPTION,
670 kOsAll,
671 SINGLE_VALUE_TYPE(switches::kEnableSpdy4a1)
672 },
673 {
[email protected]27b3fe92012-03-21 05:35:06674 "enable-async-dns",
675 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
676 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46677 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44678 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
679 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06680 },
681 {
[email protected]1eb93802012-09-11 18:57:56682 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11683 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
684 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32685 kOsAll,
[email protected]da43c082012-09-07 18:56:11686 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44687 },
[email protected]e4e68dbb2011-11-18 01:50:22688 {
[email protected]36d98412013-01-31 20:28:53689 "disable-encrypted-media",
690 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
691 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56692 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53693 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03694 },
[email protected]f88628792012-12-18 07:07:50695 {
696 "enable-opus-playback",
697 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
698 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56699 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50700 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
701 },
[email protected]ca6eaa5a2013-01-24 16:16:04702 {
[email protected]c54e1aa2013-01-25 09:26:17703 "enable-vp9-playback",
704 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
705 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
706 kOsDesktop,
707 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
708 },
709 {
[email protected]ca6eaa5a2013-01-24 16:16:04710 "enable-managed-users",
711 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
712 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58713 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04714 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
715 },
[email protected]dc04be7c2012-03-15 23:57:49716#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50717 {
[email protected]2a13a9a2013-04-19 04:00:21718 "ash-disable-auto-maximizing",
719 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
720 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
721 kOsWin | kOsLinux | kOsCrOS,
722 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
723 },
724 {
[email protected]cda278d2012-10-30 20:31:40725 "ash-disable-auto-window-placement",
726 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
727 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
728 kOsWin | kOsLinux | kOsCrOS,
729 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
730 },
[email protected]b4e4ec42012-11-29 21:42:40731 {
[email protected]16f55a22013-02-13 23:47:34732 "ash-disable-per-app-launcher",
733 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
734 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40735 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34736 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40737 },
[email protected]dc04be7c2012-03-15 23:57:49738#endif
[email protected]eaae8b462012-01-20 22:20:39739 {
[email protected]db543d322011-12-15 20:40:15740 "per-tile-painting",
741 IDS_FLAGS_PER_TILE_PAINTING_NAME,
742 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37743 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37744 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15745 },
[email protected]bf88c032011-12-22 19:05:47746 {
747 "enable-javascript-harmony",
748 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
749 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
750 kOsAll,
751 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
752 },
[email protected]7e7f378a2012-01-05 14:35:37753 {
[email protected]85646172012-01-09 22:45:54754 "enable-tab-browser-dragging",
755 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
756 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
757 kOsWin,
758 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
759 },
760 {
[email protected]068b7b52012-02-27 12:41:44761 "disable-restore-session-state",
762 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
763 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37764 kOsAll,
[email protected]068b7b52012-02-27 12:41:44765 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37766 },
[email protected]88864db2012-01-18 20:56:35767 {
768 "disable-software-rasterizer",
769 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
770 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
771#if defined(ENABLE_SWIFTSHADER)
772 kOsAll,
773#else
774 0,
775#endif
776 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
777 },
[email protected]15a5d722012-01-23 09:11:14778 {
[email protected]ff7b6dd2012-09-15 20:20:03779 "enable-experimental-webkit-features",
780 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
781 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16782 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03783 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49784 },
785 {
[email protected]0f95a252012-09-13 22:30:04786 "enable-css-shaders",
787 IDS_FLAGS_CSS_SHADERS_NAME,
788 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
789 kOsAll,
790 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
791 },
792 {
[email protected]9860c68b2012-02-02 01:58:09793 "enable-extension-activity-ui",
794 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
795 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56796 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09797 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00798 },
[email protected]54ae4e92012-02-16 15:19:05799 {
[email protected]3e8befc2012-03-13 01:17:03800 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16801 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
802 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56803 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03804 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16805 },
[email protected]dc04be7c2012-03-15 23:57:49806#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01807 {
[email protected]3cd198a22012-03-12 20:38:01808 "enable-ash-oak",
809 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
810 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
811 kOsAll,
812 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
813 },
[email protected]31cf1c52012-02-29 20:55:01814#endif
[email protected]184ec592012-03-01 11:54:28815 {
816 "enable-devtools-experiments",
817 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
818 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56819 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28820 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
821 },
[email protected]76d1854e2012-03-02 23:57:44822 {
[email protected]2fefdb32013-02-26 14:28:10823 "silent-debugger-extension-api",
824 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
825 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
826 kOsDesktop,
827 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
828 },
829 {
[email protected]76d1854e2012-03-02 23:57:44830 "enable-suggestions-ntp",
831 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
832 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56833 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44834 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
835 },
[email protected]a3d54252012-04-05 20:04:13836 {
[email protected]1dbaf5e2012-11-30 05:51:32837 "spellcheck-autocorrect",
838 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
839 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
840 kOsWin | kOsLinux | kOsCrOS,
841 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
842 },
843 {
[email protected]d7932532012-11-21 21:10:31844 "touch-events",
845 IDS_TOUCH_EVENTS_NAME,
846 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56847 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31848 MULTI_VALUE_TYPE(kTouchEventsChoices)
849 },
850 {
[email protected]c9c73ad42012-04-18 03:35:59851 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06852 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
853 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55854 kOsWin,
[email protected]347a0c72012-05-14 20:28:06855 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59856 },
[email protected]8a6aaa72012-04-20 20:53:58857 {
[email protected]b9c96ff2012-11-26 22:24:40858 "disable-touch-adjustment",
859 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
860 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
861 kOsWin | kOsLinux | kOsCrOS,
862 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
863 },
864 {
[email protected]0b9383a2012-10-26 00:58:16865 "enable-tab-capture",
866 IDS_ENABLE_TAB_CAPTURE_NAME,
867 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25868 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44869 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
870 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16871 },
[email protected]0b60afa2012-04-19 17:36:39872#if defined(OS_CHROMEOS)
873 {
[email protected]7c4a9bc2012-09-11 22:10:05874 "enable-background-loader",
875 IDS_ENABLE_BACKLOADER_NAME,
876 IDS_ENABLE_BACKLOADER_DESCRIPTION,
877 kOsCrOS,
878 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
879 },
880 {
[email protected]c5667b282012-08-31 00:32:50881 "enable-bezel-touch",
882 IDS_ENABLE_BEZEL_TOUCH_NAME,
883 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47884 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50885 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47886 },
887 {
[email protected]3f4181a2013-02-01 21:31:07888 "enable-screensaver-extension",
889 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
890 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
891 kOsCrOS,
892 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
893 },
894 {
[email protected]0b60afa2012-04-19 17:36:39895 "no-discard-tabs",
896 IDS_FLAGS_NO_DISCARD_TABS_NAME,
897 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
898 kOsCrOS,
899 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
900 },
901#endif
[email protected]79be6d32012-04-24 20:47:44902 {
[email protected]8d68a3e02013-01-12 15:57:10903 "enable-download-resumption",
904 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
905 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56906 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10907 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
908 },
909 {
[email protected]9a5940d2012-04-27 19:16:23910 "allow-nacl-socket-api",
911 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
912 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56913 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23914 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
915 },
[email protected]85333732012-05-01 19:02:24916 {
[email protected]60673ad72012-05-02 06:16:33917 "stacked-tab-strip",
918 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
919 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
920 kOsWin,
921 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
922 },
923 {
[email protected]4bd20202012-06-14 17:35:01924 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24925 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
926 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
927 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01928 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24929 },
[email protected]190349fd2012-05-02 00:10:47930#if defined(OS_CHROMEOS)
931 {
932 "allow-touchpad-three-finger-click",
933 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
934 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
935 kOsCrOS,
936 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
937 },
[email protected]fbc176b62012-10-27 02:19:58938 {
939 "allow-touchpad-three-finger-swipe",
940 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
941 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
942 kOsCrOS,
943 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
944 },
[email protected]190349fd2012-05-02 00:10:47945#endif
[email protected]1992a2f42012-10-23 18:32:21946 {
[email protected]a585e462013-01-26 00:37:15947 "use-client-login-signin-flow",
948 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
949 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21950 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15951 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21952 },
[email protected]8ee02242012-12-04 15:23:32953 {
954 "enable-desktop-guest-mode",
955 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
956 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
957 kOsMac | kOsWin | kOsLinux,
958 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
959 },
[email protected]53520b1b2012-05-07 21:43:37960#if defined(USE_ASH)
961 {
[email protected]8257d382013-03-26 13:08:42962 "show-launcher-alignment-menu",
963 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
964 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42965 kOsAll,
[email protected]8257d382013-03-26 13:08:42966 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42967 },
968 {
[email protected]73074742012-05-17 01:44:41969 "show-touch-hud",
970 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
971 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
972 kOsAll,
973 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
974 },
975 {
[email protected]9f0940b62012-05-23 22:56:35976 "enable-pinch",
977 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
978 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06979 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38980 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
981 },
982 {
983 "pinch-zoom-scrollbars",
984 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
985 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
986 kOsCrOS,
987 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
988 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:35989 },
[email protected]a8379312012-06-15 00:20:43990 {
991 "app-list-show-apps-only",
992 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
993 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
994 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03995 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43996 },
[email protected]73074742012-05-17 01:44:41997#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28998#if defined(OS_CHROMEOS)
999 {
[email protected]8b04a1652012-08-04 02:59:491000 "disable-boot-animation",
1001 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1002 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581003 kOsCrOSOwnerOnly,
[email protected]8b04a1652012-08-04 02:59:491004 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
1005 },
[email protected]95058572012-08-20 14:57:291006 {
[email protected]b4557192012-09-19 11:29:581007 "disable-boot-animation2",
1008 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1009 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581010 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581011 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1012 },
1013 {
[email protected]ea2f3342012-09-21 21:13:361014 "boot-animation-fucntion",
1015 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1016 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581017 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361018 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1019 },
[email protected]839667d62012-10-23 19:38:571020 {
[email protected]d96aef22012-10-30 11:47:021021 "captive-portal-detector",
1022 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1023 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581024 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021025 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1026 },
1027 {
[email protected]c11aa8f12012-12-18 18:43:141028 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571029 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1030 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1031 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141032 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571033 },
[email protected]f0280952012-11-06 20:30:501034 {
[email protected]ea2fab32013-04-16 06:55:021035 "file-manager-legacy",
1036 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1037 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231038 kOsCrOS,
[email protected]ea2fab32013-04-16 06:55:021039 SINGLE_VALUE_TYPE(switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231040 },
[email protected]3e035e82012-11-27 20:54:321041 {
[email protected]bc545292013-04-18 14:33:101042 "file-manager-new-ui",
1043 IDS_FLAGS_FILE_MANAGER_NEW_UI_NAME,
1044 IDS_FLAGS_FILE_MANAGER_NEW_UI_DESCRIPTION,
1045 kOsCrOS,
1046 SINGLE_VALUE_TYPE(switches::kFileManagerNewUI),
1047 },
1048 {
[email protected]8039e06c2013-01-17 23:34:501049 "disable-launcher-per-display",
1050 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1051 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351052 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501053 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351054 },
[email protected]06b146d2013-02-07 06:06:471055 {
[email protected]c64d7732013-03-25 18:09:501056 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521057 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1058 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581059 kOsCrOSOwnerOnly,
[email protected]640aa2b2013-03-22 16:00:521060 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471061 },
[email protected]6ad015c2013-03-06 00:49:511062 {
[email protected]c64d7732013-03-25 18:09:501063 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521064 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1065 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511066 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521067 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511068 },
[email protected]62018dc2012-12-13 00:37:351069#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391070 {
[email protected]6247aba2013-03-04 22:57:181071 "views-textfield",
1072 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1073 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391074 kOsWin,
[email protected]6247aba2013-03-04 22:57:181075 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1076 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391077 },
[email protected]bd0cd3bb2012-06-14 03:03:381078 {
[email protected]2d4817742012-12-17 20:16:181079 "enable-new-dialog-style",
1080 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1081 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321082 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181083 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321084 },
[email protected]7db8893a2012-07-26 00:49:401085 { "disable-accelerated-video-decode",
1086 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1087 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561088 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401089 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151090 },
[email protected]66ae9fc2012-06-19 21:33:521091#if defined(USE_ASH)
1092 {
1093 "ash-debug-shortcuts",
1094 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1095 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1096 kOsAll,
1097 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1098 },
1099#endif
[email protected]37fee0942012-08-07 21:07:451100 {
[email protected]ad3f6d22012-08-29 02:34:191101 "enable-contacts",
1102 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1103 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1104 kOsCrOS,
1105 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1106 },
[email protected]1d9bb9cd2012-08-28 22:02:501107#if defined(USE_ASH)
1108 { "ash-enable-advanced-gestures",
1109 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1110 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1111 kOsCrOS,
1112 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1113 },
[email protected]cfa24e62013-02-13 21:19:111114 { "ash-disable-tab-scrubbing",
1115 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1116 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161117 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111118 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161119 },
[email protected]83eef802012-12-02 07:43:521120 { "ash-enable-workspace-scrubbing",
1121 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1122 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1123 kOsCrOS,
1124 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1125 },
[email protected]819e58d22013-03-20 00:16:111126 { "ash-immersive-fullscreen",
1127 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1128 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241129 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111130 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241131 },
[email protected]316708a2012-11-05 22:57:021132#if defined(OS_LINUX)
1133 { "ash-enable-memory-monitor",
1134 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1135 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1136 kOsCrOS,
1137 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1138 },
1139#endif
[email protected]1d9bb9cd2012-08-28 22:02:501140#endif
[email protected]9b7ab882012-09-10 23:46:361141#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091142 { "ash-disable-new-network-status-area",
1143 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1144 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461145 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091146 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461147 },
[email protected]9b7ab882012-09-10 23:46:361148 {
[email protected]205f07892012-10-16 20:26:221149 "enable-carrier-switching",
1150 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1151 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1152 kOsCrOS,
1153 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1154 },
1155 {
[email protected]9b7ab882012-09-10 23:46:361156 "enable-request-tablet-site",
1157 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1158 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1159 kOsCrOS,
1160 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1161 },
1162#endif
[email protected]dab49c0b2012-10-04 05:55:351163 {
1164 "debug-packed-apps",
1165 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1166 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561167 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351168 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1169 },
[email protected]d1459ed2012-10-10 01:29:331170 {
1171 "enable-password-generation",
1172 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1173 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561174 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331175 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1176 },
[email protected]26d045f2012-10-18 21:18:431177 {
[email protected]76f7d4882012-10-26 21:09:221178 "enable-deferred-image-decoding",
1179 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1180 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221181 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221182 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1183 },
1184 {
[email protected]075543d2012-10-24 01:29:141185 "performance-monitor-gathering",
1186 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1187 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1188 kOsAll,
1189 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1190 },
[email protected]783d5bb2012-10-24 03:47:141191 {
[email protected]90b482d2013-04-04 10:45:581192 "disable-native-autofill-ui",
1193 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1194 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431195 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581196 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431197 },
1198 {
[email protected]99002fd2012-11-06 04:35:521199 "show-app-list-shortcut",
1200 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1201 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1202 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431203 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521204 },
[email protected]a7259fb2012-11-08 06:22:231205 {
1206 "enable-experimental-form-filling",
1207 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1208 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1209 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481210 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231211 },
[email protected]6e6efe42013-01-30 00:04:501212 {
[email protected]db3178c2013-03-21 14:54:541213 "wallet-service-use-prod",
1214 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1215 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1216 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481217 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541218 },
1219 {
[email protected]6e6efe42013-01-30 00:04:501220 "enable-interactive-autocomplete",
1221 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1222 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221223 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501224 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1225 },
[email protected]edbea622012-11-28 20:39:381226 {
1227 "enable-touch-drag-drop",
1228 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1229 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1230 kOsWin | kOsCrOS,
1231 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1232 },
[email protected]0e2f43b62013-02-21 00:47:151233 {
1234 "enable-touch-editing",
1235 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1236 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1237 kOsCrOS,
1238 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1239 },
[email protected]f1c39242013-01-29 16:13:011240#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201241 {
1242 "enable-rich-notifications",
1243 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1244 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1245 kOsWin | kOsCrOS,
[email protected]aee412aa2013-04-02 20:01:231246 ENABLE_DISABLE_VALUE_TYPE(
1247 message_center::switches::kEnableRichNotifications,
1248 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201249 },
[email protected]f1c39242013-01-29 16:13:011250#endif
[email protected]4d51c682012-12-11 11:34:551251 {
1252 "full-history-sync",
1253 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1254 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1255 kOsAll,
1256 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1257 },
[email protected]628a69a92012-12-23 04:09:341258 {
[email protected]fd030142013-02-08 02:04:381259 "enable-usermedia-screen-capture",
1260 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1261 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1262 kOsDesktop,
1263 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1264 },
[email protected]5b93e162013-02-19 06:33:091265 {
1266 "enable-apps-devtool-app",
1267 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1268 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1269 kOsDesktop,
1270 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1271 },
[email protected]9323fdd12013-02-23 00:31:361272 {
1273 "impl-side-painting",
1274 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1275 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041276 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361277 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1278 },
[email protected]a42c85f2013-04-04 18:15:121279 {
[email protected]1c92d3e2013-04-18 05:31:391280 "enable-websocket-experimental-implementation",
1281 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1282 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1283 kOsAll,
1284 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1285 },
1286 {
[email protected]a42c85f2013-04-04 18:15:121287 "max-tiles-for-interest-area",
1288 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1289 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1290 kOsAndroid | kOsLinux | kOsCrOS,
1291 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1292 },
[email protected]2f2f72b2013-03-08 22:37:311293 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1294#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371295 {
1296 "track-active-visit-time",
1297 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1298 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1299 kOsWin,
1300 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1301 },
[email protected]2f2f72b2013-03-08 22:37:311302#endif
[email protected]8cc71d42013-03-02 17:26:081303#if defined(OS_ANDROID)
1304 {
1305 "disable-gesture-requirement-for-media-playback",
1306 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1307 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1308 kOsAndroid,
1309 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1310 },
1311#endif
[email protected]e79f2fd52013-03-08 23:52:471312#if defined(OS_CHROMEOS)
1313 {
1314 "enable-experimental-bluetooth",
1315 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1316 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1317 kOsCrOS,
1318 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1319 },
1320#endif
[email protected]6077cab2013-03-11 19:36:141321#if defined(ENABLE_GOOGLE_NOW)
1322 {
1323 "enable-google-now",
1324 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1325 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1326 kOsWin | kOsCrOS,
1327 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1328 },
1329#endif
[email protected]4a9e2e02013-04-08 16:19:491330 {
1331 "enable-translate-alpha-languages",
1332 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1333 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1334 kOsAll,
1335 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1336 },
[email protected]86459e2c2013-04-10 13:39:241337#if defined(OS_CHROMEOS)
1338 {
1339 "enable-virtual-keyboard",
1340 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1341 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1342 kOsCrOS,
1343 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1344 },
1345#endif
[email protected]38484df12013-04-10 16:42:031346 {
1347 "enable-simple-cache-backend",
1348 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1349 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1350 kOsAndroid,
1351 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1352 },
[email protected]717e4e22013-04-10 20:52:231353 {
1354 "enable-tcp-fast-open",
1355 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1356 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111357 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231358 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1359 },
[email protected]8027acd2013-04-18 08:35:151360 {
1361 "enable-webp-in-accept-header",
1362 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1363 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1364 kOsAll,
1365 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1366 },
[email protected]a0e4b072011-08-17 01:47:071367};
[email protected]ad2a3ded2010-08-27 13:19:051368
[email protected]a314ee5a2010-10-26 21:23:281369const Experiment* experiments = kExperiments;
1370size_t num_experiments = arraysize(kExperiments);
1371
[email protected]e2ddbc92010-10-15 20:02:071372// Stores and encapsulates the little state that about:flags has.
1373class FlagsState {
1374 public:
1375 FlagsState() : needs_restart_(false) {}
1376 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1377 bool IsRestartNeededToCommitChanges();
1378 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281379 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071380 void RemoveFlagsSwitches(
1381 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001382 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071383 void reset();
1384
1385 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551386 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071387 return Singleton<FlagsState>::get();
1388 }
1389
1390 private:
1391 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531392 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071393
1394 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1395};
1396
[email protected]c7b7800a2010-10-07 18:51:351397// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491398// in a set.
[email protected]1a47d7e2010-10-15 00:37:241399void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051400 const ListValue* enabled_experiments = prefs->GetList(
1401 prefs::kEnabledLabsExperiments);
1402 if (!enabled_experiments)
1403 return;
1404
1405 for (ListValue::const_iterator it = enabled_experiments->begin();
1406 it != enabled_experiments->end();
1407 ++it) {
1408 std::string experiment_name;
1409 if (!(*it)->GetAsString(&experiment_name)) {
1410 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1411 continue;
1412 }
1413 result->insert(experiment_name);
1414 }
1415}
1416
[email protected]c6343372013-03-13 17:05:491417// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241418void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051419 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381420 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1421 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051422
1423 experiments_list->Clear();
1424 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1425 it != enabled_experiments.end();
1426 ++it) {
1427 experiments_list->Append(new StringValue(*it));
1428 }
1429}
1430
[email protected]8a6ff28d2010-12-02 16:35:191431// Adds the internal names for the specified experiment to |names|.
1432void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1433 if (e.type == Experiment::SINGLE_VALUE) {
1434 names->insert(e.internal_name);
1435 } else {
[email protected]83e9fa702013-02-25 19:30:441436 DCHECK(e.type == Experiment::MULTI_VALUE ||
1437 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191438 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441439 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191440 }
1441}
1442
[email protected]28e35af2011-02-09 12:56:221443// Confirms that an experiment is valid, used in a DCHECK in
1444// SanitizeList below.
1445bool ValidateExperiment(const Experiment& e) {
1446 switch (e.type) {
1447 case Experiment::SINGLE_VALUE:
1448 DCHECK_EQ(0, e.num_choices);
1449 DCHECK(!e.choices);
1450 break;
1451 case Experiment::MULTI_VALUE:
1452 DCHECK_GT(e.num_choices, 0);
1453 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531454 DCHECK(e.choices[0].command_line_switch);
1455 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221456 break;
[email protected]83e9fa702013-02-25 19:30:441457 case Experiment::ENABLE_DISABLE_VALUE:
1458 DCHECK_EQ(3, e.num_choices);
1459 DCHECK(!e.choices);
1460 DCHECK(e.command_line_switch);
1461 DCHECK(e.command_line_value);
1462 DCHECK(e.disable_command_line_switch);
1463 DCHECK(e.disable_command_line_value);
1464 break;
[email protected]28e35af2011-02-09 12:56:221465 default:
1466 NOTREACHED();
1467 }
1468 return true;
1469}
1470
[email protected]ad2a3ded2010-08-27 13:19:051471// Removes all experiments from prefs::kEnabledLabsExperiments that are
1472// unknown, to prevent this list to become very long as experiments are added
1473// and removed.
1474void SanitizeList(PrefService* prefs) {
1475 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221476 for (size_t i = 0; i < num_experiments; ++i) {
1477 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191478 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221479 }
[email protected]ad2a3ded2010-08-27 13:19:051480
1481 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241482 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051483
1484 std::set<std::string> new_enabled_experiments;
1485 std::set_intersection(
1486 known_experiments.begin(), known_experiments.end(),
1487 enabled_experiments.begin(), enabled_experiments.end(),
1488 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1489
[email protected]4c8853f2012-07-23 01:29:161490 if (new_enabled_experiments != enabled_experiments)
1491 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051492}
1493
[email protected]1a47d7e2010-10-15 00:37:241494void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051495 PrefService* prefs, std::set<std::string>* result) {
1496 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241497 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051498}
1499
[email protected]a314ee5a2010-10-26 21:23:281500// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1501// enabled on the current platform.
1502void GetSanitizedEnabledFlagsForCurrentPlatform(
1503 PrefService* prefs, std::set<std::string>* result) {
1504 GetSanitizedEnabledFlags(prefs, result);
1505
1506 // Filter out any experiments that aren't enabled on the current platform. We
1507 // don't remove these from prefs else syncing to a platform with a different
1508 // set of experiments would be lossy.
1509 std::set<std::string> platform_experiments;
1510 int current_platform = GetCurrentPlatform();
1511 for (size_t i = 0; i < num_experiments; ++i) {
1512 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191513 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581514#if defined(OS_CHROMEOS)
1515 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1516 AddInternalName(experiments[i], &platform_experiments);
1517#endif
[email protected]a314ee5a2010-10-26 21:23:281518 }
1519
1520 std::set<std::string> new_enabled_experiments;
1521 std::set_intersection(
1522 platform_experiments.begin(), platform_experiments.end(),
1523 result->begin(), result->end(),
1524 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1525
1526 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051527}
1528
[email protected]8a6ff28d2010-12-02 16:35:191529// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191530Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221531 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441532 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1533 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191534 ListValue* result = new ListValue;
1535 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191536 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441537 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191538 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441539 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221540 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191541 result->Append(value);
1542 }
1543 return result;
1544}
1545
[email protected]e2ddbc92010-10-15 20:02:071546} // namespace
1547
[email protected]83e9fa702013-02-25 19:30:441548std::string Experiment::NameForChoice(int index) const {
1549 DCHECK(type == Experiment::MULTI_VALUE ||
1550 type == Experiment::ENABLE_DISABLE_VALUE);
1551 DCHECK_LT(index, num_choices);
1552 return std::string(internal_name) + testing::kMultiSeparator +
1553 base::IntToString(index);
1554}
1555
1556string16 Experiment::DescriptionForChoice(int index) const {
1557 DCHECK(type == Experiment::MULTI_VALUE ||
1558 type == Experiment::ENABLE_DISABLE_VALUE);
1559 DCHECK_LT(index, num_choices);
1560 int description_id;
1561 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1562 const int kEnableDisableDescriptionIds[] = {
1563 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1564 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1565 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1566 };
1567 description_id = kEnableDisableDescriptionIds[index];
1568 } else {
1569 description_id = choices[index].description_id;
1570 }
1571 return l10n_util::GetStringUTF16(description_id);
1572}
1573
[email protected]1a47d7e2010-10-15 00:37:241574void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551575 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051576}
1577
[email protected]37736bd2013-04-18 11:53:581578ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051579 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241580 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051581
1582 int current_platform = GetCurrentPlatform();
1583
1584 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281585 for (size_t i = 0; i < num_experiments; ++i) {
1586 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051587
[email protected]1fd1f292013-03-23 23:08:401588#if defined(OS_ANDROID)
1589 // Special case enable-spdy-proxy-auth, because it should only
1590 // be available on Dev and Beta channels.
1591 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1592 chrome::VersionInfo::GetChannel() ==
1593 chrome::VersionInfo::CHANNEL_STABLE)
1594 continue;
1595#endif
1596
[email protected]ad2a3ded2010-08-27 13:19:051597 DictionaryValue* data = new DictionaryValue();
1598 data->SetString("internal_name", experiment.internal_name);
1599 data->SetString("name",
1600 l10n_util::GetStringUTF16(experiment.visible_name_id));
1601 data->SetString("description",
1602 l10n_util::GetStringUTF16(
1603 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581604 bool supported = (experiment.supported_platforms & current_platform) != 0;
1605#if defined(OS_CHROMEOS)
1606 if (access == kOwnerAccessToFlags &&
1607 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1608 supported = true;
1609#endif
[email protected]cc3e2052011-12-20 01:01:401610 data->SetBoolean("supported", supported);
1611
1612 ListValue* supported_platforms = new ListValue();
1613 AddOsStrings(experiment.supported_platforms, supported_platforms);
1614 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051615
[email protected]28e35af2011-02-09 12:56:221616 switch (experiment.type) {
1617 case Experiment::SINGLE_VALUE:
1618 data->SetBoolean(
1619 "enabled",
1620 enabled_experiments.count(experiment.internal_name) > 0);
1621 break;
1622 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441623 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221624 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1625 break;
1626 default:
1627 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191628 }
1629
[email protected]ad2a3ded2010-08-27 13:19:051630 experiments_data->Append(data);
1631 }
1632 return experiments_data;
1633}
1634
[email protected]ad2a3ded2010-08-27 13:19:051635bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551636 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051637}
1638
1639void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351640 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551641 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071642}
1643
1644void RemoveFlagsSwitches(
1645 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551646 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071647}
1648
[email protected]cb93bf52013-02-20 01:20:001649void ResetAllFlags(PrefService* prefs) {
1650 FlagsState::GetInstance()->ResetAllFlags(prefs);
1651}
1652
[email protected]a314ee5a2010-10-26 21:23:281653int GetCurrentPlatform() {
1654#if defined(OS_MACOSX)
1655 return kOsMac;
1656#elif defined(OS_WIN)
1657 return kOsWin;
1658#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1659 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211660#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281661 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401662#elif defined(OS_ANDROID)
1663 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281664#else
1665#error Unknown platform
1666#endif
1667}
1668
[email protected]4bc5050c2010-11-18 17:55:541669void RecordUMAStatistics(const PrefService* prefs) {
1670 std::set<std::string> flags;
1671 GetEnabledFlags(prefs, &flags);
1672 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1673 ++it) {
1674 std::string action("AboutFlags_");
1675 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381676 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541677 }
1678 // Since flag metrics are recorded every startup, add a tick so that the
1679 // stats can be made meaningful.
1680 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381681 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1682 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541683}
1684
[email protected]e2ddbc92010-10-15 20:02:071685//////////////////////////////////////////////////////////////////////////////
1686// FlagsState implementation.
1687
1688namespace {
1689
[email protected]83e9fa702013-02-25 19:30:441690typedef std::map<std::string, std::pair<std::string, std::string> >
1691 NameToSwitchAndValueMap;
1692
1693void SetFlagToSwitchMapping(const std::string& key,
1694 const std::string& switch_name,
1695 const std::string& switch_value,
1696 NameToSwitchAndValueMap* name_to_switch_map) {
1697 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1698 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1699}
1700
[email protected]e2ddbc92010-10-15 20:02:071701void FlagsState::ConvertFlagsToSwitches(
1702 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071703 if (command_line->HasSwitch(switches::kNoExperiments))
1704 return;
1705
1706 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001707
[email protected]a314ee5a2010-10-26 21:23:281708 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071709
[email protected]a82744532011-02-11 16:15:531710 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191711 for (size_t i = 0; i < num_experiments; ++i) {
1712 const Experiment& e = experiments[i];
1713 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441714 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1715 e.command_line_value, &name_to_switch_map);
1716 } else if (e.type == Experiment::MULTI_VALUE) {
1717 for (int j = 0; j < e.num_choices; ++j) {
1718 SetFlagToSwitchMapping(e.NameForChoice(j),
1719 e.choices[j].command_line_switch,
1720 e.choices[j].command_line_value,
1721 &name_to_switch_map);
1722 }
[email protected]8a6ff28d2010-12-02 16:35:191723 } else {
[email protected]83e9fa702013-02-25 19:30:441724 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1725 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1726 &name_to_switch_map);
1727 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1728 e.command_line_value, &name_to_switch_map);
1729 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1730 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191731 }
1732 }
[email protected]e2ddbc92010-10-15 20:02:071733
1734 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531735 flags_switches_.insert(
1736 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1737 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071738 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1739 it != enabled_experiments.end();
1740 ++it) {
1741 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531742 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191743 name_to_switch_map.find(experiment_name);
1744 if (name_to_switch_it == name_to_switch_map.end()) {
1745 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071746 continue;
[email protected]8a6ff28d2010-12-02 16:35:191747 }
[email protected]e2ddbc92010-10-15 20:02:071748
[email protected]a82744532011-02-11 16:15:531749 const std::pair<std::string, std::string>&
1750 switch_and_value_pair = name_to_switch_it->second;
1751
1752 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1753 switch_and_value_pair.second);
1754 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071755 }
1756 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531757 flags_switches_.insert(
1758 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1759 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071760}
1761
1762bool FlagsState::IsRestartNeededToCommitChanges() {
1763 return needs_restart_;
1764}
1765
1766void FlagsState::SetExperimentEnabled(
1767 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441768 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191769 if (at_index != std::string::npos) {
1770 DCHECK(enable);
1771 // We're being asked to enable a multi-choice experiment. Disable the
1772 // currently selected choice.
1773 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221774 const std::string experiment_name = internal_name.substr(0, at_index);
1775 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191776
[email protected]28e35af2011-02-09 12:56:221777 // And enable the new choice, if it is not the default first choice.
1778 if (internal_name != experiment_name + "@0") {
1779 std::set<std::string> enabled_experiments;
1780 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081781 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221782 SetEnabledFlags(prefs, enabled_experiments);
1783 }
[email protected]8a6ff28d2010-12-02 16:35:191784 return;
1785 }
1786
[email protected]ad2a3ded2010-08-27 13:19:051787 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241788 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051789
[email protected]8a6ff28d2010-12-02 16:35:191790 const Experiment* e = NULL;
1791 for (size_t i = 0; i < num_experiments; ++i) {
1792 if (experiments[i].internal_name == internal_name) {
1793 e = experiments + i;
1794 break;
1795 }
1796 }
1797 DCHECK(e);
1798
1799 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591800 if (enable)
[email protected]147492b2013-03-19 23:52:081801 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591802 else
[email protected]147492b2013-03-19 23:52:081803 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191804 } else {
1805 if (enable) {
1806 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081807 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191808 } else {
1809 // Find the currently enabled choice and disable it.
1810 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441811 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191812 if (enabled_experiments.find(choice_name) !=
1813 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081814 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191815 enabled_experiments.erase(choice_name);
1816 // Continue on just in case there's a bug and more than one
1817 // experiment for this choice was enabled.
1818 }
1819 }
1820 }
1821 }
[email protected]ad2a3ded2010-08-27 13:19:051822
[email protected]1a47d7e2010-10-15 00:37:241823 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051824}
1825
[email protected]e2ddbc92010-10-15 20:02:071826void FlagsState::RemoveFlagsSwitches(
1827 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531828 for (std::map<std::string, std::string>::const_iterator
1829 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1830 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071831 }
1832}
1833
[email protected]cb93bf52013-02-20 01:20:001834void FlagsState::ResetAllFlags(PrefService* prefs) {
1835 needs_restart_ = true;
1836
1837 std::set<std::string> no_experiments;
1838 SetEnabledFlags(prefs, no_experiments);
1839}
1840
[email protected]e2ddbc92010-10-15 20:02:071841void FlagsState::reset() {
1842 needs_restart_ = false;
1843 flags_switches_.clear();
1844}
1845
[email protected]38e46812011-05-09 20:49:221846} // namespace
[email protected]e2ddbc92010-10-15 20:02:071847
1848namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191849
1850// WARNING: '@' is also used in the html file. If you update this constant you
1851// also need to update the html file.
1852const char kMultiSeparator[] = "@";
1853
[email protected]e2ddbc92010-10-15 20:02:071854void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551855 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071856}
[email protected]a314ee5a2010-10-26 21:23:281857
1858void SetExperiments(const Experiment* e, size_t count) {
1859 if (!e) {
1860 experiments = kExperiments;
1861 num_experiments = arraysize(kExperiments);
1862 } else {
1863 experiments = e;
1864 num_experiments = count;
1865 }
1866}
1867
[email protected]8a6ff28d2010-12-02 16:35:191868const Experiment* GetExperiments(size_t* count) {
1869 *count = num_experiments;
1870 return experiments;
1871}
1872
[email protected]e2ddbc92010-10-15 20:02:071873} // namespace testing
1874
[email protected]1a47d7e2010-10-15 00:37:241875} // namespace about_flags