blob: 3f8b693a619998c0ce7c6761384f04f6bed55030 [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]cda278d2012-10-30 20:31:40718 "ash-disable-auto-window-placement",
719 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
720 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
721 kOsWin | kOsLinux | kOsCrOS,
722 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
723 },
[email protected]b4e4ec42012-11-29 21:42:40724 {
[email protected]16f55a22013-02-13 23:47:34725 "ash-disable-per-app-launcher",
726 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
727 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40728 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34729 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40730 },
[email protected]dc04be7c2012-03-15 23:57:49731#endif
[email protected]eaae8b462012-01-20 22:20:39732 {
[email protected]db543d322011-12-15 20:40:15733 "per-tile-painting",
734 IDS_FLAGS_PER_TILE_PAINTING_NAME,
735 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37736 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37737 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15738 },
[email protected]bf88c032011-12-22 19:05:47739 {
740 "enable-javascript-harmony",
741 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
742 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
743 kOsAll,
744 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
745 },
[email protected]7e7f378a2012-01-05 14:35:37746 {
[email protected]85646172012-01-09 22:45:54747 "enable-tab-browser-dragging",
748 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
749 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
750 kOsWin,
751 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
752 },
753 {
[email protected]068b7b52012-02-27 12:41:44754 "disable-restore-session-state",
755 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
756 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37757 kOsAll,
[email protected]068b7b52012-02-27 12:41:44758 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37759 },
[email protected]88864db2012-01-18 20:56:35760 {
761 "disable-software-rasterizer",
762 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
763 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
764#if defined(ENABLE_SWIFTSHADER)
765 kOsAll,
766#else
767 0,
768#endif
769 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
770 },
[email protected]15a5d722012-01-23 09:11:14771 {
[email protected]ff7b6dd2012-09-15 20:20:03772 "enable-experimental-webkit-features",
773 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
774 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16775 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03776 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49777 },
778 {
[email protected]0f95a252012-09-13 22:30:04779 "enable-css-shaders",
780 IDS_FLAGS_CSS_SHADERS_NAME,
781 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
782 kOsAll,
783 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
784 },
785 {
[email protected]9860c68b2012-02-02 01:58:09786 "enable-extension-activity-ui",
787 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
788 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56789 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09790 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00791 },
[email protected]54ae4e92012-02-16 15:19:05792 {
[email protected]3e8befc2012-03-13 01:17:03793 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16794 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
795 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56796 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03797 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16798 },
[email protected]dc04be7c2012-03-15 23:57:49799#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01800 {
[email protected]3cd198a22012-03-12 20:38:01801 "enable-ash-oak",
802 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
803 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
804 kOsAll,
805 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
806 },
[email protected]31cf1c52012-02-29 20:55:01807#endif
[email protected]184ec592012-03-01 11:54:28808 {
809 "enable-devtools-experiments",
810 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
811 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56812 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28813 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
814 },
[email protected]76d1854e2012-03-02 23:57:44815 {
[email protected]2fefdb32013-02-26 14:28:10816 "silent-debugger-extension-api",
817 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
818 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
819 kOsDesktop,
820 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
821 },
822 {
[email protected]76d1854e2012-03-02 23:57:44823 "enable-suggestions-ntp",
824 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
825 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56826 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44827 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
828 },
[email protected]a3d54252012-04-05 20:04:13829 {
[email protected]1dbaf5e2012-11-30 05:51:32830 "spellcheck-autocorrect",
831 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
832 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
833 kOsWin | kOsLinux | kOsCrOS,
834 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
835 },
836 {
[email protected]d7932532012-11-21 21:10:31837 "touch-events",
838 IDS_TOUCH_EVENTS_NAME,
839 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56840 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31841 MULTI_VALUE_TYPE(kTouchEventsChoices)
842 },
843 {
[email protected]c9c73ad42012-04-18 03:35:59844 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06845 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
846 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55847 kOsWin,
[email protected]347a0c72012-05-14 20:28:06848 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59849 },
[email protected]8a6aaa72012-04-20 20:53:58850 {
[email protected]b9c96ff2012-11-26 22:24:40851 "disable-touch-adjustment",
852 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
853 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
854 kOsWin | kOsLinux | kOsCrOS,
855 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
856 },
857 {
[email protected]0b9383a2012-10-26 00:58:16858 "enable-tab-capture",
859 IDS_ENABLE_TAB_CAPTURE_NAME,
860 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25861 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44862 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
863 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16864 },
[email protected]0b60afa2012-04-19 17:36:39865#if defined(OS_CHROMEOS)
866 {
[email protected]7c4a9bc2012-09-11 22:10:05867 "enable-background-loader",
868 IDS_ENABLE_BACKLOADER_NAME,
869 IDS_ENABLE_BACKLOADER_DESCRIPTION,
870 kOsCrOS,
871 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
872 },
873 {
[email protected]c5667b282012-08-31 00:32:50874 "enable-bezel-touch",
875 IDS_ENABLE_BEZEL_TOUCH_NAME,
876 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47877 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50878 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47879 },
880 {
[email protected]3f4181a2013-02-01 21:31:07881 "enable-screensaver-extension",
882 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
883 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
884 kOsCrOS,
885 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
886 },
887 {
[email protected]0b60afa2012-04-19 17:36:39888 "no-discard-tabs",
889 IDS_FLAGS_NO_DISCARD_TABS_NAME,
890 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
891 kOsCrOS,
892 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
893 },
894#endif
[email protected]79be6d32012-04-24 20:47:44895 {
[email protected]8d68a3e02013-01-12 15:57:10896 "enable-download-resumption",
897 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
898 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56899 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10900 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
901 },
902 {
[email protected]9a5940d2012-04-27 19:16:23903 "allow-nacl-socket-api",
904 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
905 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56906 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23907 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
908 },
[email protected]85333732012-05-01 19:02:24909 {
[email protected]60673ad72012-05-02 06:16:33910 "stacked-tab-strip",
911 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
912 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
913 kOsWin,
914 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
915 },
916 {
[email protected]4bd20202012-06-14 17:35:01917 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24918 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
919 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
920 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01921 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24922 },
[email protected]190349fd2012-05-02 00:10:47923#if defined(OS_CHROMEOS)
924 {
925 "allow-touchpad-three-finger-click",
926 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
927 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
928 kOsCrOS,
929 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
930 },
[email protected]fbc176b62012-10-27 02:19:58931 {
932 "allow-touchpad-three-finger-swipe",
933 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
934 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
935 kOsCrOS,
936 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
937 },
[email protected]190349fd2012-05-02 00:10:47938#endif
[email protected]1992a2f42012-10-23 18:32:21939 {
[email protected]a585e462013-01-26 00:37:15940 "use-client-login-signin-flow",
941 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
942 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21943 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15944 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21945 },
[email protected]8ee02242012-12-04 15:23:32946 {
947 "enable-desktop-guest-mode",
948 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
949 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
950 kOsMac | kOsWin | kOsLinux,
951 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
952 },
[email protected]53520b1b2012-05-07 21:43:37953#if defined(USE_ASH)
954 {
[email protected]8257d382013-03-26 13:08:42955 "show-launcher-alignment-menu",
956 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
957 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42958 kOsAll,
[email protected]8257d382013-03-26 13:08:42959 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42960 },
961 {
[email protected]73074742012-05-17 01:44:41962 "show-touch-hud",
963 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
964 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
965 kOsAll,
966 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
967 },
968 {
[email protected]9f0940b62012-05-23 22:56:35969 "enable-pinch",
970 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
971 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06972 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38973 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
974 },
975 {
976 "pinch-zoom-scrollbars",
977 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
978 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
979 kOsCrOS,
980 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
981 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:35982 },
[email protected]a8379312012-06-15 00:20:43983 {
984 "app-list-show-apps-only",
985 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
986 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
987 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03988 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43989 },
[email protected]73074742012-05-17 01:44:41990#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28991#if defined(OS_CHROMEOS)
992 {
[email protected]8b04a1652012-08-04 02:59:49993 "disable-boot-animation",
994 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
995 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58996 kOsCrOSOwnerOnly,
[email protected]8b04a1652012-08-04 02:59:49997 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
998 },
[email protected]95058572012-08-20 14:57:29999 {
[email protected]b4557192012-09-19 11:29:581000 "disable-boot-animation2",
1001 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1002 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581003 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581004 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1005 },
1006 {
[email protected]ea2f3342012-09-21 21:13:361007 "boot-animation-fucntion",
1008 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1009 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581010 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361011 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1012 },
[email protected]839667d62012-10-23 19:38:571013 {
[email protected]d96aef22012-10-30 11:47:021014 "captive-portal-detector",
1015 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1016 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581017 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021018 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1019 },
1020 {
[email protected]c11aa8f12012-12-18 18:43:141021 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571022 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1023 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1024 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141025 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571026 },
[email protected]f0280952012-11-06 20:30:501027 {
[email protected]ea2fab32013-04-16 06:55:021028 "file-manager-legacy",
1029 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1030 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231031 kOsCrOS,
[email protected]ea2fab32013-04-16 06:55:021032 SINGLE_VALUE_TYPE(switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231033 },
[email protected]3e035e82012-11-27 20:54:321034 {
[email protected]bc545292013-04-18 14:33:101035 "file-manager-new-ui",
1036 IDS_FLAGS_FILE_MANAGER_NEW_UI_NAME,
1037 IDS_FLAGS_FILE_MANAGER_NEW_UI_DESCRIPTION,
1038 kOsCrOS,
1039 SINGLE_VALUE_TYPE(switches::kFileManagerNewUI),
1040 },
1041 {
[email protected]8039e06c2013-01-17 23:34:501042 "disable-launcher-per-display",
1043 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1044 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351045 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501046 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351047 },
[email protected]06b146d2013-02-07 06:06:471048 {
[email protected]c64d7732013-03-25 18:09:501049 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521050 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1051 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581052 kOsCrOSOwnerOnly,
[email protected]640aa2b2013-03-22 16:00:521053 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471054 },
[email protected]6ad015c2013-03-06 00:49:511055 {
[email protected]c64d7732013-03-25 18:09:501056 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521057 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1058 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511059 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521060 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511061 },
[email protected]62018dc2012-12-13 00:37:351062#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391063 {
[email protected]6247aba2013-03-04 22:57:181064 "views-textfield",
1065 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1066 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391067 kOsWin,
[email protected]6247aba2013-03-04 22:57:181068 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1069 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391070 },
[email protected]bd0cd3bb2012-06-14 03:03:381071 {
[email protected]2d4817742012-12-17 20:16:181072 "enable-new-dialog-style",
1073 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1074 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321075 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181076 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321077 },
[email protected]7db8893a2012-07-26 00:49:401078 { "disable-accelerated-video-decode",
1079 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1080 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561081 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401082 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151083 },
[email protected]66ae9fc2012-06-19 21:33:521084#if defined(USE_ASH)
1085 {
1086 "ash-debug-shortcuts",
1087 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1088 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1089 kOsAll,
1090 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1091 },
1092#endif
[email protected]37fee0942012-08-07 21:07:451093 {
[email protected]ad3f6d22012-08-29 02:34:191094 "enable-contacts",
1095 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1096 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1097 kOsCrOS,
1098 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1099 },
[email protected]1d9bb9cd2012-08-28 22:02:501100#if defined(USE_ASH)
1101 { "ash-enable-advanced-gestures",
1102 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1103 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1104 kOsCrOS,
1105 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1106 },
[email protected]cfa24e62013-02-13 21:19:111107 { "ash-disable-tab-scrubbing",
1108 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1109 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161110 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111111 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161112 },
[email protected]83eef802012-12-02 07:43:521113 { "ash-enable-workspace-scrubbing",
1114 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1115 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1116 kOsCrOS,
1117 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1118 },
[email protected]819e58d22013-03-20 00:16:111119 { "ash-immersive-fullscreen",
1120 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1121 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241122 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111123 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241124 },
[email protected]316708a2012-11-05 22:57:021125#if defined(OS_LINUX)
1126 { "ash-enable-memory-monitor",
1127 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1128 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1129 kOsCrOS,
1130 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1131 },
1132#endif
[email protected]1d9bb9cd2012-08-28 22:02:501133#endif
[email protected]9b7ab882012-09-10 23:46:361134#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091135 { "ash-disable-new-network-status-area",
1136 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1137 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461138 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091139 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461140 },
[email protected]9b7ab882012-09-10 23:46:361141 {
[email protected]205f07892012-10-16 20:26:221142 "enable-carrier-switching",
1143 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1144 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1145 kOsCrOS,
1146 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1147 },
1148 {
[email protected]9b7ab882012-09-10 23:46:361149 "enable-request-tablet-site",
1150 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1151 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1152 kOsCrOS,
1153 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1154 },
1155#endif
[email protected]dab49c0b2012-10-04 05:55:351156 {
1157 "debug-packed-apps",
1158 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1159 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561160 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351161 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1162 },
[email protected]d1459ed2012-10-10 01:29:331163 {
1164 "enable-password-generation",
1165 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1166 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561167 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331168 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1169 },
[email protected]26d045f2012-10-18 21:18:431170 {
[email protected]76f7d4882012-10-26 21:09:221171 "enable-deferred-image-decoding",
1172 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1173 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221174 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221175 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1176 },
1177 {
[email protected]075543d2012-10-24 01:29:141178 "performance-monitor-gathering",
1179 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1180 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1181 kOsAll,
1182 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1183 },
[email protected]783d5bb2012-10-24 03:47:141184 {
[email protected]90b482d2013-04-04 10:45:581185 "disable-native-autofill-ui",
1186 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1187 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431188 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581189 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431190 },
1191 {
[email protected]99002fd2012-11-06 04:35:521192 "show-app-list-shortcut",
1193 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1194 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1195 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431196 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521197 },
[email protected]a7259fb2012-11-08 06:22:231198 {
1199 "enable-experimental-form-filling",
1200 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1201 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1202 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481203 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231204 },
[email protected]6e6efe42013-01-30 00:04:501205 {
[email protected]db3178c2013-03-21 14:54:541206 "wallet-service-use-prod",
1207 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1208 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1209 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481210 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541211 },
1212 {
[email protected]6e6efe42013-01-30 00:04:501213 "enable-interactive-autocomplete",
1214 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1215 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221216 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501217 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1218 },
[email protected]edbea622012-11-28 20:39:381219 {
1220 "enable-touch-drag-drop",
1221 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1222 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1223 kOsWin | kOsCrOS,
1224 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1225 },
[email protected]0e2f43b62013-02-21 00:47:151226 {
1227 "enable-touch-editing",
1228 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1229 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1230 kOsCrOS,
1231 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1232 },
[email protected]f1c39242013-01-29 16:13:011233#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201234 {
1235 "enable-rich-notifications",
1236 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1237 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1238 kOsWin | kOsCrOS,
[email protected]aee412aa2013-04-02 20:01:231239 ENABLE_DISABLE_VALUE_TYPE(
1240 message_center::switches::kEnableRichNotifications,
1241 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201242 },
[email protected]f1c39242013-01-29 16:13:011243#endif
[email protected]4d51c682012-12-11 11:34:551244 {
1245 "full-history-sync",
1246 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1247 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1248 kOsAll,
1249 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1250 },
[email protected]628a69a92012-12-23 04:09:341251 {
[email protected]fd030142013-02-08 02:04:381252 "enable-usermedia-screen-capture",
1253 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1254 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1255 kOsDesktop,
1256 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1257 },
[email protected]5b93e162013-02-19 06:33:091258 {
1259 "enable-apps-devtool-app",
1260 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1261 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1262 kOsDesktop,
1263 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1264 },
[email protected]9323fdd12013-02-23 00:31:361265 {
1266 "impl-side-painting",
1267 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1268 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041269 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361270 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1271 },
[email protected]a42c85f2013-04-04 18:15:121272 {
[email protected]1c92d3e2013-04-18 05:31:391273 "enable-websocket-experimental-implementation",
1274 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1275 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1276 kOsAll,
1277 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1278 },
1279 {
[email protected]a42c85f2013-04-04 18:15:121280 "max-tiles-for-interest-area",
1281 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1282 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1283 kOsAndroid | kOsLinux | kOsCrOS,
1284 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1285 },
[email protected]2f2f72b2013-03-08 22:37:311286 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1287#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371288 {
1289 "track-active-visit-time",
1290 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1291 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1292 kOsWin,
1293 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1294 },
[email protected]2f2f72b2013-03-08 22:37:311295#endif
[email protected]8cc71d42013-03-02 17:26:081296#if defined(OS_ANDROID)
1297 {
1298 "disable-gesture-requirement-for-media-playback",
1299 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1300 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1301 kOsAndroid,
1302 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1303 },
1304#endif
[email protected]e79f2fd52013-03-08 23:52:471305#if defined(OS_CHROMEOS)
1306 {
1307 "enable-experimental-bluetooth",
1308 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1309 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1310 kOsCrOS,
1311 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1312 },
1313#endif
[email protected]6077cab2013-03-11 19:36:141314#if defined(ENABLE_GOOGLE_NOW)
1315 {
1316 "enable-google-now",
1317 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1318 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1319 kOsWin | kOsCrOS,
1320 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1321 },
1322#endif
[email protected]4a9e2e02013-04-08 16:19:491323 {
1324 "enable-translate-alpha-languages",
1325 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1326 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1327 kOsAll,
1328 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1329 },
[email protected]86459e2c2013-04-10 13:39:241330#if defined(OS_CHROMEOS)
1331 {
1332 "enable-virtual-keyboard",
1333 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1334 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1335 kOsCrOS,
1336 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1337 },
1338#endif
[email protected]38484df12013-04-10 16:42:031339 {
1340 "enable-simple-cache-backend",
1341 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1342 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1343 kOsAndroid,
1344 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1345 },
[email protected]717e4e22013-04-10 20:52:231346 {
1347 "enable-tcp-fast-open",
1348 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1349 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111350 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231351 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1352 },
[email protected]8027acd2013-04-18 08:35:151353 {
1354 "enable-webp-in-accept-header",
1355 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1356 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1357 kOsAll,
1358 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1359 },
[email protected]a0e4b072011-08-17 01:47:071360};
[email protected]ad2a3ded2010-08-27 13:19:051361
[email protected]a314ee5a2010-10-26 21:23:281362const Experiment* experiments = kExperiments;
1363size_t num_experiments = arraysize(kExperiments);
1364
[email protected]e2ddbc92010-10-15 20:02:071365// Stores and encapsulates the little state that about:flags has.
1366class FlagsState {
1367 public:
1368 FlagsState() : needs_restart_(false) {}
1369 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1370 bool IsRestartNeededToCommitChanges();
1371 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281372 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071373 void RemoveFlagsSwitches(
1374 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001375 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071376 void reset();
1377
1378 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551379 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071380 return Singleton<FlagsState>::get();
1381 }
1382
1383 private:
1384 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531385 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071386
1387 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1388};
1389
[email protected]c7b7800a2010-10-07 18:51:351390// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491391// in a set.
[email protected]1a47d7e2010-10-15 00:37:241392void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051393 const ListValue* enabled_experiments = prefs->GetList(
1394 prefs::kEnabledLabsExperiments);
1395 if (!enabled_experiments)
1396 return;
1397
1398 for (ListValue::const_iterator it = enabled_experiments->begin();
1399 it != enabled_experiments->end();
1400 ++it) {
1401 std::string experiment_name;
1402 if (!(*it)->GetAsString(&experiment_name)) {
1403 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1404 continue;
1405 }
1406 result->insert(experiment_name);
1407 }
1408}
1409
[email protected]c6343372013-03-13 17:05:491410// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241411void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051412 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381413 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1414 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051415
1416 experiments_list->Clear();
1417 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1418 it != enabled_experiments.end();
1419 ++it) {
1420 experiments_list->Append(new StringValue(*it));
1421 }
1422}
1423
[email protected]8a6ff28d2010-12-02 16:35:191424// Adds the internal names for the specified experiment to |names|.
1425void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1426 if (e.type == Experiment::SINGLE_VALUE) {
1427 names->insert(e.internal_name);
1428 } else {
[email protected]83e9fa702013-02-25 19:30:441429 DCHECK(e.type == Experiment::MULTI_VALUE ||
1430 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191431 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441432 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191433 }
1434}
1435
[email protected]28e35af2011-02-09 12:56:221436// Confirms that an experiment is valid, used in a DCHECK in
1437// SanitizeList below.
1438bool ValidateExperiment(const Experiment& e) {
1439 switch (e.type) {
1440 case Experiment::SINGLE_VALUE:
1441 DCHECK_EQ(0, e.num_choices);
1442 DCHECK(!e.choices);
1443 break;
1444 case Experiment::MULTI_VALUE:
1445 DCHECK_GT(e.num_choices, 0);
1446 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531447 DCHECK(e.choices[0].command_line_switch);
1448 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221449 break;
[email protected]83e9fa702013-02-25 19:30:441450 case Experiment::ENABLE_DISABLE_VALUE:
1451 DCHECK_EQ(3, e.num_choices);
1452 DCHECK(!e.choices);
1453 DCHECK(e.command_line_switch);
1454 DCHECK(e.command_line_value);
1455 DCHECK(e.disable_command_line_switch);
1456 DCHECK(e.disable_command_line_value);
1457 break;
[email protected]28e35af2011-02-09 12:56:221458 default:
1459 NOTREACHED();
1460 }
1461 return true;
1462}
1463
[email protected]ad2a3ded2010-08-27 13:19:051464// Removes all experiments from prefs::kEnabledLabsExperiments that are
1465// unknown, to prevent this list to become very long as experiments are added
1466// and removed.
1467void SanitizeList(PrefService* prefs) {
1468 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221469 for (size_t i = 0; i < num_experiments; ++i) {
1470 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191471 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221472 }
[email protected]ad2a3ded2010-08-27 13:19:051473
1474 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241475 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051476
1477 std::set<std::string> new_enabled_experiments;
1478 std::set_intersection(
1479 known_experiments.begin(), known_experiments.end(),
1480 enabled_experiments.begin(), enabled_experiments.end(),
1481 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1482
[email protected]4c8853f2012-07-23 01:29:161483 if (new_enabled_experiments != enabled_experiments)
1484 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051485}
1486
[email protected]1a47d7e2010-10-15 00:37:241487void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051488 PrefService* prefs, std::set<std::string>* result) {
1489 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241490 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051491}
1492
[email protected]a314ee5a2010-10-26 21:23:281493// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1494// enabled on the current platform.
1495void GetSanitizedEnabledFlagsForCurrentPlatform(
1496 PrefService* prefs, std::set<std::string>* result) {
1497 GetSanitizedEnabledFlags(prefs, result);
1498
1499 // Filter out any experiments that aren't enabled on the current platform. We
1500 // don't remove these from prefs else syncing to a platform with a different
1501 // set of experiments would be lossy.
1502 std::set<std::string> platform_experiments;
1503 int current_platform = GetCurrentPlatform();
1504 for (size_t i = 0; i < num_experiments; ++i) {
1505 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191506 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581507#if defined(OS_CHROMEOS)
1508 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1509 AddInternalName(experiments[i], &platform_experiments);
1510#endif
[email protected]a314ee5a2010-10-26 21:23:281511 }
1512
1513 std::set<std::string> new_enabled_experiments;
1514 std::set_intersection(
1515 platform_experiments.begin(), platform_experiments.end(),
1516 result->begin(), result->end(),
1517 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1518
1519 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051520}
1521
[email protected]8a6ff28d2010-12-02 16:35:191522// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191523Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221524 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441525 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1526 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191527 ListValue* result = new ListValue;
1528 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191529 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441530 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191531 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441532 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221533 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191534 result->Append(value);
1535 }
1536 return result;
1537}
1538
[email protected]e2ddbc92010-10-15 20:02:071539} // namespace
1540
[email protected]83e9fa702013-02-25 19:30:441541std::string Experiment::NameForChoice(int index) const {
1542 DCHECK(type == Experiment::MULTI_VALUE ||
1543 type == Experiment::ENABLE_DISABLE_VALUE);
1544 DCHECK_LT(index, num_choices);
1545 return std::string(internal_name) + testing::kMultiSeparator +
1546 base::IntToString(index);
1547}
1548
1549string16 Experiment::DescriptionForChoice(int index) const {
1550 DCHECK(type == Experiment::MULTI_VALUE ||
1551 type == Experiment::ENABLE_DISABLE_VALUE);
1552 DCHECK_LT(index, num_choices);
1553 int description_id;
1554 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1555 const int kEnableDisableDescriptionIds[] = {
1556 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1557 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1558 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1559 };
1560 description_id = kEnableDisableDescriptionIds[index];
1561 } else {
1562 description_id = choices[index].description_id;
1563 }
1564 return l10n_util::GetStringUTF16(description_id);
1565}
1566
[email protected]1a47d7e2010-10-15 00:37:241567void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551568 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051569}
1570
[email protected]37736bd2013-04-18 11:53:581571ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051572 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241573 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051574
1575 int current_platform = GetCurrentPlatform();
1576
1577 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281578 for (size_t i = 0; i < num_experiments; ++i) {
1579 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051580
[email protected]1fd1f292013-03-23 23:08:401581#if defined(OS_ANDROID)
1582 // Special case enable-spdy-proxy-auth, because it should only
1583 // be available on Dev and Beta channels.
1584 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1585 chrome::VersionInfo::GetChannel() ==
1586 chrome::VersionInfo::CHANNEL_STABLE)
1587 continue;
1588#endif
1589
[email protected]ad2a3ded2010-08-27 13:19:051590 DictionaryValue* data = new DictionaryValue();
1591 data->SetString("internal_name", experiment.internal_name);
1592 data->SetString("name",
1593 l10n_util::GetStringUTF16(experiment.visible_name_id));
1594 data->SetString("description",
1595 l10n_util::GetStringUTF16(
1596 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581597 bool supported = (experiment.supported_platforms & current_platform) != 0;
1598#if defined(OS_CHROMEOS)
1599 if (access == kOwnerAccessToFlags &&
1600 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1601 supported = true;
1602#endif
[email protected]cc3e2052011-12-20 01:01:401603 data->SetBoolean("supported", supported);
1604
1605 ListValue* supported_platforms = new ListValue();
1606 AddOsStrings(experiment.supported_platforms, supported_platforms);
1607 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051608
[email protected]28e35af2011-02-09 12:56:221609 switch (experiment.type) {
1610 case Experiment::SINGLE_VALUE:
1611 data->SetBoolean(
1612 "enabled",
1613 enabled_experiments.count(experiment.internal_name) > 0);
1614 break;
1615 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441616 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221617 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1618 break;
1619 default:
1620 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191621 }
1622
[email protected]ad2a3ded2010-08-27 13:19:051623 experiments_data->Append(data);
1624 }
1625 return experiments_data;
1626}
1627
[email protected]ad2a3ded2010-08-27 13:19:051628bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551629 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051630}
1631
1632void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351633 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551634 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071635}
1636
1637void RemoveFlagsSwitches(
1638 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551639 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071640}
1641
[email protected]cb93bf52013-02-20 01:20:001642void ResetAllFlags(PrefService* prefs) {
1643 FlagsState::GetInstance()->ResetAllFlags(prefs);
1644}
1645
[email protected]a314ee5a2010-10-26 21:23:281646int GetCurrentPlatform() {
1647#if defined(OS_MACOSX)
1648 return kOsMac;
1649#elif defined(OS_WIN)
1650 return kOsWin;
1651#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1652 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211653#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281654 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401655#elif defined(OS_ANDROID)
1656 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281657#else
1658#error Unknown platform
1659#endif
1660}
1661
[email protected]4bc5050c2010-11-18 17:55:541662void RecordUMAStatistics(const PrefService* prefs) {
1663 std::set<std::string> flags;
1664 GetEnabledFlags(prefs, &flags);
1665 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1666 ++it) {
1667 std::string action("AboutFlags_");
1668 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381669 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541670 }
1671 // Since flag metrics are recorded every startup, add a tick so that the
1672 // stats can be made meaningful.
1673 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381674 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1675 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541676}
1677
[email protected]e2ddbc92010-10-15 20:02:071678//////////////////////////////////////////////////////////////////////////////
1679// FlagsState implementation.
1680
1681namespace {
1682
[email protected]83e9fa702013-02-25 19:30:441683typedef std::map<std::string, std::pair<std::string, std::string> >
1684 NameToSwitchAndValueMap;
1685
1686void SetFlagToSwitchMapping(const std::string& key,
1687 const std::string& switch_name,
1688 const std::string& switch_value,
1689 NameToSwitchAndValueMap* name_to_switch_map) {
1690 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1691 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1692}
1693
[email protected]e2ddbc92010-10-15 20:02:071694void FlagsState::ConvertFlagsToSwitches(
1695 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071696 if (command_line->HasSwitch(switches::kNoExperiments))
1697 return;
1698
1699 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001700
[email protected]a314ee5a2010-10-26 21:23:281701 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071702
[email protected]a82744532011-02-11 16:15:531703 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191704 for (size_t i = 0; i < num_experiments; ++i) {
1705 const Experiment& e = experiments[i];
1706 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441707 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1708 e.command_line_value, &name_to_switch_map);
1709 } else if (e.type == Experiment::MULTI_VALUE) {
1710 for (int j = 0; j < e.num_choices; ++j) {
1711 SetFlagToSwitchMapping(e.NameForChoice(j),
1712 e.choices[j].command_line_switch,
1713 e.choices[j].command_line_value,
1714 &name_to_switch_map);
1715 }
[email protected]8a6ff28d2010-12-02 16:35:191716 } else {
[email protected]83e9fa702013-02-25 19:30:441717 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1718 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1719 &name_to_switch_map);
1720 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1721 e.command_line_value, &name_to_switch_map);
1722 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1723 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191724 }
1725 }
[email protected]e2ddbc92010-10-15 20:02:071726
1727 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531728 flags_switches_.insert(
1729 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1730 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071731 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1732 it != enabled_experiments.end();
1733 ++it) {
1734 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531735 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191736 name_to_switch_map.find(experiment_name);
1737 if (name_to_switch_it == name_to_switch_map.end()) {
1738 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071739 continue;
[email protected]8a6ff28d2010-12-02 16:35:191740 }
[email protected]e2ddbc92010-10-15 20:02:071741
[email protected]a82744532011-02-11 16:15:531742 const std::pair<std::string, std::string>&
1743 switch_and_value_pair = name_to_switch_it->second;
1744
1745 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1746 switch_and_value_pair.second);
1747 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071748 }
1749 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531750 flags_switches_.insert(
1751 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1752 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071753}
1754
1755bool FlagsState::IsRestartNeededToCommitChanges() {
1756 return needs_restart_;
1757}
1758
1759void FlagsState::SetExperimentEnabled(
1760 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441761 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191762 if (at_index != std::string::npos) {
1763 DCHECK(enable);
1764 // We're being asked to enable a multi-choice experiment. Disable the
1765 // currently selected choice.
1766 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221767 const std::string experiment_name = internal_name.substr(0, at_index);
1768 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191769
[email protected]28e35af2011-02-09 12:56:221770 // And enable the new choice, if it is not the default first choice.
1771 if (internal_name != experiment_name + "@0") {
1772 std::set<std::string> enabled_experiments;
1773 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081774 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221775 SetEnabledFlags(prefs, enabled_experiments);
1776 }
[email protected]8a6ff28d2010-12-02 16:35:191777 return;
1778 }
1779
[email protected]ad2a3ded2010-08-27 13:19:051780 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241781 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051782
[email protected]8a6ff28d2010-12-02 16:35:191783 const Experiment* e = NULL;
1784 for (size_t i = 0; i < num_experiments; ++i) {
1785 if (experiments[i].internal_name == internal_name) {
1786 e = experiments + i;
1787 break;
1788 }
1789 }
1790 DCHECK(e);
1791
1792 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591793 if (enable)
[email protected]147492b2013-03-19 23:52:081794 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591795 else
[email protected]147492b2013-03-19 23:52:081796 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191797 } else {
1798 if (enable) {
1799 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081800 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191801 } else {
1802 // Find the currently enabled choice and disable it.
1803 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441804 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191805 if (enabled_experiments.find(choice_name) !=
1806 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081807 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191808 enabled_experiments.erase(choice_name);
1809 // Continue on just in case there's a bug and more than one
1810 // experiment for this choice was enabled.
1811 }
1812 }
1813 }
1814 }
[email protected]ad2a3ded2010-08-27 13:19:051815
[email protected]1a47d7e2010-10-15 00:37:241816 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051817}
1818
[email protected]e2ddbc92010-10-15 20:02:071819void FlagsState::RemoveFlagsSwitches(
1820 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531821 for (std::map<std::string, std::string>::const_iterator
1822 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1823 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071824 }
1825}
1826
[email protected]cb93bf52013-02-20 01:20:001827void FlagsState::ResetAllFlags(PrefService* prefs) {
1828 needs_restart_ = true;
1829
1830 std::set<std::string> no_experiments;
1831 SetEnabledFlags(prefs, no_experiments);
1832}
1833
[email protected]e2ddbc92010-10-15 20:02:071834void FlagsState::reset() {
1835 needs_restart_ = false;
1836 flags_switches_.clear();
1837}
1838
[email protected]38e46812011-05-09 20:49:221839} // namespace
[email protected]e2ddbc92010-10-15 20:02:071840
1841namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191842
1843// WARNING: '@' is also used in the html file. If you update this constant you
1844// also need to update the html file.
1845const char kMultiSeparator[] = "@";
1846
[email protected]e2ddbc92010-10-15 20:02:071847void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551848 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071849}
[email protected]a314ee5a2010-10-26 21:23:281850
1851void SetExperiments(const Experiment* e, size_t count) {
1852 if (!e) {
1853 experiments = kExperiments;
1854 num_experiments = arraysize(kExperiments);
1855 } else {
1856 experiments = e;
1857 num_experiments = count;
1858 }
1859}
1860
[email protected]8a6ff28d2010-12-02 16:35:191861const Experiment* GetExperiments(size_t* count) {
1862 *count = num_experiments;
1863 return experiments;
1864}
1865
[email protected]e2ddbc92010-10-15 20:02:071866} // namespace testing
1867
[email protected]1a47d7e2010-10-15 00:37:241868} // namespace about_flags