blob: 2fde326cc1c7a9fcb47a0ecc37617f6802ebad53 [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]cc3e2052011-12-20 01:01:4089 };
90 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
91 if (bitmask & kBitsToOs[i].bit)
92 list->Append(new StringValue(kBitsToOs[i].name));
93}
94
[email protected]68317802012-06-07 19:13:2395const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
98 switches::kOmniboxHistoryQuickProviderNewScoring,
99 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
100 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
101 switches::kOmniboxHistoryQuickProviderNewScoring,
102 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
103};
104
[email protected]128dc6c2012-06-22 20:30:35105const Experiment::Choice
106 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
107 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
108 "",
109 "" },
110 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
111 switches::kOmniboxHistoryQuickProviderReorderForInlining,
112 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
113 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
114 switches::kOmniboxHistoryQuickProviderReorderForInlining,
115 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
116};
117
[email protected]032d5e6c2012-02-17 17:53:55118const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
119 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
120 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
121 switches::kOmniboxInlineHistoryQuickProvider,
122 switches::kOmniboxInlineHistoryQuickProviderAllowed },
123 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
124 switches::kOmniboxInlineHistoryQuickProvider,
125 switches::kOmniboxInlineHistoryQuickProviderProhibited }
126};
127
[email protected]fb854192013-02-06 01:30:04128const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
129 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
130 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
131 switches::kEnableCompositingForFixedPosition, ""},
132 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
133 switches::kDisableCompositingForFixedPosition, ""},
134 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
135 switches::kEnableHighDpiCompositingForFixedPosition, ""}
136};
137
[email protected]8b1c3c72013-01-25 01:48:43138const Experiment::Choice kGDIPresentChoices[] = {
139 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
140 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
141 switches::kDoFirstShowPresentWithGDI, ""},
142 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
143 switches::kDoAllShowPresentWithGDI, ""}
144};
145
[email protected]d7932532012-11-21 21:10:31146const Experiment::Choice kTouchEventsChoices[] = {
147 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
148 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
149 switches::kTouchEvents,
150 switches::kTouchEventsEnabled },
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
152 switches::kTouchEvents,
153 switches::kTouchEventsDisabled }
154};
155
[email protected]347a0c72012-05-14 20:28:06156const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31157 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20158 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06159 switches::kTouchOptimizedUI,
160 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20161 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06162 switches::kTouchOptimizedUI,
163 switches::kTouchOptimizedUIDisabled }
164};
165
[email protected]66f409c2012-10-04 20:59:04166const Experiment::Choice kNaClDebugMaskChoices[] = {
167 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
168 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
169 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
170 // an option to switch off its debugging.
171 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
172 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
173 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
174 switches::kNaClDebugMask, "*://*/*debug.nmf" }
175};
176
[email protected]ea2f3342012-09-21 21:13:36177#if defined(OS_CHROMEOS)
178const Experiment::Choice kAshBootAnimationFunction[] = {
179 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
180 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
181 ash::switches::kAshBootAnimationFunction2, ""},
182 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
183 ash::switches::kAshBootAnimationFunction3, ""}
184};
[email protected]d96aef22012-10-30 11:47:02185
186const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19187 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02188 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19189 switches::kEnableChromeCaptivePortalDetector, ""},
190 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
191 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02192};
[email protected]a78c7432013-03-13 06:22:43193
[email protected]ea2f3342012-09-21 21:13:36194#endif
195
[email protected]9323fdd12013-02-23 00:31:36196const Experiment::Choice kImplSidePaintingChoices[] = {
197 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
198 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
199 cc::switches::kEnableImplSidePainting, ""},
200 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
201 cc::switches::kDisableImplSidePainting, ""}
202};
203
[email protected]a42c85f2013-04-04 18:15:12204const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
205 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
206 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
207 cc::switches::kMaxTilesForInterestArea, "64"},
208 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
209 cc::switches::kMaxTilesForInterestArea, "128"},
210 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
211 cc::switches::kMaxTilesForInterestArea, "256"},
212 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
213 cc::switches::kMaxTilesForInterestArea, "512"}
214};
215
[email protected]38484df12013-04-10 16:42:03216const Experiment::Choice kSimpleCacheBackendChoices[] = {
217 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, "", "off" },
218 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
219 switches::kUseSimpleCacheBackend, "on"}
220};
221
[email protected]4bc5050c2010-11-18 17:55:54222// RECORDING USER METRICS FOR FLAGS:
223// -----------------------------------------------------------------------------
224// The first line of the experiment is the internal name. If you'd like to
225// gather statistics about the usage of your flag, you should append a marker
226// comment to the end of the feature name, like so:
227// "my-special-feature", // FLAGS:RECORD_UMA
228//
229// After doing that, run //chrome/tools/extract_actions.py (see instructions at
230// the top of that file for details) to update the chromeactions.txt file, which
231// will enable UMA to record your feature flag.
232//
[email protected]783d5bb2012-10-24 03:47:14233// After your feature has shipped under a flag, you can locate the metrics under
234// the action name AboutFlags_internal-action-name. Actions are recorded once
235// per startup, so you should divide this number by AboutFlags_StartupTick to
236// get a sense of usage. Note that this will not be the same as number of users
237// with a given feature enabled because users can quit and relaunch the
238// application multiple times over a given time interval. The dashboard also
239// shows you how many (metrics reporting) users have enabled the flag over the
240// last seven days. However, note that this is not the same as the number of
241// users who have the flag enabled, since enabling the flag happens once,
242// whereas running with the flag enabled happens until the user flips the flag
243// again.
[email protected]4bc5050c2010-11-18 17:55:54244
[email protected]8a6ff28d2010-12-02 16:35:19245// To add a new experiment add to the end of kExperiments. There are two
246// distinct types of experiments:
247// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
248// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22249// . MULTI_VALUE: a list of choices, the first of which should correspond to a
250// deactivated state for this lab (i.e. no command line option). To specify
251// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
252// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19253// See the documentation of Experiment for details on the fields.
254//
255// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05256const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44257#if defined(OS_ANDROID)
258 {
[email protected]199def22013-02-21 17:52:29259 "enable-spdy-proxy-auth",
260 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
261 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44262 kOsAndroid,
[email protected]199def22013-02-21 17:52:29263 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44264 },
265#endif
[email protected]ad2a3ded2010-08-27 13:19:05266 {
[email protected]aac169d2011-03-18 19:53:03267 "expose-for-tabs", // FLAGS:RECORD_UMA
268 IDS_FLAGS_TABPOSE_NAME,
269 IDS_FLAGS_TABPOSE_DESCRIPTION,
270 kOsMac,
271#if defined(OS_MACOSX)
272 // The switch exists only on OS X.
273 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
274#else
275 SINGLE_VALUE_TYPE("")
276#endif
277 },
278 {
[email protected]4bc5050c2010-11-18 17:55:54279 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05280 IDS_FLAGS_CONFLICTS_CHECK_NAME,
281 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
282 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19283 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05284 },
285 {
[email protected]4bc5050c2010-11-18 17:55:54286 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54287 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
288 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45289 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22290 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31291 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22292 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
293 // always have PDF rasterization available, so no flag needed there.
294#if !defined(GOOGLE_CHROME_BUILD)
295 kOsWin,
296#else
297 0,
[email protected]fa6d2a2f2010-11-30 21:47:19298#endif
[email protected]8a6ff28d2010-12-02 16:35:19299 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42300 },
[email protected]60d77bd2012-08-22 00:10:07301#if defined(OS_WIN)
302 {
303 "print-raster",
304 IDS_FLAGS_PRINT_RASTER_NAME,
305 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
306 kOsWin,
307 SINGLE_VALUE_TYPE(switches::kPrintRaster)
308 },
309#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05310 {
[email protected]96c6f4c2011-05-18 19:36:22311 "ignore-gpu-blacklist",
312 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
314 kOsAll,
315 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
316 },
317 {
[email protected]0110cf112011-07-02 00:39:43318 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22319 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
320 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23321 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44322 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
323 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22324 },
325 {
[email protected]72787e392012-03-23 05:55:43326 "threaded-compositing-mode",
327 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56329 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44330 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
331 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59332 },
333 {
[email protected]17e27692013-02-06 17:02:09334 "force-accelerated-composited-scrolling",
335 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
336 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
337 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44338 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
339 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09340 },
341 {
[email protected]8b1c3c72013-01-25 01:48:43342 "present-with-GDI",
343 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
344 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
345 kOsWin,
346 MULTI_VALUE_TYPE(kGDIPresentChoices)
347 },
348 {
[email protected]81c64af62012-06-06 20:15:52349 "disable-accelerated-2d-canvas",
350 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
351 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
352 kOsAll,
353 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
354 },
355 {
[email protected]efcde132012-05-30 01:05:18356 "disable-threaded-animation",
357 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
358 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59359 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37360 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59361 },
362 {
[email protected]5963b772011-02-09 22:55:38363 "composited-layer-borders",
364 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
365 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
366 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57367 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38368 },
369 {
[email protected]a8f1eaa2011-03-07 19:00:58370 "show-fps-counter",
371 IDS_FLAGS_SHOW_FPS_COUNTER,
372 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
373 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57374 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58375 },
[email protected]8ff7f342011-05-25 01:49:47376 {
[email protected]70c98a332011-12-21 20:51:52377 "accelerated-filters",
378 IDS_FLAGS_ACCELERATED_FILTERS,
379 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
380 kOsAll,
381 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
382 },
383 {
[email protected]8ff7f342011-05-25 01:49:47384 "disable-gpu-vsync",
385 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
386 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56387 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47388 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
389 },
[email protected]deaba6d52011-09-23 14:47:12390 {
[email protected]4052d832013-01-16 05:31:01391 "enable-webgl",
392 IDS_FLAGS_ENABLE_WEBGL_NAME,
393 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
394 kOsAndroid,
395#if defined(OS_ANDROID)
396 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
397#else
398 SINGLE_VALUE_TYPE("")
399#endif
400 },
401 {
[email protected]deaba6d52011-09-23 14:47:12402 "disable-webgl",
403 IDS_FLAGS_DISABLE_WEBGL_NAME,
404 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56405 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01406#if defined(OS_ANDROID)
407 SINGLE_VALUE_TYPE("")
408#else
[email protected]deaba6d52011-09-23 14:47:12409 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01410#endif
[email protected]deaba6d52011-09-23 14:47:12411 },
[email protected]09096e02012-05-24 11:12:04412 {
[email protected]ce585bf2013-03-14 16:25:16413 "disable-webrtc",
414 IDS_FLAGS_DISABLE_WEBRTC_NAME,
415 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05416 kOsAndroid,
417#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16418 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05419#else
420 SINGLE_VALUE_TYPE("")
421#endif
422 },
[email protected]34cb5292013-04-15 06:06:31423#if defined(OS_ANDROID)
424 {
425 "enable-webaudio",
426 IDS_FLAGS_ENABLE_WEBAUDIO_NAME,
427 IDS_FLAGS_ENABLE_WEBAUDIO_DESCRIPTION,
428 kOsAndroid,
429 SINGLE_VALUE_TYPE(switches::kEnableWebAudio)
430 },
431#endif
[email protected]d9da9582013-01-31 04:59:05432 {
[email protected]96bcdc102012-05-24 23:42:10433 "fixed-position-creates-stacking-context",
434 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
435 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
436 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44437 ENABLE_DISABLE_VALUE_TYPE(
438 switches::kEnableFixedPositionCreatesStackingContext,
439 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10440 },
[email protected]fb854192013-02-06 01:30:04441 {
442 "enable-compositing-for-fixed-position",
443 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
444 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
445 kOsAll,
446 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
447 },
[email protected]a7640ef22012-10-06 00:52:08448 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53449 {
[email protected]e3791ce92011-08-09 01:03:32450 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40451 IDS_FLAGS_ENABLE_NACL_NAME,
452 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56453 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19454 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40455 },
[email protected]4ff87d202010-11-06 01:28:40456 {
[email protected]9addd1c2012-09-15 14:28:24457 "enable-nacl-debug", // FLAGS:RECORD_UMA
458 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
459 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56460 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24461 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13462 },
463 {
[email protected]66f409c2012-10-04 20:59:04464 "nacl-debug-mask", // FLAGS:RECORD_UMA
465 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
466 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56467 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04468 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
469 },
470 {
[email protected]7babd1c2012-08-08 20:35:29471 "enable-pnacl", // FLAGS:RECORD_UMA
472 IDS_FLAGS_ENABLE_PNACL_NAME,
473 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56474 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29475 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
476 },
477 {
[email protected]4bc5050c2010-11-18 17:55:54478 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32479 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
480 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56481 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19482 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32483 },
[email protected]3627b06d2010-11-12 16:36:16484 {
[email protected]ac2e2acd2013-03-21 12:57:29485 "extensions-on-chrome-urls",
486 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
487 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
488 kOsAll,
489 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
490 },
491 {
[email protected]e9cddd52013-03-23 17:37:53492 "enable-adview",
493 IDS_FLAGS_ENABLE_ADVIEW_NAME,
494 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
495 kOsDesktop,
496 SINGLE_VALUE_TYPE(switches::kEnableAdview)
497 },
498 {
499 "enable-adview-src-attribute",
500 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
501 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
502 kOsDesktop,
503 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
504 },
505 {
[email protected]544471a2012-10-13 05:27:09506 "action-box",
[email protected]cab18ef2012-04-27 07:22:03507 IDS_FLAGS_ACTION_BOX_NAME,
508 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56509 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44510 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
511 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03512 },
513 {
[email protected]3a362432012-06-18 20:39:51514 "script-badges",
515 IDS_FLAGS_SCRIPT_BADGES_NAME,
516 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56517 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09518 SINGLE_VALUE_TYPE(switches::kScriptBadges)
519 },
520 {
521 "script-bubble",
522 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
523 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56524 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44525 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
526 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51527 },
528 {
[email protected]cbe224d2011-08-04 22:12:49529 "apps-new-install-bubble",
530 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
531 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56532 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49533 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
534 },
535 {
[email protected]80bd24e2010-11-30 09:34:38536 "disable-hyperlink-auditing",
537 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
538 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
539 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19540 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51541 },
542 {
543 "experimental-location-features", // FLAGS:RECORD_UMA
544 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
545 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
546 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19547 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
548 },
549 {
[email protected]5aea1862011-03-23 23:55:39550 "tab-groups-context-menu",
551 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
552 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
553 kOsWin,
554 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
555 },
[email protected]c94cebd2012-06-21 00:55:28556 {
557 "enable-instant-extended-api",
558 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
559 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56560 kOsDesktop,
[email protected]73444382013-02-26 19:31:51561 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
562 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28563 },
[email protected]e9bf9d92011-03-31 20:57:15564 {
[email protected]07fd48a2013-04-13 02:53:27565 "enable-local-only-instant-extended-api",
566 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API,
567 IDS_FLAGS_ENABLE_LOCAL_ONLY_INSTANT_EXTENDED_API_DESCRIPTION,
568 kOsDesktop,
569 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalOnlyInstantExtendedAPI,
570 switches::kDisableLocalOnlyInstantExtendedAPI)
571 },
572 {
[email protected]354e33b2011-06-15 00:29:10573 "static-ip-config",
574 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
575 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
576 kOsCrOS,
577#if defined(OS_CHROMEOS)
578 // This switch exists only on Chrome OS.
579 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
580#else
581 SINGLE_VALUE_TYPE("")
582#endif
583 },
[email protected]3eb5728c2011-06-20 22:32:24584 {
585 "show-autofill-type-predictions",
586 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
587 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
588 kOsAll,
[email protected]e217c5632013-04-12 19:11:48589 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24590 },
[email protected]bff4d3e2011-06-21 23:58:52591 {
[email protected]a5e9faa2013-03-19 09:58:38592 "enable-sync-favicons",
593 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
594 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55595 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38596 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55597 },
598 {
[email protected]5d90a0a2012-11-15 02:43:40599 "sync-keystore-encryption",
600 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
601 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
602 kOsAll,
603 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
604 },
605 {
[email protected]e755a382012-09-13 17:16:35606 "enable-gesture-tap-highlight",
607 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
608 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
609 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47610 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
611 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35612 },
613 {
[email protected]a22ebd812011-06-23 00:05:39614 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
615 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
616 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
617 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40618 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25619 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39620 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
621 },
[email protected]81a6b0b2011-06-24 17:55:40622 {
[email protected]68317802012-06-07 19:13:23623 "omnibox-history-quick-provider-new-scoring",
624 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
625 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
626 kOsAll,
627 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
628 },
629 {
[email protected]128dc6c2012-06-22 20:30:35630 "omnibox-history-quick-provider-reorder-for-inlining",
631 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
632 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
633 kOsAll,
634 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
635 },
636 {
[email protected]032d5e6c2012-02-17 17:53:55637 "omnibox-inline-history-quick-provider",
638 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
639 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
640 kOsAll,
641 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
642 },
643 {
[email protected]7e7a28092011-12-09 22:24:55644 "enable-panels",
645 IDS_FLAGS_ENABLE_PANELS_NAME,
646 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56647 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55648 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54649 },
[email protected]e3749d12011-07-25 22:22:12650 {
[email protected]27c14f02012-06-22 17:29:58651 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27652 "save-page-as-mhtml", // FLAGS:RECORD_UMA
653 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
654 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
655 kOsMac | kOsWin | kOsLinux,
656 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
657 },
658 {
[email protected]b7bb44f2011-09-01 05:17:03659 "enable-autologin",
660 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
661 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
662 kOsMac | kOsWin | kOsLinux,
663 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
664 },
[email protected]b9841172011-09-26 23:36:09665 {
[email protected]14371cb2013-03-21 07:46:12666 "enable-spdy31",
667 IDS_FLAGS_ENABLE_SPDY31_NAME,
668 IDS_FLAGS_ENABLE_SPDY31_DESCRIPTION,
[email protected]3231b612012-03-23 05:57:54669 kOsAll,
[email protected]14371cb2013-03-21 07:46:12670 SINGLE_VALUE_TYPE(switches::kEnableSpdy31)
[email protected]3231b612012-03-23 05:57:54671 },
672 {
[email protected]18cf89d2013-04-12 02:42:32673 "enable-spdy4a1",
674 IDS_FLAGS_ENABLE_SPDY4A1_NAME,
675 IDS_FLAGS_ENABLE_SPDY4A1_DESCRIPTION,
676 kOsAll,
677 SINGLE_VALUE_TYPE(switches::kEnableSpdy4a1)
678 },
679 {
[email protected]27b3fe92012-03-21 05:35:06680 "enable-async-dns",
681 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
682 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46683 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44684 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
685 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06686 },
687 {
[email protected]1eb93802012-09-11 18:57:56688 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11689 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
690 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32691 kOsAll,
[email protected]da43c082012-09-07 18:56:11692 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44693 },
[email protected]e4e68dbb2011-11-18 01:50:22694 {
[email protected]36d98412013-01-31 20:28:53695 "disable-encrypted-media",
696 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
697 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56698 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53699 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03700 },
[email protected]f88628792012-12-18 07:07:50701 {
702 "enable-opus-playback",
703 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
704 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56705 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50706 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
707 },
[email protected]ca6eaa5a2013-01-24 16:16:04708 {
[email protected]c54e1aa2013-01-25 09:26:17709 "enable-vp9-playback",
710 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
711 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
712 kOsDesktop,
713 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
714 },
715 {
[email protected]ca6eaa5a2013-01-24 16:16:04716 "enable-managed-users",
717 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
718 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
719 kOsAll,
720 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
721 },
[email protected]dc04be7c2012-03-15 23:57:49722#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50723 {
[email protected]cda278d2012-10-30 20:31:40724 "ash-disable-auto-window-placement",
725 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
726 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
727 kOsWin | kOsLinux | kOsCrOS,
728 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
729 },
[email protected]b4e4ec42012-11-29 21:42:40730 {
[email protected]16f55a22013-02-13 23:47:34731 "ash-disable-per-app-launcher",
732 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
733 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40734 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34735 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40736 },
[email protected]dc04be7c2012-03-15 23:57:49737#endif
[email protected]eaae8b462012-01-20 22:20:39738 {
[email protected]db543d322011-12-15 20:40:15739 "per-tile-painting",
740 IDS_FLAGS_PER_TILE_PAINTING_NAME,
741 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37742 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37743 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15744 },
[email protected]bf88c032011-12-22 19:05:47745 {
746 "enable-javascript-harmony",
747 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
748 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
749 kOsAll,
750 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
751 },
[email protected]7e7f378a2012-01-05 14:35:37752 {
[email protected]85646172012-01-09 22:45:54753 "enable-tab-browser-dragging",
754 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
755 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
756 kOsWin,
757 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
758 },
759 {
[email protected]068b7b52012-02-27 12:41:44760 "disable-restore-session-state",
761 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
762 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37763 kOsAll,
[email protected]068b7b52012-02-27 12:41:44764 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37765 },
[email protected]88864db2012-01-18 20:56:35766 {
767 "disable-software-rasterizer",
768 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
769 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
770#if defined(ENABLE_SWIFTSHADER)
771 kOsAll,
772#else
773 0,
774#endif
775 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
776 },
[email protected]15a5d722012-01-23 09:11:14777 {
[email protected]ff7b6dd2012-09-15 20:20:03778 "enable-experimental-webkit-features",
779 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
780 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16781 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03782 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49783 },
784 {
[email protected]0f95a252012-09-13 22:30:04785 "enable-css-shaders",
786 IDS_FLAGS_CSS_SHADERS_NAME,
787 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
788 kOsAll,
789 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
790 },
791 {
[email protected]9860c68b2012-02-02 01:58:09792 "enable-extension-activity-ui",
793 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
794 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56795 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09796 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00797 },
[email protected]54ae4e92012-02-16 15:19:05798 {
[email protected]3e8befc2012-03-13 01:17:03799 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16800 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
801 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56802 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03803 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16804 },
[email protected]dc04be7c2012-03-15 23:57:49805#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01806 {
[email protected]3cd198a22012-03-12 20:38:01807 "enable-ash-oak",
808 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
809 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
810 kOsAll,
811 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
812 },
[email protected]31cf1c52012-02-29 20:55:01813#endif
[email protected]184ec592012-03-01 11:54:28814 {
815 "enable-devtools-experiments",
816 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
817 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56818 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28819 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
820 },
[email protected]76d1854e2012-03-02 23:57:44821 {
[email protected]2fefdb32013-02-26 14:28:10822 "silent-debugger-extension-api",
823 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
824 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
825 kOsDesktop,
826 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
827 },
828 {
[email protected]76d1854e2012-03-02 23:57:44829 "enable-suggestions-ntp",
830 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
831 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56832 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44833 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
834 },
[email protected]a3d54252012-04-05 20:04:13835 {
[email protected]1dbaf5e2012-11-30 05:51:32836 "spellcheck-autocorrect",
837 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
838 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
839 kOsWin | kOsLinux | kOsCrOS,
840 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
841 },
842 {
[email protected]d7932532012-11-21 21:10:31843 "touch-events",
844 IDS_TOUCH_EVENTS_NAME,
845 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56846 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31847 MULTI_VALUE_TYPE(kTouchEventsChoices)
848 },
849 {
[email protected]c9c73ad42012-04-18 03:35:59850 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06851 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
852 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55853 kOsWin,
[email protected]347a0c72012-05-14 20:28:06854 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59855 },
[email protected]8a6aaa72012-04-20 20:53:58856 {
[email protected]b9c96ff2012-11-26 22:24:40857 "disable-touch-adjustment",
858 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
859 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
860 kOsWin | kOsLinux | kOsCrOS,
861 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
862 },
863 {
[email protected]0b9383a2012-10-26 00:58:16864 "enable-tab-capture",
865 IDS_ENABLE_TAB_CAPTURE_NAME,
866 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25867 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44868 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
869 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16870 },
[email protected]0b60afa2012-04-19 17:36:39871#if defined(OS_CHROMEOS)
872 {
[email protected]7c4a9bc2012-09-11 22:10:05873 "enable-background-loader",
874 IDS_ENABLE_BACKLOADER_NAME,
875 IDS_ENABLE_BACKLOADER_DESCRIPTION,
876 kOsCrOS,
877 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
878 },
879 {
[email protected]c5667b282012-08-31 00:32:50880 "enable-bezel-touch",
881 IDS_ENABLE_BEZEL_TOUCH_NAME,
882 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47883 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50884 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47885 },
886 {
[email protected]3f4181a2013-02-01 21:31:07887 "enable-screensaver-extension",
888 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
889 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
890 kOsCrOS,
891 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
892 },
893 {
[email protected]0b60afa2012-04-19 17:36:39894 "no-discard-tabs",
895 IDS_FLAGS_NO_DISCARD_TABS_NAME,
896 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
897 kOsCrOS,
898 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
899 },
900#endif
[email protected]79be6d32012-04-24 20:47:44901 {
[email protected]8d68a3e02013-01-12 15:57:10902 "enable-download-resumption",
903 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
904 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56905 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10906 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
907 },
908 {
[email protected]9a5940d2012-04-27 19:16:23909 "allow-nacl-socket-api",
910 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
911 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56912 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23913 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
914 },
[email protected]85333732012-05-01 19:02:24915 {
[email protected]60673ad72012-05-02 06:16:33916 "stacked-tab-strip",
917 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
918 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
919 kOsWin,
920 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
921 },
922 {
[email protected]4bd20202012-06-14 17:35:01923 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24924 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
925 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
926 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01927 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24928 },
[email protected]190349fd2012-05-02 00:10:47929#if defined(OS_CHROMEOS)
930 {
931 "allow-touchpad-three-finger-click",
932 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
933 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
934 kOsCrOS,
935 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
936 },
[email protected]fbc176b62012-10-27 02:19:58937 {
938 "allow-touchpad-three-finger-swipe",
939 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
940 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
941 kOsCrOS,
942 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
943 },
[email protected]190349fd2012-05-02 00:10:47944#endif
[email protected]1992a2f42012-10-23 18:32:21945 {
[email protected]a585e462013-01-26 00:37:15946 "use-client-login-signin-flow",
947 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
948 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21949 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15950 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21951 },
[email protected]8ee02242012-12-04 15:23:32952 {
953 "enable-desktop-guest-mode",
954 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
955 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
956 kOsMac | kOsWin | kOsLinux,
957 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
958 },
[email protected]53520b1b2012-05-07 21:43:37959#if defined(USE_ASH)
960 {
[email protected]8257d382013-03-26 13:08:42961 "show-launcher-alignment-menu",
962 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
963 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42964 kOsAll,
[email protected]8257d382013-03-26 13:08:42965 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42966 },
967 {
[email protected]73074742012-05-17 01:44:41968 "show-touch-hud",
969 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
970 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
971 kOsAll,
972 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
973 },
974 {
[email protected]9f0940b62012-05-23 22:56:35975 "enable-pinch",
976 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
977 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06978 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38979 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
980 },
981 {
982 "pinch-zoom-scrollbars",
983 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
984 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
985 kOsCrOS,
986 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
987 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:35988 },
[email protected]a8379312012-06-15 00:20:43989 {
990 "app-list-show-apps-only",
991 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
992 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
993 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03994 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43995 },
[email protected]73074742012-05-17 01:44:41996#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28997#if defined(OS_CHROMEOS)
998 {
[email protected]8b04a1652012-08-04 02:59:49999 "disable-boot-animation",
1000 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1001 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
1002 kOsCrOS,
1003 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
1004 },
[email protected]95058572012-08-20 14:57:291005 {
[email protected]b4557192012-09-19 11:29:581006 "disable-boot-animation2",
1007 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1008 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
1009 kOsCrOS,
1010 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1011 },
1012 {
[email protected]ea2f3342012-09-21 21:13:361013 "boot-animation-fucntion",
1014 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1015 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
1016 kOsCrOS,
1017 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1018 },
[email protected]839667d62012-10-23 19:38:571019 {
[email protected]d96aef22012-10-30 11:47:021020 "captive-portal-detector",
1021 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1022 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
1023 kOsCrOS,
1024 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1025 },
1026 {
[email protected]c11aa8f12012-12-18 18:43:141027 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571028 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1029 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1030 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141031 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571032 },
[email protected]f0280952012-11-06 20:30:501033 {
[email protected]ea2fab32013-04-16 06:55:021034 "file-manager-legacy",
1035 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1036 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231037 kOsCrOS,
[email protected]ea2fab32013-04-16 06:55:021038 SINGLE_VALUE_TYPE(switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231039 },
[email protected]3e035e82012-11-27 20:54:321040 {
[email protected]8039e06c2013-01-17 23:34:501041 "disable-launcher-per-display",
1042 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1043 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351044 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501045 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351046 },
[email protected]06b146d2013-02-07 06:06:471047 {
[email protected]c64d7732013-03-25 18:09:501048 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521049 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1050 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]06b146d2013-02-07 06:06:471051 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521052 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471053 },
[email protected]6ad015c2013-03-06 00:49:511054 {
[email protected]c64d7732013-03-25 18:09:501055 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521056 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1057 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511058 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521059 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511060 },
[email protected]62018dc2012-12-13 00:37:351061#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391062 {
[email protected]6247aba2013-03-04 22:57:181063 "views-textfield",
1064 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1065 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391066 kOsWin,
[email protected]6247aba2013-03-04 22:57:181067 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1068 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391069 },
[email protected]bd0cd3bb2012-06-14 03:03:381070 {
[email protected]2d4817742012-12-17 20:16:181071 "enable-new-dialog-style",
1072 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1073 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321074 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181075 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321076 },
[email protected]7db8893a2012-07-26 00:49:401077 { "disable-accelerated-video-decode",
1078 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1079 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561080 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401081 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151082 },
[email protected]66ae9fc2012-06-19 21:33:521083#if defined(USE_ASH)
1084 {
1085 "ash-debug-shortcuts",
1086 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1087 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1088 kOsAll,
1089 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1090 },
1091#endif
[email protected]37fee0942012-08-07 21:07:451092 {
[email protected]ad3f6d22012-08-29 02:34:191093 "enable-contacts",
1094 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1095 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1096 kOsCrOS,
1097 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1098 },
[email protected]1d9bb9cd2012-08-28 22:02:501099#if defined(USE_ASH)
1100 { "ash-enable-advanced-gestures",
1101 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1102 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1103 kOsCrOS,
1104 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1105 },
[email protected]cfa24e62013-02-13 21:19:111106 { "ash-disable-tab-scrubbing",
1107 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1108 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161109 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111110 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161111 },
[email protected]83eef802012-12-02 07:43:521112 { "ash-enable-workspace-scrubbing",
1113 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1114 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1115 kOsCrOS,
1116 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1117 },
[email protected]819e58d22013-03-20 00:16:111118 { "ash-immersive-fullscreen",
1119 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1120 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241121 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111122 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241123 },
[email protected]316708a2012-11-05 22:57:021124#if defined(OS_LINUX)
1125 { "ash-enable-memory-monitor",
1126 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1127 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1128 kOsCrOS,
1129 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1130 },
1131#endif
[email protected]1d9bb9cd2012-08-28 22:02:501132#endif
[email protected]9b7ab882012-09-10 23:46:361133#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091134 { "ash-disable-new-network-status-area",
1135 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1136 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461137 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091138 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461139 },
[email protected]9b7ab882012-09-10 23:46:361140 {
[email protected]205f07892012-10-16 20:26:221141 "enable-carrier-switching",
1142 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1143 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1144 kOsCrOS,
1145 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1146 },
1147 {
[email protected]9b7ab882012-09-10 23:46:361148 "enable-request-tablet-site",
1149 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1150 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1151 kOsCrOS,
1152 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1153 },
1154#endif
[email protected]dab49c0b2012-10-04 05:55:351155 {
1156 "debug-packed-apps",
1157 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1158 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561159 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351160 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1161 },
[email protected]d1459ed2012-10-10 01:29:331162 {
1163 "enable-password-generation",
1164 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1165 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561166 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331167 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1168 },
[email protected]26d045f2012-10-18 21:18:431169 {
[email protected]76f7d4882012-10-26 21:09:221170 "enable-deferred-image-decoding",
1171 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1172 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221173 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221174 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1175 },
1176 {
[email protected]075543d2012-10-24 01:29:141177 "performance-monitor-gathering",
1178 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1179 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1180 kOsAll,
1181 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1182 },
[email protected]783d5bb2012-10-24 03:47:141183 {
[email protected]90b482d2013-04-04 10:45:581184 "disable-native-autofill-ui",
1185 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1186 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431187 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581188 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431189 },
1190 {
[email protected]99002fd2012-11-06 04:35:521191 "show-app-list-shortcut",
1192 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1193 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1194 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431195 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521196 },
[email protected]a7259fb2012-11-08 06:22:231197 {
1198 "enable-experimental-form-filling",
1199 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1200 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1201 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481202 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231203 },
[email protected]6e6efe42013-01-30 00:04:501204 {
[email protected]db3178c2013-03-21 14:54:541205 "wallet-service-use-prod",
1206 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1207 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1208 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481209 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541210 },
1211 {
[email protected]6e6efe42013-01-30 00:04:501212 "enable-interactive-autocomplete",
1213 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1214 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221215 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501216 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1217 },
[email protected]edbea622012-11-28 20:39:381218 {
1219 "enable-touch-drag-drop",
1220 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1221 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1222 kOsWin | kOsCrOS,
1223 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1224 },
[email protected]0e2f43b62013-02-21 00:47:151225 {
1226 "enable-touch-editing",
1227 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1228 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1229 kOsCrOS,
1230 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1231 },
[email protected]f1c39242013-01-29 16:13:011232#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201233 {
1234 "enable-rich-notifications",
1235 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1236 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1237 kOsWin | kOsCrOS,
[email protected]aee412aa2013-04-02 20:01:231238 ENABLE_DISABLE_VALUE_TYPE(
1239 message_center::switches::kEnableRichNotifications,
1240 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201241 },
[email protected]f1c39242013-01-29 16:13:011242#endif
[email protected]4d51c682012-12-11 11:34:551243 {
1244 "full-history-sync",
1245 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1246 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1247 kOsAll,
1248 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1249 },
[email protected]628a69a92012-12-23 04:09:341250 {
[email protected]fd030142013-02-08 02:04:381251 "enable-usermedia-screen-capture",
1252 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1253 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1254 kOsDesktop,
1255 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1256 },
[email protected]5b93e162013-02-19 06:33:091257 {
1258 "enable-apps-devtool-app",
1259 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1260 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1261 kOsDesktop,
1262 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1263 },
[email protected]9323fdd12013-02-23 00:31:361264 {
1265 "impl-side-painting",
1266 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1267 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041268 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361269 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1270 },
[email protected]a42c85f2013-04-04 18:15:121271 {
[email protected]1c92d3e2013-04-18 05:31:391272 "enable-websocket-experimental-implementation",
1273 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1274 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1275 kOsAll,
1276 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1277 },
1278 {
[email protected]a42c85f2013-04-04 18:15:121279 "max-tiles-for-interest-area",
1280 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1281 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1282 kOsAndroid | kOsLinux | kOsCrOS,
1283 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1284 },
[email protected]2f2f72b2013-03-08 22:37:311285 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1286#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371287 {
1288 "track-active-visit-time",
1289 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1290 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1291 kOsWin,
1292 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1293 },
[email protected]2f2f72b2013-03-08 22:37:311294#endif
[email protected]8cc71d42013-03-02 17:26:081295#if defined(OS_ANDROID)
1296 {
1297 "disable-gesture-requirement-for-media-playback",
1298 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1299 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1300 kOsAndroid,
1301 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1302 },
1303#endif
[email protected]e79f2fd52013-03-08 23:52:471304#if defined(OS_CHROMEOS)
1305 {
1306 "enable-experimental-bluetooth",
1307 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1308 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1309 kOsCrOS,
1310 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1311 },
1312#endif
[email protected]6077cab2013-03-11 19:36:141313#if defined(ENABLE_GOOGLE_NOW)
1314 {
1315 "enable-google-now",
1316 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1317 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1318 kOsWin | kOsCrOS,
1319 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1320 },
1321#endif
[email protected]4a9e2e02013-04-08 16:19:491322 {
1323 "enable-translate-alpha-languages",
1324 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1325 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1326 kOsAll,
1327 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1328 },
[email protected]86459e2c2013-04-10 13:39:241329#if defined(OS_CHROMEOS)
1330 {
1331 "enable-virtual-keyboard",
1332 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1333 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1334 kOsCrOS,
1335 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1336 },
1337#endif
[email protected]38484df12013-04-10 16:42:031338 {
1339 "enable-simple-cache-backend",
1340 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1341 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1342 kOsAndroid,
1343 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1344 },
[email protected]717e4e22013-04-10 20:52:231345 {
1346 "enable-tcp-fast-open",
1347 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1348 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111349 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231350 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1351 },
[email protected]8027acd2013-04-18 08:35:151352 {
1353 "enable-webp-in-accept-header",
1354 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1355 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1356 kOsAll,
1357 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1358 },
[email protected]a0e4b072011-08-17 01:47:071359};
[email protected]ad2a3ded2010-08-27 13:19:051360
[email protected]a314ee5a2010-10-26 21:23:281361const Experiment* experiments = kExperiments;
1362size_t num_experiments = arraysize(kExperiments);
1363
[email protected]e2ddbc92010-10-15 20:02:071364// Stores and encapsulates the little state that about:flags has.
1365class FlagsState {
1366 public:
1367 FlagsState() : needs_restart_(false) {}
1368 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1369 bool IsRestartNeededToCommitChanges();
1370 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281371 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071372 void RemoveFlagsSwitches(
1373 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001374 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071375 void reset();
1376
1377 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551378 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071379 return Singleton<FlagsState>::get();
1380 }
1381
1382 private:
1383 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531384 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071385
1386 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1387};
1388
[email protected]c7b7800a2010-10-07 18:51:351389// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491390// in a set.
[email protected]1a47d7e2010-10-15 00:37:241391void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051392 const ListValue* enabled_experiments = prefs->GetList(
1393 prefs::kEnabledLabsExperiments);
1394 if (!enabled_experiments)
1395 return;
1396
1397 for (ListValue::const_iterator it = enabled_experiments->begin();
1398 it != enabled_experiments->end();
1399 ++it) {
1400 std::string experiment_name;
1401 if (!(*it)->GetAsString(&experiment_name)) {
1402 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1403 continue;
1404 }
1405 result->insert(experiment_name);
1406 }
1407}
1408
[email protected]c6343372013-03-13 17:05:491409// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241410void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051411 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381412 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1413 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051414
1415 experiments_list->Clear();
1416 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1417 it != enabled_experiments.end();
1418 ++it) {
1419 experiments_list->Append(new StringValue(*it));
1420 }
1421}
1422
[email protected]8a6ff28d2010-12-02 16:35:191423// Adds the internal names for the specified experiment to |names|.
1424void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1425 if (e.type == Experiment::SINGLE_VALUE) {
1426 names->insert(e.internal_name);
1427 } else {
[email protected]83e9fa702013-02-25 19:30:441428 DCHECK(e.type == Experiment::MULTI_VALUE ||
1429 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191430 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441431 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191432 }
1433}
1434
[email protected]28e35af2011-02-09 12:56:221435// Confirms that an experiment is valid, used in a DCHECK in
1436// SanitizeList below.
1437bool ValidateExperiment(const Experiment& e) {
1438 switch (e.type) {
1439 case Experiment::SINGLE_VALUE:
1440 DCHECK_EQ(0, e.num_choices);
1441 DCHECK(!e.choices);
1442 break;
1443 case Experiment::MULTI_VALUE:
1444 DCHECK_GT(e.num_choices, 0);
1445 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531446 DCHECK(e.choices[0].command_line_switch);
1447 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221448 break;
[email protected]83e9fa702013-02-25 19:30:441449 case Experiment::ENABLE_DISABLE_VALUE:
1450 DCHECK_EQ(3, e.num_choices);
1451 DCHECK(!e.choices);
1452 DCHECK(e.command_line_switch);
1453 DCHECK(e.command_line_value);
1454 DCHECK(e.disable_command_line_switch);
1455 DCHECK(e.disable_command_line_value);
1456 break;
[email protected]28e35af2011-02-09 12:56:221457 default:
1458 NOTREACHED();
1459 }
1460 return true;
1461}
1462
[email protected]ad2a3ded2010-08-27 13:19:051463// Removes all experiments from prefs::kEnabledLabsExperiments that are
1464// unknown, to prevent this list to become very long as experiments are added
1465// and removed.
1466void SanitizeList(PrefService* prefs) {
1467 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221468 for (size_t i = 0; i < num_experiments; ++i) {
1469 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191470 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221471 }
[email protected]ad2a3ded2010-08-27 13:19:051472
1473 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241474 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051475
1476 std::set<std::string> new_enabled_experiments;
1477 std::set_intersection(
1478 known_experiments.begin(), known_experiments.end(),
1479 enabled_experiments.begin(), enabled_experiments.end(),
1480 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1481
[email protected]4c8853f2012-07-23 01:29:161482 if (new_enabled_experiments != enabled_experiments)
1483 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051484}
1485
[email protected]1a47d7e2010-10-15 00:37:241486void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051487 PrefService* prefs, std::set<std::string>* result) {
1488 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241489 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051490}
1491
[email protected]a314ee5a2010-10-26 21:23:281492// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1493// enabled on the current platform.
1494void GetSanitizedEnabledFlagsForCurrentPlatform(
1495 PrefService* prefs, std::set<std::string>* result) {
1496 GetSanitizedEnabledFlags(prefs, result);
1497
1498 // Filter out any experiments that aren't enabled on the current platform. We
1499 // don't remove these from prefs else syncing to a platform with a different
1500 // set of experiments would be lossy.
1501 std::set<std::string> platform_experiments;
1502 int current_platform = GetCurrentPlatform();
1503 for (size_t i = 0; i < num_experiments; ++i) {
1504 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191505 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281506 }
1507
1508 std::set<std::string> new_enabled_experiments;
1509 std::set_intersection(
1510 platform_experiments.begin(), platform_experiments.end(),
1511 result->begin(), result->end(),
1512 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1513
1514 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051515}
1516
[email protected]8a6ff28d2010-12-02 16:35:191517// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191518Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221519 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441520 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1521 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191522 ListValue* result = new ListValue;
1523 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191524 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441525 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191526 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441527 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221528 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191529 result->Append(value);
1530 }
1531 return result;
1532}
1533
[email protected]e2ddbc92010-10-15 20:02:071534} // namespace
1535
[email protected]83e9fa702013-02-25 19:30:441536std::string Experiment::NameForChoice(int index) const {
1537 DCHECK(type == Experiment::MULTI_VALUE ||
1538 type == Experiment::ENABLE_DISABLE_VALUE);
1539 DCHECK_LT(index, num_choices);
1540 return std::string(internal_name) + testing::kMultiSeparator +
1541 base::IntToString(index);
1542}
1543
1544string16 Experiment::DescriptionForChoice(int index) const {
1545 DCHECK(type == Experiment::MULTI_VALUE ||
1546 type == Experiment::ENABLE_DISABLE_VALUE);
1547 DCHECK_LT(index, num_choices);
1548 int description_id;
1549 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1550 const int kEnableDisableDescriptionIds[] = {
1551 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1552 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1553 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1554 };
1555 description_id = kEnableDisableDescriptionIds[index];
1556 } else {
1557 description_id = choices[index].description_id;
1558 }
1559 return l10n_util::GetStringUTF16(description_id);
1560}
1561
[email protected]1a47d7e2010-10-15 00:37:241562void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551563 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051564}
1565
[email protected]1a47d7e2010-10-15 00:37:241566ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051567 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241568 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051569
1570 int current_platform = GetCurrentPlatform();
1571
1572 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281573 for (size_t i = 0; i < num_experiments; ++i) {
1574 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051575
[email protected]1fd1f292013-03-23 23:08:401576#if defined(OS_ANDROID)
1577 // Special case enable-spdy-proxy-auth, because it should only
1578 // be available on Dev and Beta channels.
1579 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1580 chrome::VersionInfo::GetChannel() ==
1581 chrome::VersionInfo::CHANNEL_STABLE)
1582 continue;
1583#endif
1584
[email protected]ad2a3ded2010-08-27 13:19:051585 DictionaryValue* data = new DictionaryValue();
1586 data->SetString("internal_name", experiment.internal_name);
1587 data->SetString("name",
1588 l10n_util::GetStringUTF16(experiment.visible_name_id));
1589 data->SetString("description",
1590 l10n_util::GetStringUTF16(
1591 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401592 bool supported = !!(experiment.supported_platforms & current_platform);
1593 data->SetBoolean("supported", supported);
1594
1595 ListValue* supported_platforms = new ListValue();
1596 AddOsStrings(experiment.supported_platforms, supported_platforms);
1597 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051598
[email protected]28e35af2011-02-09 12:56:221599 switch (experiment.type) {
1600 case Experiment::SINGLE_VALUE:
1601 data->SetBoolean(
1602 "enabled",
1603 enabled_experiments.count(experiment.internal_name) > 0);
1604 break;
1605 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441606 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221607 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1608 break;
1609 default:
1610 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191611 }
1612
[email protected]ad2a3ded2010-08-27 13:19:051613 experiments_data->Append(data);
1614 }
1615 return experiments_data;
1616}
1617
[email protected]ad2a3ded2010-08-27 13:19:051618bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551619 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051620}
1621
1622void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351623 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551624 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071625}
1626
1627void RemoveFlagsSwitches(
1628 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551629 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071630}
1631
[email protected]cb93bf52013-02-20 01:20:001632void ResetAllFlags(PrefService* prefs) {
1633 FlagsState::GetInstance()->ResetAllFlags(prefs);
1634}
1635
[email protected]a314ee5a2010-10-26 21:23:281636int GetCurrentPlatform() {
1637#if defined(OS_MACOSX)
1638 return kOsMac;
1639#elif defined(OS_WIN)
1640 return kOsWin;
1641#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1642 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211643#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281644 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401645#elif defined(OS_ANDROID)
1646 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281647#else
1648#error Unknown platform
1649#endif
1650}
1651
[email protected]4bc5050c2010-11-18 17:55:541652void RecordUMAStatistics(const PrefService* prefs) {
1653 std::set<std::string> flags;
1654 GetEnabledFlags(prefs, &flags);
1655 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1656 ++it) {
1657 std::string action("AboutFlags_");
1658 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381659 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541660 }
1661 // Since flag metrics are recorded every startup, add a tick so that the
1662 // stats can be made meaningful.
1663 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381664 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1665 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541666}
1667
[email protected]e2ddbc92010-10-15 20:02:071668//////////////////////////////////////////////////////////////////////////////
1669// FlagsState implementation.
1670
1671namespace {
1672
[email protected]83e9fa702013-02-25 19:30:441673typedef std::map<std::string, std::pair<std::string, std::string> >
1674 NameToSwitchAndValueMap;
1675
1676void SetFlagToSwitchMapping(const std::string& key,
1677 const std::string& switch_name,
1678 const std::string& switch_value,
1679 NameToSwitchAndValueMap* name_to_switch_map) {
1680 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1681 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1682}
1683
[email protected]e2ddbc92010-10-15 20:02:071684void FlagsState::ConvertFlagsToSwitches(
1685 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071686 if (command_line->HasSwitch(switches::kNoExperiments))
1687 return;
1688
1689 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001690
[email protected]a314ee5a2010-10-26 21:23:281691 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071692
[email protected]a82744532011-02-11 16:15:531693 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191694 for (size_t i = 0; i < num_experiments; ++i) {
1695 const Experiment& e = experiments[i];
1696 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441697 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1698 e.command_line_value, &name_to_switch_map);
1699 } else if (e.type == Experiment::MULTI_VALUE) {
1700 for (int j = 0; j < e.num_choices; ++j) {
1701 SetFlagToSwitchMapping(e.NameForChoice(j),
1702 e.choices[j].command_line_switch,
1703 e.choices[j].command_line_value,
1704 &name_to_switch_map);
1705 }
[email protected]8a6ff28d2010-12-02 16:35:191706 } else {
[email protected]83e9fa702013-02-25 19:30:441707 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1708 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1709 &name_to_switch_map);
1710 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1711 e.command_line_value, &name_to_switch_map);
1712 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1713 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191714 }
1715 }
[email protected]e2ddbc92010-10-15 20:02:071716
1717 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531718 flags_switches_.insert(
1719 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1720 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071721 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1722 it != enabled_experiments.end();
1723 ++it) {
1724 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531725 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191726 name_to_switch_map.find(experiment_name);
1727 if (name_to_switch_it == name_to_switch_map.end()) {
1728 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071729 continue;
[email protected]8a6ff28d2010-12-02 16:35:191730 }
[email protected]e2ddbc92010-10-15 20:02:071731
[email protected]a82744532011-02-11 16:15:531732 const std::pair<std::string, std::string>&
1733 switch_and_value_pair = name_to_switch_it->second;
1734
1735 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1736 switch_and_value_pair.second);
1737 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071738 }
1739 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531740 flags_switches_.insert(
1741 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1742 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071743}
1744
1745bool FlagsState::IsRestartNeededToCommitChanges() {
1746 return needs_restart_;
1747}
1748
1749void FlagsState::SetExperimentEnabled(
1750 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441751 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191752 if (at_index != std::string::npos) {
1753 DCHECK(enable);
1754 // We're being asked to enable a multi-choice experiment. Disable the
1755 // currently selected choice.
1756 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221757 const std::string experiment_name = internal_name.substr(0, at_index);
1758 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191759
[email protected]28e35af2011-02-09 12:56:221760 // And enable the new choice, if it is not the default first choice.
1761 if (internal_name != experiment_name + "@0") {
1762 std::set<std::string> enabled_experiments;
1763 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081764 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221765 SetEnabledFlags(prefs, enabled_experiments);
1766 }
[email protected]8a6ff28d2010-12-02 16:35:191767 return;
1768 }
1769
[email protected]ad2a3ded2010-08-27 13:19:051770 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241771 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051772
[email protected]8a6ff28d2010-12-02 16:35:191773 const Experiment* e = NULL;
1774 for (size_t i = 0; i < num_experiments; ++i) {
1775 if (experiments[i].internal_name == internal_name) {
1776 e = experiments + i;
1777 break;
1778 }
1779 }
1780 DCHECK(e);
1781
1782 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591783 if (enable)
[email protected]147492b2013-03-19 23:52:081784 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591785 else
[email protected]147492b2013-03-19 23:52:081786 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191787 } else {
1788 if (enable) {
1789 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081790 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191791 } else {
1792 // Find the currently enabled choice and disable it.
1793 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441794 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191795 if (enabled_experiments.find(choice_name) !=
1796 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081797 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191798 enabled_experiments.erase(choice_name);
1799 // Continue on just in case there's a bug and more than one
1800 // experiment for this choice was enabled.
1801 }
1802 }
1803 }
1804 }
[email protected]ad2a3ded2010-08-27 13:19:051805
[email protected]1a47d7e2010-10-15 00:37:241806 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051807}
1808
[email protected]e2ddbc92010-10-15 20:02:071809void FlagsState::RemoveFlagsSwitches(
1810 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531811 for (std::map<std::string, std::string>::const_iterator
1812 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1813 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071814 }
1815}
1816
[email protected]cb93bf52013-02-20 01:20:001817void FlagsState::ResetAllFlags(PrefService* prefs) {
1818 needs_restart_ = true;
1819
1820 std::set<std::string> no_experiments;
1821 SetEnabledFlags(prefs, no_experiments);
1822}
1823
[email protected]e2ddbc92010-10-15 20:02:071824void FlagsState::reset() {
1825 needs_restart_ = false;
1826 flags_switches_.clear();
1827}
1828
[email protected]38e46812011-05-09 20:49:221829} // namespace
[email protected]e2ddbc92010-10-15 20:02:071830
1831namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191832
1833// WARNING: '@' is also used in the html file. If you update this constant you
1834// also need to update the html file.
1835const char kMultiSeparator[] = "@";
1836
[email protected]e2ddbc92010-10-15 20:02:071837void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551838 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071839}
[email protected]a314ee5a2010-10-26 21:23:281840
1841void SetExperiments(const Experiment* e, size_t count) {
1842 if (!e) {
1843 experiments = kExperiments;
1844 num_experiments = arraysize(kExperiments);
1845 } else {
1846 experiments = e;
1847 num_experiments = count;
1848 }
1849}
1850
[email protected]8a6ff28d2010-12-02 16:35:191851const Experiment* GetExperiments(size_t* count) {
1852 *count = num_experiments;
1853 return experiments;
1854}
1855
[email protected]e2ddbc92010-10-15 20:02:071856} // namespace testing
1857
[email protected]1a47d7e2010-10-15 00:37:241858} // namespace about_flags