blob: 98d6829dabf76fb08f49205a4ccdd38884f0a303 [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]ad2a3ded2010-08-27 13:19:0515#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1516#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5717#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4118#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0319#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0520#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5221#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3822#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0323#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0524#include "chrome/common/chrome_switches.h"
[email protected]1fd1f292013-03-23 23:08:4025#include "chrome/common/chrome_version_info.h"
[email protected]ad2a3ded2010-08-27 13:19:0526#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3827#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0228#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0529#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0230#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0231#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0332#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1733#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5934#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4835#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2736#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2437#include "ui/keyboard/keyboard_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4338#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0539
[email protected]f1c39242013-01-29 16:13:0140#if defined(ENABLE_MESSAGE_CENTER)
41#include "ui/message_center/message_center_switches.h"
42#endif
43
[email protected]dc04be7c2012-03-15 23:57:4944#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3145#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4946#endif
47
[email protected]badba1ad2012-11-16 17:21:4648#if defined(OS_CHROMEOS)
49#include "chromeos/chromeos_switches.h"
50#endif
51
[email protected]7f6f44c2011-12-14 13:23:3852using content::UserMetricsAction;
53
[email protected]1a47d7e2010-10-15 00:37:2454namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0555
[email protected]8a6ff28d2010-12-02 16:35:1956// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5357#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4458 Experiment::SINGLE_VALUE, \
59 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5360#define SINGLE_VALUE_TYPE(command_line_switch) \
61 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4462#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
63 disable_switch, disable_value) \
64 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
65 disable_switch, disable_value, NULL, 3
66#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
67 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5368#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4469 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1970
[email protected]e2ddbc92010-10-15 20:02:0771namespace {
72
[email protected]9c7453d2012-01-21 00:45:4073const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5674const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0575
[email protected]cc3e2052011-12-20 01:01:4076// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
77// whether the experiment is available on that platform.
78void AddOsStrings(unsigned bitmask, ListValue* list) {
79 struct {
80 unsigned bit;
81 const char* const name;
82 } kBitsToOs[] = {
83 {kOsMac, "Mac"},
84 {kOsWin, "Windows"},
85 {kOsLinux, "Linux"},
86 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0187 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:5888 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[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]37736bd2013-04-18 11:53:58329 kOsMac | kOsWin | kOsLinux,
[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]18cf89d2013-04-12 02:42:32666 "enable-spdy4a1",
667 IDS_FLAGS_ENABLE_SPDY4A1_NAME,
668 IDS_FLAGS_ENABLE_SPDY4A1_DESCRIPTION,
669 kOsAll,
670 SINGLE_VALUE_TYPE(switches::kEnableSpdy4a1)
671 },
672 {
[email protected]27b3fe92012-03-21 05:35:06673 "enable-async-dns",
674 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
675 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46676 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44677 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
678 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06679 },
680 {
[email protected]1eb93802012-09-11 18:57:56681 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11682 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
683 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32684 kOsAll,
[email protected]da43c082012-09-07 18:56:11685 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44686 },
[email protected]e4e68dbb2011-11-18 01:50:22687 {
[email protected]36d98412013-01-31 20:28:53688 "disable-encrypted-media",
689 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
690 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56691 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53692 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03693 },
[email protected]f88628792012-12-18 07:07:50694 {
695 "enable-opus-playback",
696 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
697 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56698 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50699 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
700 },
[email protected]ca6eaa5a2013-01-24 16:16:04701 {
[email protected]c54e1aa2013-01-25 09:26:17702 "enable-vp9-playback",
703 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
704 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
705 kOsDesktop,
706 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
707 },
708 {
[email protected]6ac955b2013-04-19 23:43:32709 "enable-vp8-alpha-playback",
710 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME,
711 IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION,
712 kOsDesktop,
713 SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback)
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,
[email protected]37736bd2013-04-18 11:53:58719 kOsMac | kOsWin | kOsLinux | kOsAndroid | kOsCrOSOwnerOnly,
[email protected]ca6eaa5a2013-01-24 16:16:04720 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]2a13a9a2013-04-19 04:00:21724 "ash-disable-auto-maximizing",
725 IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME,
726 IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION,
727 kOsWin | kOsLinux | kOsCrOS,
728 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing)
729 },
730 {
[email protected]cda278d2012-10-30 20:31:40731 "ash-disable-auto-window-placement",
732 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
733 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
734 kOsWin | kOsLinux | kOsCrOS,
735 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
736 },
[email protected]b4e4ec42012-11-29 21:42:40737 {
[email protected]16f55a22013-02-13 23:47:34738 "ash-disable-per-app-launcher",
739 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
740 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40741 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34742 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40743 },
[email protected]dc04be7c2012-03-15 23:57:49744#endif
[email protected]eaae8b462012-01-20 22:20:39745 {
[email protected]db543d322011-12-15 20:40:15746 "per-tile-painting",
747 IDS_FLAGS_PER_TILE_PAINTING_NAME,
748 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37749 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37750 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15751 },
[email protected]bf88c032011-12-22 19:05:47752 {
753 "enable-javascript-harmony",
754 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
755 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
756 kOsAll,
757 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
758 },
[email protected]7e7f378a2012-01-05 14:35:37759 {
[email protected]85646172012-01-09 22:45:54760 "enable-tab-browser-dragging",
761 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
762 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
763 kOsWin,
764 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
765 },
766 {
[email protected]068b7b52012-02-27 12:41:44767 "disable-restore-session-state",
768 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
769 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37770 kOsAll,
[email protected]068b7b52012-02-27 12:41:44771 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37772 },
[email protected]88864db2012-01-18 20:56:35773 {
774 "disable-software-rasterizer",
775 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
776 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
777#if defined(ENABLE_SWIFTSHADER)
778 kOsAll,
779#else
780 0,
781#endif
782 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
783 },
[email protected]15a5d722012-01-23 09:11:14784 {
[email protected]ff7b6dd2012-09-15 20:20:03785 "enable-experimental-webkit-features",
786 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
787 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16788 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03789 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49790 },
791 {
[email protected]0f95a252012-09-13 22:30:04792 "enable-css-shaders",
793 IDS_FLAGS_CSS_SHADERS_NAME,
794 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
795 kOsAll,
796 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
797 },
798 {
[email protected]9860c68b2012-02-02 01:58:09799 "enable-extension-activity-ui",
800 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
801 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56802 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09803 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00804 },
[email protected]54ae4e92012-02-16 15:19:05805 {
[email protected]3e8befc2012-03-13 01:17:03806 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16807 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
808 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56809 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03810 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16811 },
[email protected]dc04be7c2012-03-15 23:57:49812#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01813 {
[email protected]3cd198a22012-03-12 20:38:01814 "enable-ash-oak",
815 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
816 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
817 kOsAll,
818 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
819 },
[email protected]31cf1c52012-02-29 20:55:01820#endif
[email protected]184ec592012-03-01 11:54:28821 {
822 "enable-devtools-experiments",
823 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
824 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56825 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28826 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
827 },
[email protected]76d1854e2012-03-02 23:57:44828 {
[email protected]2fefdb32013-02-26 14:28:10829 "silent-debugger-extension-api",
830 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
831 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
832 kOsDesktop,
833 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
834 },
835 {
[email protected]76d1854e2012-03-02 23:57:44836 "enable-suggestions-ntp",
837 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
838 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56839 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44840 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
841 },
[email protected]a3d54252012-04-05 20:04:13842 {
[email protected]1dbaf5e2012-11-30 05:51:32843 "spellcheck-autocorrect",
844 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
845 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
846 kOsWin | kOsLinux | kOsCrOS,
847 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
848 },
849 {
[email protected]d7932532012-11-21 21:10:31850 "touch-events",
851 IDS_TOUCH_EVENTS_NAME,
852 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56853 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31854 MULTI_VALUE_TYPE(kTouchEventsChoices)
855 },
856 {
[email protected]c9c73ad42012-04-18 03:35:59857 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06858 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
859 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55860 kOsWin,
[email protected]347a0c72012-05-14 20:28:06861 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59862 },
[email protected]8a6aaa72012-04-20 20:53:58863 {
[email protected]b9c96ff2012-11-26 22:24:40864 "disable-touch-adjustment",
865 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
866 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
867 kOsWin | kOsLinux | kOsCrOS,
868 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
869 },
870 {
[email protected]0b9383a2012-10-26 00:58:16871 "enable-tab-capture",
872 IDS_ENABLE_TAB_CAPTURE_NAME,
873 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25874 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44875 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
876 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16877 },
[email protected]0b60afa2012-04-19 17:36:39878#if defined(OS_CHROMEOS)
879 {
[email protected]7c4a9bc2012-09-11 22:10:05880 "enable-background-loader",
881 IDS_ENABLE_BACKLOADER_NAME,
882 IDS_ENABLE_BACKLOADER_DESCRIPTION,
883 kOsCrOS,
884 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
885 },
886 {
[email protected]c5667b282012-08-31 00:32:50887 "enable-bezel-touch",
888 IDS_ENABLE_BEZEL_TOUCH_NAME,
889 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47890 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50891 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47892 },
893 {
[email protected]3f4181a2013-02-01 21:31:07894 "enable-screensaver-extension",
895 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
896 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
897 kOsCrOS,
898 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
899 },
900 {
[email protected]0b60afa2012-04-19 17:36:39901 "no-discard-tabs",
902 IDS_FLAGS_NO_DISCARD_TABS_NAME,
903 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
904 kOsCrOS,
905 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
906 },
907#endif
[email protected]79be6d32012-04-24 20:47:44908 {
[email protected]8d68a3e02013-01-12 15:57:10909 "enable-download-resumption",
910 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
911 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56912 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10913 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
914 },
915 {
[email protected]9a5940d2012-04-27 19:16:23916 "allow-nacl-socket-api",
917 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
918 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56919 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23920 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
921 },
[email protected]85333732012-05-01 19:02:24922 {
[email protected]60673ad72012-05-02 06:16:33923 "stacked-tab-strip",
924 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
925 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
926 kOsWin,
927 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
928 },
929 {
[email protected]4bd20202012-06-14 17:35:01930 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24931 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
932 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
933 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01934 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24935 },
[email protected]190349fd2012-05-02 00:10:47936#if defined(OS_CHROMEOS)
937 {
938 "allow-touchpad-three-finger-click",
939 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
940 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
941 kOsCrOS,
942 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
943 },
[email protected]fbc176b62012-10-27 02:19:58944 {
945 "allow-touchpad-three-finger-swipe",
946 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
947 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
948 kOsCrOS,
949 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
950 },
[email protected]190349fd2012-05-02 00:10:47951#endif
[email protected]1992a2f42012-10-23 18:32:21952 {
[email protected]a585e462013-01-26 00:37:15953 "use-client-login-signin-flow",
954 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
955 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21956 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15957 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21958 },
[email protected]8ee02242012-12-04 15:23:32959 {
960 "enable-desktop-guest-mode",
961 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
962 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
963 kOsMac | kOsWin | kOsLinux,
964 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
965 },
[email protected]53520b1b2012-05-07 21:43:37966#if defined(USE_ASH)
967 {
[email protected]8257d382013-03-26 13:08:42968 "show-launcher-alignment-menu",
969 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
970 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42971 kOsAll,
[email protected]8257d382013-03-26 13:08:42972 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42973 },
974 {
[email protected]73074742012-05-17 01:44:41975 "show-touch-hud",
976 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
977 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
978 kOsAll,
979 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
980 },
981 {
[email protected]9f0940b62012-05-23 22:56:35982 "enable-pinch",
983 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
984 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06985 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38986 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
987 },
988 {
989 "pinch-zoom-scrollbars",
990 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
991 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
992 kOsCrOS,
993 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
994 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:35995 },
[email protected]a8379312012-06-15 00:20:43996 {
997 "app-list-show-apps-only",
998 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
999 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
1000 kOsAll,
[email protected]0bc6c272012-07-17 03:32:031001 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:431002 },
[email protected]73074742012-05-17 01:44:411003#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:281004#if defined(OS_CHROMEOS)
1005 {
[email protected]8b04a1652012-08-04 02:59:491006 "disable-boot-animation",
1007 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1008 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581009 kOsCrOSOwnerOnly,
[email protected]8b04a1652012-08-04 02:59:491010 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
1011 },
[email protected]95058572012-08-20 14:57:291012 {
[email protected]b4557192012-09-19 11:29:581013 "disable-boot-animation2",
1014 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1015 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581016 kOsCrOSOwnerOnly,
[email protected]b4557192012-09-19 11:29:581017 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1018 },
1019 {
[email protected]ea2f3342012-09-21 21:13:361020 "boot-animation-fucntion",
1021 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1022 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581023 kOsCrOSOwnerOnly,
[email protected]ea2f3342012-09-21 21:13:361024 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1025 },
[email protected]839667d62012-10-23 19:38:571026 {
[email protected]d96aef22012-10-30 11:47:021027 "captive-portal-detector",
1028 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1029 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581030 kOsCrOSOwnerOnly,
[email protected]d96aef22012-10-30 11:47:021031 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1032 },
1033 {
[email protected]c11aa8f12012-12-18 18:43:141034 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571035 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1036 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1037 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141038 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571039 },
[email protected]f0280952012-11-06 20:30:501040 {
[email protected]ea2fab32013-04-16 06:55:021041 "file-manager-legacy",
1042 IDS_FLAGS_FILE_MANAGER_LEGACY_NAME,
1043 IDS_FLAGS_FILE_MANAGER_LEGACY_DESCRIPTION,
[email protected]0fb5c4852012-11-08 20:33:231044 kOsCrOS,
[email protected]ea2fab32013-04-16 06:55:021045 SINGLE_VALUE_TYPE(switches::kFileManagerLegacy),
[email protected]0fb5c4852012-11-08 20:33:231046 },
[email protected]3e035e82012-11-27 20:54:321047 {
[email protected]bc545292013-04-18 14:33:101048 "file-manager-new-ui",
1049 IDS_FLAGS_FILE_MANAGER_NEW_UI_NAME,
1050 IDS_FLAGS_FILE_MANAGER_NEW_UI_DESCRIPTION,
1051 kOsCrOS,
1052 SINGLE_VALUE_TYPE(switches::kFileManagerNewUI),
1053 },
1054 {
[email protected]8039e06c2013-01-17 23:34:501055 "disable-launcher-per-display",
1056 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1057 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351058 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501059 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351060 },
[email protected]06b146d2013-02-07 06:06:471061 {
[email protected]c64d7732013-03-25 18:09:501062 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521063 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1064 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:581065 kOsCrOSOwnerOnly,
[email protected]640aa2b2013-03-22 16:00:521066 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471067 },
[email protected]6ad015c2013-03-06 00:49:511068 {
[email protected]c64d7732013-03-25 18:09:501069 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521070 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1071 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511072 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521073 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511074 },
[email protected]62018dc2012-12-13 00:37:351075#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391076 {
[email protected]6247aba2013-03-04 22:57:181077 "views-textfield",
1078 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1079 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391080 kOsWin,
[email protected]6247aba2013-03-04 22:57:181081 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1082 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391083 },
[email protected]bd0cd3bb2012-06-14 03:03:381084 {
[email protected]2d4817742012-12-17 20:16:181085 "enable-new-dialog-style",
1086 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1087 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321088 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181089 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321090 },
[email protected]7db8893a2012-07-26 00:49:401091 { "disable-accelerated-video-decode",
1092 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1093 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561094 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401095 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151096 },
[email protected]66ae9fc2012-06-19 21:33:521097#if defined(USE_ASH)
1098 {
1099 "ash-debug-shortcuts",
1100 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1101 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1102 kOsAll,
1103 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1104 },
1105#endif
[email protected]37fee0942012-08-07 21:07:451106 {
[email protected]ad3f6d22012-08-29 02:34:191107 "enable-contacts",
1108 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1109 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1110 kOsCrOS,
1111 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1112 },
[email protected]1d9bb9cd2012-08-28 22:02:501113#if defined(USE_ASH)
1114 { "ash-enable-advanced-gestures",
1115 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1116 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1117 kOsCrOS,
1118 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1119 },
[email protected]cfa24e62013-02-13 21:19:111120 { "ash-disable-tab-scrubbing",
1121 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1122 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161123 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111124 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161125 },
[email protected]83eef802012-12-02 07:43:521126 { "ash-enable-workspace-scrubbing",
1127 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1128 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1129 kOsCrOS,
1130 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1131 },
[email protected]819e58d22013-03-20 00:16:111132 { "ash-immersive-fullscreen",
1133 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1134 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241135 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111136 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241137 },
[email protected]316708a2012-11-05 22:57:021138#if defined(OS_LINUX)
1139 { "ash-enable-memory-monitor",
1140 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1141 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1142 kOsCrOS,
1143 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1144 },
1145#endif
[email protected]1d9bb9cd2012-08-28 22:02:501146#endif
[email protected]9b7ab882012-09-10 23:46:361147#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091148 { "ash-disable-new-network-status-area",
1149 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1150 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461151 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091152 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461153 },
[email protected]9b7ab882012-09-10 23:46:361154 {
[email protected]205f07892012-10-16 20:26:221155 "enable-carrier-switching",
1156 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1157 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1158 kOsCrOS,
1159 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1160 },
1161 {
[email protected]9b7ab882012-09-10 23:46:361162 "enable-request-tablet-site",
1163 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1164 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1165 kOsCrOS,
1166 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1167 },
1168#endif
[email protected]dab49c0b2012-10-04 05:55:351169 {
1170 "debug-packed-apps",
1171 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1172 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561173 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351174 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1175 },
[email protected]d1459ed2012-10-10 01:29:331176 {
1177 "enable-password-generation",
1178 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1179 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561180 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331181 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1182 },
[email protected]26d045f2012-10-18 21:18:431183 {
[email protected]76f7d4882012-10-26 21:09:221184 "enable-deferred-image-decoding",
1185 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1186 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221187 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221188 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1189 },
1190 {
[email protected]075543d2012-10-24 01:29:141191 "performance-monitor-gathering",
1192 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1193 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1194 kOsAll,
1195 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1196 },
[email protected]783d5bb2012-10-24 03:47:141197 {
[email protected]90b482d2013-04-04 10:45:581198 "disable-native-autofill-ui",
1199 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1200 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431201 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581202 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431203 },
1204 {
[email protected]a7259fb2012-11-08 06:22:231205 "enable-experimental-form-filling",
1206 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1207 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1208 kOsWin | kOsCrOS,
[email protected]e217c5632013-04-12 19:11:481209 SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling)
[email protected]a7259fb2012-11-08 06:22:231210 },
[email protected]6e6efe42013-01-30 00:04:501211 {
[email protected]db3178c2013-03-21 14:54:541212 "wallet-service-use-prod",
1213 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1214 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1215 kOsCrOS | kOsWin,
[email protected]e217c5632013-04-12 19:11:481216 SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd)
[email protected]db3178c2013-03-21 14:54:541217 },
1218 {
[email protected]6e6efe42013-01-30 00:04:501219 "enable-interactive-autocomplete",
1220 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1221 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221222 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501223 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1224 },
[email protected]edbea622012-11-28 20:39:381225 {
1226 "enable-touch-drag-drop",
1227 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1228 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1229 kOsWin | kOsCrOS,
1230 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1231 },
[email protected]0e2f43b62013-02-21 00:47:151232 {
1233 "enable-touch-editing",
1234 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1235 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1236 kOsCrOS,
1237 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1238 },
[email protected]f1c39242013-01-29 16:13:011239#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201240 {
1241 "enable-rich-notifications",
1242 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1243 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1244 kOsWin | kOsCrOS,
[email protected]aee412aa2013-04-02 20:01:231245 ENABLE_DISABLE_VALUE_TYPE(
1246 message_center::switches::kEnableRichNotifications,
1247 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201248 },
[email protected]f1c39242013-01-29 16:13:011249#endif
[email protected]4d51c682012-12-11 11:34:551250 {
1251 "full-history-sync",
1252 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1253 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1254 kOsAll,
1255 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1256 },
[email protected]628a69a92012-12-23 04:09:341257 {
[email protected]fd030142013-02-08 02:04:381258 "enable-usermedia-screen-capture",
1259 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1260 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1261 kOsDesktop,
1262 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1263 },
[email protected]5b93e162013-02-19 06:33:091264 {
1265 "enable-apps-devtool-app",
1266 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1267 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1268 kOsDesktop,
1269 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1270 },
[email protected]9323fdd12013-02-23 00:31:361271 {
1272 "impl-side-painting",
1273 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1274 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041275 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361276 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1277 },
[email protected]a42c85f2013-04-04 18:15:121278 {
[email protected]1c92d3e2013-04-18 05:31:391279 "enable-websocket-experimental-implementation",
1280 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME,
1281 IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION,
1282 kOsAll,
1283 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket)
1284 },
1285 {
[email protected]a42c85f2013-04-04 18:15:121286 "max-tiles-for-interest-area",
1287 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1288 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1289 kOsAndroid | kOsLinux | kOsCrOS,
1290 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1291 },
[email protected]2f2f72b2013-03-08 22:37:311292 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1293#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371294 {
1295 "track-active-visit-time",
1296 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1297 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1298 kOsWin,
1299 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1300 },
[email protected]2f2f72b2013-03-08 22:37:311301#endif
[email protected]8cc71d42013-03-02 17:26:081302#if defined(OS_ANDROID)
1303 {
1304 "disable-gesture-requirement-for-media-playback",
1305 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1306 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1307 kOsAndroid,
1308 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1309 },
1310#endif
[email protected]e79f2fd52013-03-08 23:52:471311#if defined(OS_CHROMEOS)
1312 {
1313 "enable-experimental-bluetooth",
1314 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1315 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1316 kOsCrOS,
1317 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1318 },
1319#endif
[email protected]6077cab2013-03-11 19:36:141320#if defined(ENABLE_GOOGLE_NOW)
1321 {
1322 "enable-google-now",
1323 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1324 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1325 kOsWin | kOsCrOS,
1326 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1327 },
1328#endif
[email protected]4a9e2e02013-04-08 16:19:491329 {
1330 "enable-translate-alpha-languages",
1331 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1332 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1333 kOsAll,
1334 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1335 },
[email protected]86459e2c2013-04-10 13:39:241336#if defined(OS_CHROMEOS)
1337 {
1338 "enable-virtual-keyboard",
1339 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1340 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1341 kOsCrOS,
1342 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1343 },
1344#endif
[email protected]38484df12013-04-10 16:42:031345 {
1346 "enable-simple-cache-backend",
1347 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1348 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
1349 kOsAndroid,
1350 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1351 },
[email protected]717e4e22013-04-10 20:52:231352 {
1353 "enable-tcp-fast-open",
1354 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1355 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111356 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231357 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1358 },
[email protected]8027acd2013-04-18 08:35:151359 {
1360 "enable-webp-in-accept-header",
1361 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_NAME,
1362 IDS_FLAGS_ENABLE_WEBP_IN_ACCEPT_HEADER_DESCRIPTION,
1363 kOsAll,
1364 SINGLE_VALUE_TYPE(switches::kEnableWebPInAcceptHeader)
1365 },
[email protected]a0e4b072011-08-17 01:47:071366};
[email protected]ad2a3ded2010-08-27 13:19:051367
[email protected]a314ee5a2010-10-26 21:23:281368const Experiment* experiments = kExperiments;
1369size_t num_experiments = arraysize(kExperiments);
1370
[email protected]e2ddbc92010-10-15 20:02:071371// Stores and encapsulates the little state that about:flags has.
1372class FlagsState {
1373 public:
1374 FlagsState() : needs_restart_(false) {}
1375 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1376 bool IsRestartNeededToCommitChanges();
1377 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281378 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071379 void RemoveFlagsSwitches(
1380 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001381 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071382 void reset();
1383
1384 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551385 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071386 return Singleton<FlagsState>::get();
1387 }
1388
1389 private:
1390 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531391 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071392
1393 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1394};
1395
[email protected]c7b7800a2010-10-07 18:51:351396// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491397// in a set.
[email protected]1a47d7e2010-10-15 00:37:241398void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051399 const ListValue* enabled_experiments = prefs->GetList(
1400 prefs::kEnabledLabsExperiments);
1401 if (!enabled_experiments)
1402 return;
1403
1404 for (ListValue::const_iterator it = enabled_experiments->begin();
1405 it != enabled_experiments->end();
1406 ++it) {
1407 std::string experiment_name;
1408 if (!(*it)->GetAsString(&experiment_name)) {
1409 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1410 continue;
1411 }
1412 result->insert(experiment_name);
1413 }
1414}
1415
[email protected]c6343372013-03-13 17:05:491416// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241417void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051418 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381419 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1420 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051421
1422 experiments_list->Clear();
1423 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1424 it != enabled_experiments.end();
1425 ++it) {
1426 experiments_list->Append(new StringValue(*it));
1427 }
1428}
1429
[email protected]8a6ff28d2010-12-02 16:35:191430// Adds the internal names for the specified experiment to |names|.
1431void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1432 if (e.type == Experiment::SINGLE_VALUE) {
1433 names->insert(e.internal_name);
1434 } else {
[email protected]83e9fa702013-02-25 19:30:441435 DCHECK(e.type == Experiment::MULTI_VALUE ||
1436 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191437 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441438 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191439 }
1440}
1441
[email protected]28e35af2011-02-09 12:56:221442// Confirms that an experiment is valid, used in a DCHECK in
1443// SanitizeList below.
1444bool ValidateExperiment(const Experiment& e) {
1445 switch (e.type) {
1446 case Experiment::SINGLE_VALUE:
1447 DCHECK_EQ(0, e.num_choices);
1448 DCHECK(!e.choices);
1449 break;
1450 case Experiment::MULTI_VALUE:
1451 DCHECK_GT(e.num_choices, 0);
1452 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531453 DCHECK(e.choices[0].command_line_switch);
1454 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221455 break;
[email protected]83e9fa702013-02-25 19:30:441456 case Experiment::ENABLE_DISABLE_VALUE:
1457 DCHECK_EQ(3, e.num_choices);
1458 DCHECK(!e.choices);
1459 DCHECK(e.command_line_switch);
1460 DCHECK(e.command_line_value);
1461 DCHECK(e.disable_command_line_switch);
1462 DCHECK(e.disable_command_line_value);
1463 break;
[email protected]28e35af2011-02-09 12:56:221464 default:
1465 NOTREACHED();
1466 }
1467 return true;
1468}
1469
[email protected]ad2a3ded2010-08-27 13:19:051470// Removes all experiments from prefs::kEnabledLabsExperiments that are
1471// unknown, to prevent this list to become very long as experiments are added
1472// and removed.
1473void SanitizeList(PrefService* prefs) {
1474 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221475 for (size_t i = 0; i < num_experiments; ++i) {
1476 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191477 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221478 }
[email protected]ad2a3ded2010-08-27 13:19:051479
1480 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241481 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051482
1483 std::set<std::string> new_enabled_experiments;
1484 std::set_intersection(
1485 known_experiments.begin(), known_experiments.end(),
1486 enabled_experiments.begin(), enabled_experiments.end(),
1487 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1488
[email protected]4c8853f2012-07-23 01:29:161489 if (new_enabled_experiments != enabled_experiments)
1490 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051491}
1492
[email protected]1a47d7e2010-10-15 00:37:241493void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051494 PrefService* prefs, std::set<std::string>* result) {
1495 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241496 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051497}
1498
[email protected]a314ee5a2010-10-26 21:23:281499// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1500// enabled on the current platform.
1501void GetSanitizedEnabledFlagsForCurrentPlatform(
1502 PrefService* prefs, std::set<std::string>* result) {
1503 GetSanitizedEnabledFlags(prefs, result);
1504
1505 // Filter out any experiments that aren't enabled on the current platform. We
1506 // don't remove these from prefs else syncing to a platform with a different
1507 // set of experiments would be lossy.
1508 std::set<std::string> platform_experiments;
1509 int current_platform = GetCurrentPlatform();
1510 for (size_t i = 0; i < num_experiments; ++i) {
1511 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191512 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:581513#if defined(OS_CHROMEOS)
1514 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
1515 AddInternalName(experiments[i], &platform_experiments);
1516#endif
[email protected]a314ee5a2010-10-26 21:23:281517 }
1518
1519 std::set<std::string> new_enabled_experiments;
1520 std::set_intersection(
1521 platform_experiments.begin(), platform_experiments.end(),
1522 result->begin(), result->end(),
1523 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1524
1525 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051526}
1527
[email protected]8a6ff28d2010-12-02 16:35:191528// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191529Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221530 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441531 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1532 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191533 ListValue* result = new ListValue;
1534 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191535 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441536 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191537 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441538 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221539 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191540 result->Append(value);
1541 }
1542 return result;
1543}
1544
[email protected]e2ddbc92010-10-15 20:02:071545} // namespace
1546
[email protected]83e9fa702013-02-25 19:30:441547std::string Experiment::NameForChoice(int index) const {
1548 DCHECK(type == Experiment::MULTI_VALUE ||
1549 type == Experiment::ENABLE_DISABLE_VALUE);
1550 DCHECK_LT(index, num_choices);
1551 return std::string(internal_name) + testing::kMultiSeparator +
1552 base::IntToString(index);
1553}
1554
1555string16 Experiment::DescriptionForChoice(int index) const {
1556 DCHECK(type == Experiment::MULTI_VALUE ||
1557 type == Experiment::ENABLE_DISABLE_VALUE);
1558 DCHECK_LT(index, num_choices);
1559 int description_id;
1560 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1561 const int kEnableDisableDescriptionIds[] = {
1562 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1563 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1564 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1565 };
1566 description_id = kEnableDisableDescriptionIds[index];
1567 } else {
1568 description_id = choices[index].description_id;
1569 }
1570 return l10n_util::GetStringUTF16(description_id);
1571}
1572
[email protected]1a47d7e2010-10-15 00:37:241573void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551574 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051575}
1576
[email protected]37736bd2013-04-18 11:53:581577ListValue* GetFlagsExperimentsData(PrefService* prefs, FlagAccess access) {
[email protected]ad2a3ded2010-08-27 13:19:051578 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241579 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051580
1581 int current_platform = GetCurrentPlatform();
1582
1583 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281584 for (size_t i = 0; i < num_experiments; ++i) {
1585 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051586
[email protected]1fd1f292013-03-23 23:08:401587#if defined(OS_ANDROID)
1588 // Special case enable-spdy-proxy-auth, because it should only
1589 // be available on Dev and Beta channels.
1590 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1591 chrome::VersionInfo::GetChannel() ==
1592 chrome::VersionInfo::CHANNEL_STABLE)
1593 continue;
1594#endif
1595
[email protected]ad2a3ded2010-08-27 13:19:051596 DictionaryValue* data = new DictionaryValue();
1597 data->SetString("internal_name", experiment.internal_name);
1598 data->SetString("name",
1599 l10n_util::GetStringUTF16(experiment.visible_name_id));
1600 data->SetString("description",
1601 l10n_util::GetStringUTF16(
1602 experiment.visible_description_id));
[email protected]37736bd2013-04-18 11:53:581603 bool supported = (experiment.supported_platforms & current_platform) != 0;
1604#if defined(OS_CHROMEOS)
1605 if (access == kOwnerAccessToFlags &&
1606 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0)
1607 supported = true;
1608#endif
[email protected]cc3e2052011-12-20 01:01:401609 data->SetBoolean("supported", supported);
1610
1611 ListValue* supported_platforms = new ListValue();
1612 AddOsStrings(experiment.supported_platforms, supported_platforms);
1613 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051614
[email protected]28e35af2011-02-09 12:56:221615 switch (experiment.type) {
1616 case Experiment::SINGLE_VALUE:
1617 data->SetBoolean(
1618 "enabled",
1619 enabled_experiments.count(experiment.internal_name) > 0);
1620 break;
1621 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441622 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221623 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1624 break;
1625 default:
1626 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191627 }
1628
[email protected]ad2a3ded2010-08-27 13:19:051629 experiments_data->Append(data);
1630 }
1631 return experiments_data;
1632}
1633
[email protected]ad2a3ded2010-08-27 13:19:051634bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551635 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051636}
1637
1638void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351639 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551640 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071641}
1642
1643void RemoveFlagsSwitches(
1644 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551645 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071646}
1647
[email protected]cb93bf52013-02-20 01:20:001648void ResetAllFlags(PrefService* prefs) {
1649 FlagsState::GetInstance()->ResetAllFlags(prefs);
1650}
1651
[email protected]a314ee5a2010-10-26 21:23:281652int GetCurrentPlatform() {
1653#if defined(OS_MACOSX)
1654 return kOsMac;
1655#elif defined(OS_WIN)
1656 return kOsWin;
1657#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1658 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211659#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281660 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401661#elif defined(OS_ANDROID)
1662 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281663#else
1664#error Unknown platform
1665#endif
1666}
1667
[email protected]4bc5050c2010-11-18 17:55:541668void RecordUMAStatistics(const PrefService* prefs) {
1669 std::set<std::string> flags;
1670 GetEnabledFlags(prefs, &flags);
1671 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1672 ++it) {
1673 std::string action("AboutFlags_");
1674 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381675 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541676 }
1677 // Since flag metrics are recorded every startup, add a tick so that the
1678 // stats can be made meaningful.
1679 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381680 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1681 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541682}
1683
[email protected]e2ddbc92010-10-15 20:02:071684//////////////////////////////////////////////////////////////////////////////
1685// FlagsState implementation.
1686
1687namespace {
1688
[email protected]83e9fa702013-02-25 19:30:441689typedef std::map<std::string, std::pair<std::string, std::string> >
1690 NameToSwitchAndValueMap;
1691
1692void SetFlagToSwitchMapping(const std::string& key,
1693 const std::string& switch_name,
1694 const std::string& switch_value,
1695 NameToSwitchAndValueMap* name_to_switch_map) {
1696 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1697 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1698}
1699
[email protected]e2ddbc92010-10-15 20:02:071700void FlagsState::ConvertFlagsToSwitches(
1701 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071702 if (command_line->HasSwitch(switches::kNoExperiments))
1703 return;
1704
1705 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001706
[email protected]a314ee5a2010-10-26 21:23:281707 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071708
[email protected]a82744532011-02-11 16:15:531709 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191710 for (size_t i = 0; i < num_experiments; ++i) {
1711 const Experiment& e = experiments[i];
1712 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441713 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1714 e.command_line_value, &name_to_switch_map);
1715 } else if (e.type == Experiment::MULTI_VALUE) {
1716 for (int j = 0; j < e.num_choices; ++j) {
1717 SetFlagToSwitchMapping(e.NameForChoice(j),
1718 e.choices[j].command_line_switch,
1719 e.choices[j].command_line_value,
1720 &name_to_switch_map);
1721 }
[email protected]8a6ff28d2010-12-02 16:35:191722 } else {
[email protected]83e9fa702013-02-25 19:30:441723 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1724 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1725 &name_to_switch_map);
1726 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1727 e.command_line_value, &name_to_switch_map);
1728 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1729 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191730 }
1731 }
[email protected]e2ddbc92010-10-15 20:02:071732
1733 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531734 flags_switches_.insert(
1735 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1736 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071737 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1738 it != enabled_experiments.end();
1739 ++it) {
1740 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531741 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191742 name_to_switch_map.find(experiment_name);
1743 if (name_to_switch_it == name_to_switch_map.end()) {
1744 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071745 continue;
[email protected]8a6ff28d2010-12-02 16:35:191746 }
[email protected]e2ddbc92010-10-15 20:02:071747
[email protected]a82744532011-02-11 16:15:531748 const std::pair<std::string, std::string>&
1749 switch_and_value_pair = name_to_switch_it->second;
1750
1751 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1752 switch_and_value_pair.second);
1753 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071754 }
1755 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531756 flags_switches_.insert(
1757 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1758 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071759}
1760
1761bool FlagsState::IsRestartNeededToCommitChanges() {
1762 return needs_restart_;
1763}
1764
1765void FlagsState::SetExperimentEnabled(
1766 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441767 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191768 if (at_index != std::string::npos) {
1769 DCHECK(enable);
1770 // We're being asked to enable a multi-choice experiment. Disable the
1771 // currently selected choice.
1772 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221773 const std::string experiment_name = internal_name.substr(0, at_index);
1774 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191775
[email protected]28e35af2011-02-09 12:56:221776 // And enable the new choice, if it is not the default first choice.
1777 if (internal_name != experiment_name + "@0") {
1778 std::set<std::string> enabled_experiments;
1779 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081780 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221781 SetEnabledFlags(prefs, enabled_experiments);
1782 }
[email protected]8a6ff28d2010-12-02 16:35:191783 return;
1784 }
1785
[email protected]ad2a3ded2010-08-27 13:19:051786 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241787 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051788
[email protected]8a6ff28d2010-12-02 16:35:191789 const Experiment* e = NULL;
1790 for (size_t i = 0; i < num_experiments; ++i) {
1791 if (experiments[i].internal_name == internal_name) {
1792 e = experiments + i;
1793 break;
1794 }
1795 }
1796 DCHECK(e);
1797
1798 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591799 if (enable)
[email protected]147492b2013-03-19 23:52:081800 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591801 else
[email protected]147492b2013-03-19 23:52:081802 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191803 } else {
1804 if (enable) {
1805 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081806 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191807 } else {
1808 // Find the currently enabled choice and disable it.
1809 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441810 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191811 if (enabled_experiments.find(choice_name) !=
1812 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081813 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191814 enabled_experiments.erase(choice_name);
1815 // Continue on just in case there's a bug and more than one
1816 // experiment for this choice was enabled.
1817 }
1818 }
1819 }
1820 }
[email protected]ad2a3ded2010-08-27 13:19:051821
[email protected]1a47d7e2010-10-15 00:37:241822 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051823}
1824
[email protected]e2ddbc92010-10-15 20:02:071825void FlagsState::RemoveFlagsSwitches(
1826 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531827 for (std::map<std::string, std::string>::const_iterator
1828 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1829 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071830 }
1831}
1832
[email protected]cb93bf52013-02-20 01:20:001833void FlagsState::ResetAllFlags(PrefService* prefs) {
1834 needs_restart_ = true;
1835
1836 std::set<std::string> no_experiments;
1837 SetEnabledFlags(prefs, no_experiments);
1838}
1839
[email protected]e2ddbc92010-10-15 20:02:071840void FlagsState::reset() {
1841 needs_restart_ = false;
1842 flags_switches_.clear();
1843}
1844
[email protected]38e46812011-05-09 20:49:221845} // namespace
[email protected]e2ddbc92010-10-15 20:02:071846
1847namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191848
1849// WARNING: '@' is also used in the html file. If you update this constant you
1850// also need to update the html file.
1851const char kMultiSeparator[] = "@";
1852
[email protected]e2ddbc92010-10-15 20:02:071853void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551854 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071855}
[email protected]a314ee5a2010-10-26 21:23:281856
1857void SetExperiments(const Experiment* e, size_t count) {
1858 if (!e) {
1859 experiments = kExperiments;
1860 num_experiments = arraysize(kExperiments);
1861 } else {
1862 experiments = e;
1863 num_experiments = count;
1864 }
1865}
1866
[email protected]8a6ff28d2010-12-02 16:35:191867const Experiment* GetExperiments(size_t* count) {
1868 *count = num_experiments;
1869 return experiments;
1870}
1871
[email protected]e2ddbc92010-10-15 20:02:071872} // namespace testing
1873
[email protected]1a47d7e2010-10-15 00:37:241874} // namespace about_flags