blob: 3b6c6221ab1b7dea965c2b9e3d0afe1586c94c7a [file] [log] [blame]
[email protected]9c66adc2012-01-05 02:10:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
7#include <algorithm>
8#include <iterator>
9#include <map>
10#include <set>
11
[email protected]ad2a3ded2010-08-27 13:19:0512#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1513#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5714#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4115#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0316#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0517#include "base/values.h"
[email protected]65bfd9972012-10-19 03:39:3718#include "cc/switches.h"
[email protected]1bc78422011-03-31 08:41:3819#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0320#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0521#include "chrome/common/chrome_switches.h"
22#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3823#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0224#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0525#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0226#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0227#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0328#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1729#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5930#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4831#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2732#include "ui/gl/gl_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4333#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0534
[email protected]f1c39242013-01-29 16:13:0135#if defined(ENABLE_MESSAGE_CENTER)
36#include "ui/message_center/message_center_switches.h"
37#endif
38
[email protected]dc04be7c2012-03-15 23:57:4939#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3140#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4941#endif
42
[email protected]badba1ad2012-11-16 17:21:4643#if defined(OS_CHROMEOS)
44#include "chromeos/chromeos_switches.h"
45#endif
46
[email protected]7f6f44c2011-12-14 13:23:3847using content::UserMetricsAction;
48
[email protected]1a47d7e2010-10-15 00:37:2449namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0550
[email protected]8a6ff28d2010-12-02 16:35:1951// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5352#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
53 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
54#define SINGLE_VALUE_TYPE(command_line_switch) \
55 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
56#define MULTI_VALUE_TYPE(choices) \
[email protected]0e6f56d2011-02-12 23:45:1557 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1958
[email protected]e2ddbc92010-10-15 20:02:0759namespace {
60
[email protected]9c7453d2012-01-21 00:45:4061const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5662const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0563
[email protected]cc3e2052011-12-20 01:01:4064// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
65// whether the experiment is available on that platform.
66void AddOsStrings(unsigned bitmask, ListValue* list) {
67 struct {
68 unsigned bit;
69 const char* const name;
70 } kBitsToOs[] = {
71 {kOsMac, "Mac"},
72 {kOsWin, "Windows"},
73 {kOsLinux, "Linux"},
74 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0175 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4076 };
77 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
78 if (bitmask & kBitsToOs[i].bit)
79 list->Append(new StringValue(kBitsToOs[i].name));
80}
81
[email protected]68317802012-06-07 19:13:2382const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
83 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
84 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
85 switches::kOmniboxHistoryQuickProviderNewScoring,
86 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
87 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
88 switches::kOmniboxHistoryQuickProviderNewScoring,
89 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
90};
91
[email protected]128dc6c2012-06-22 20:30:3592const Experiment::Choice
93 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
94 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
95 "",
96 "" },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
98 switches::kOmniboxHistoryQuickProviderReorderForInlining,
99 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
100 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
101 switches::kOmniboxHistoryQuickProviderReorderForInlining,
102 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
103};
104
[email protected]032d5e6c2012-02-17 17:53:55105const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
106 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
107 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
108 switches::kOmniboxInlineHistoryQuickProvider,
109 switches::kOmniboxInlineHistoryQuickProviderAllowed },
110 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
111 switches::kOmniboxInlineHistoryQuickProvider,
112 switches::kOmniboxInlineHistoryQuickProviderProhibited }
113};
114
[email protected]de023762012-07-26 17:10:17115const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = {
116 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
117 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
118 switches::kEnableFixedPositionCreatesStackingContext, ""},
119 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
120 switches::kDisableFixedPositionCreatesStackingContext, ""}
121};
122
[email protected]fb854192013-02-06 01:30:04123const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
124 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
125 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
126 switches::kEnableCompositingForFixedPosition, ""},
127 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
128 switches::kDisableCompositingForFixedPosition, ""},
129 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
130 switches::kEnableHighDpiCompositingForFixedPosition, ""}
131};
132
[email protected]9b19cf82012-06-13 06:23:23133const Experiment::Choice kForceCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20134 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
135 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]9b19cf82012-06-13 06:23:23136 switches::kForceCompositingMode, ""},
[email protected]a45c69402012-06-24 16:32:20137 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]9b19cf82012-06-13 06:23:23138 switches::kDisableForceCompositingMode, ""}
139};
140
[email protected]72787e392012-03-23 05:55:43141const Experiment::Choice kThreadedCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20142 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
143 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]72787e392012-03-23 05:55:43144 switches::kDisableThreadedCompositing, ""},
[email protected]a45c69402012-06-24 16:32:20145 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]72787e392012-03-23 05:55:43146 switches::kEnableThreadedCompositing, ""}
147};
148
[email protected]17e27692013-02-06 17:02:09149const Experiment::Choice kForceAcceleratedOverflowScrollModeChoices[] = {
150 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
152 switches::kDisableAcceleratedOverflowScroll, ""},
153 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
154 switches::kEnableAcceleratedOverflowScroll, ""}
155};
156
[email protected]8b1c3c72013-01-25 01:48:43157const Experiment::Choice kGDIPresentChoices[] = {
158 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
159 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
160 switches::kDoFirstShowPresentWithGDI, ""},
161 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
162 switches::kDoAllShowPresentWithGDI, ""}
163};
164
165
[email protected]d7932532012-11-21 21:10:31166const Experiment::Choice kTouchEventsChoices[] = {
167 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
168 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
169 switches::kTouchEvents,
170 switches::kTouchEventsEnabled },
171 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
172 switches::kTouchEvents,
173 switches::kTouchEventsDisabled }
174};
175
[email protected]347a0c72012-05-14 20:28:06176const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31177 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20178 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06179 switches::kTouchOptimizedUI,
180 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20181 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06182 switches::kTouchOptimizedUI,
183 switches::kTouchOptimizedUIDisabled }
184};
185
[email protected]026876f32012-08-22 23:53:40186const Experiment::Choice kAsyncDnsChoices[] = {
187 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
188 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
189 switches::kDisableAsyncDns, ""},
190 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
191 switches::kEnableAsyncDns, ""}
192};
193
[email protected]66f409c2012-10-04 20:59:04194const Experiment::Choice kNaClDebugMaskChoices[] = {
195 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
196 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
197 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
198 // an option to switch off its debugging.
199 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
200 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
201 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
202 switches::kNaClDebugMask, "*://*/*debug.nmf" }
203};
204
[email protected]544471a2012-10-13 05:27:09205const Experiment::Choice kActionBoxChoices[] = {
206 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
207 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
208 switches::kActionBox, "0"},
209 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
210 switches::kActionBox, "1"}
211};
212
213const Experiment::Choice kScriptBubbleChoices[] = {
214 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
215 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
216 switches::kScriptBubble, "0"},
217 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
218 switches::kScriptBubble, "1"}
219};
220
[email protected]0b9383a2012-10-26 00:58:16221const Experiment::Choice kTabCaptureChoices[] = {
222 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
223 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
224 switches::kTabCapture, "0"},
225 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
226 switches::kTabCapture, "1"}
227};
228
[email protected]ea2f3342012-09-21 21:13:36229#if defined(OS_CHROMEOS)
230const Experiment::Choice kAshBootAnimationFunction[] = {
231 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
232 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
233 ash::switches::kAshBootAnimationFunction2, ""},
234 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
235 ash::switches::kAshBootAnimationFunction3, ""}
236};
[email protected]d96aef22012-10-30 11:47:02237
238const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19239 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02240 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19241 switches::kEnableChromeCaptivePortalDetector, ""},
242 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
243 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02244};
[email protected]ea2f3342012-09-21 21:13:36245#endif
246
[email protected]4bc5050c2010-11-18 17:55:54247// RECORDING USER METRICS FOR FLAGS:
248// -----------------------------------------------------------------------------
249// The first line of the experiment is the internal name. If you'd like to
250// gather statistics about the usage of your flag, you should append a marker
251// comment to the end of the feature name, like so:
252// "my-special-feature", // FLAGS:RECORD_UMA
253//
254// After doing that, run //chrome/tools/extract_actions.py (see instructions at
255// the top of that file for details) to update the chromeactions.txt file, which
256// will enable UMA to record your feature flag.
257//
[email protected]783d5bb2012-10-24 03:47:14258// After your feature has shipped under a flag, you can locate the metrics under
259// the action name AboutFlags_internal-action-name. Actions are recorded once
260// per startup, so you should divide this number by AboutFlags_StartupTick to
261// get a sense of usage. Note that this will not be the same as number of users
262// with a given feature enabled because users can quit and relaunch the
263// application multiple times over a given time interval. The dashboard also
264// shows you how many (metrics reporting) users have enabled the flag over the
265// last seven days. However, note that this is not the same as the number of
266// users who have the flag enabled, since enabling the flag happens once,
267// whereas running with the flag enabled happens until the user flips the flag
268// again.
[email protected]4bc5050c2010-11-18 17:55:54269
[email protected]8a6ff28d2010-12-02 16:35:19270// To add a new experiment add to the end of kExperiments. There are two
271// distinct types of experiments:
272// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
273// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22274// . MULTI_VALUE: a list of choices, the first of which should correspond to a
275// deactivated state for this lab (i.e. no command line option). To specify
276// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
277// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19278// See the documentation of Experiment for details on the fields.
279//
280// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05281const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44282#if defined(OS_ANDROID)
283 {
284 "enable-spdy-proxy",
285 IDS_FLAGS_ENABLE_SPDY_PROXY_NAME,
286 IDS_FLAGS_ENABLE_SPDY_PROXY_DESCRIPTION,
287 kOsAndroid,
288 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxy)
289 },
290#endif
[email protected]ad2a3ded2010-08-27 13:19:05291 {
[email protected]aac169d2011-03-18 19:53:03292 "expose-for-tabs", // FLAGS:RECORD_UMA
293 IDS_FLAGS_TABPOSE_NAME,
294 IDS_FLAGS_TABPOSE_DESCRIPTION,
295 kOsMac,
296#if defined(OS_MACOSX)
297 // The switch exists only on OS X.
298 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
299#else
300 SINGLE_VALUE_TYPE("")
301#endif
302 },
303 {
[email protected]4bc5050c2010-11-18 17:55:54304 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05305 IDS_FLAGS_CONFLICTS_CHECK_NAME,
306 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
307 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19308 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05309 },
310 {
[email protected]4bc5050c2010-11-18 17:55:54311 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54312 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
313 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45314 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22315 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31316 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22317 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
318 // always have PDF rasterization available, so no flag needed there.
319#if !defined(GOOGLE_CHROME_BUILD)
320 kOsWin,
321#else
322 0,
[email protected]fa6d2a2f2010-11-30 21:47:19323#endif
[email protected]8a6ff28d2010-12-02 16:35:19324 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42325 },
[email protected]60d77bd2012-08-22 00:10:07326#if defined(OS_WIN)
327 {
328 "print-raster",
329 IDS_FLAGS_PRINT_RASTER_NAME,
330 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
331 kOsWin,
332 SINGLE_VALUE_TYPE(switches::kPrintRaster)
333 },
334#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05335 {
[email protected]bb461532010-11-26 21:50:23336 "crxless-web-apps",
337 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
338 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56339 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19340 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23341 },
342 {
[email protected]96c6f4c2011-05-18 19:36:22343 "ignore-gpu-blacklist",
344 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
345 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
346 kOsAll,
347 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
348 },
349 {
[email protected]0110cf112011-07-02 00:39:43350 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22351 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
352 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23353 kOsMac | kOsWin | kOsLinux,
354 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22355 },
356 {
[email protected]72787e392012-03-23 05:55:43357 "threaded-compositing-mode",
358 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
359 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56360 kOsDesktop & ~kOsCrOS,
[email protected]72787e392012-03-23 05:55:43361 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59362 },
363 {
[email protected]17e27692013-02-06 17:02:09364 "force-accelerated-composited-scrolling",
365 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
366 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
367 kOsAll,
368 MULTI_VALUE_TYPE(kForceAcceleratedOverflowScrollModeChoices)
369 },
370 {
[email protected]8b1c3c72013-01-25 01:48:43371 "present-with-GDI",
372 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
373 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
374 kOsWin,
375 MULTI_VALUE_TYPE(kGDIPresentChoices)
376 },
377 {
[email protected]81c64af62012-06-06 20:15:52378 "disable-accelerated-2d-canvas",
379 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
380 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
381 kOsAll,
382 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
383 },
384 {
[email protected]69cffc82012-08-10 13:27:27385 "disable-deferred-2d-canvas",
386 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
387 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
388 kOsAll,
389 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
390 },
391 {
[email protected]efcde132012-05-30 01:05:18392 "disable-threaded-animation",
393 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
394 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59395 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37396 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59397 },
398 {
[email protected]5963b772011-02-09 22:55:38399 "composited-layer-borders",
400 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
401 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
402 kOsAll,
403 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
404 },
405 {
[email protected]a8f1eaa2011-03-07 19:00:58406 "show-fps-counter",
407 IDS_FLAGS_SHOW_FPS_COUNTER,
408 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
409 kOsAll,
410 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
411 },
[email protected]8ff7f342011-05-25 01:49:47412 {
[email protected]70c98a332011-12-21 20:51:52413 "accelerated-filters",
414 IDS_FLAGS_ACCELERATED_FILTERS,
415 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
416 kOsAll,
417 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
418 },
419 {
[email protected]8ff7f342011-05-25 01:49:47420 "disable-gpu-vsync",
421 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
422 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56423 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47424 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
425 },
[email protected]deaba6d52011-09-23 14:47:12426 {
[email protected]4052d832013-01-16 05:31:01427 "enable-webgl",
428 IDS_FLAGS_ENABLE_WEBGL_NAME,
429 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
430 kOsAndroid,
431#if defined(OS_ANDROID)
432 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
433#else
434 SINGLE_VALUE_TYPE("")
435#endif
436 },
437 {
[email protected]deaba6d52011-09-23 14:47:12438 "disable-webgl",
439 IDS_FLAGS_DISABLE_WEBGL_NAME,
440 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56441 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01442#if defined(OS_ANDROID)
443 SINGLE_VALUE_TYPE("")
444#else
[email protected]deaba6d52011-09-23 14:47:12445 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01446#endif
[email protected]deaba6d52011-09-23 14:47:12447 },
[email protected]09096e02012-05-24 11:12:04448 {
[email protected]d9da9582013-01-31 04:59:05449 "enable-webrtc",
450 IDS_FLAGS_ENABLE_WEBRTC_NAME,
451 IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION,
452 kOsAndroid,
453#if defined(OS_ANDROID)
454 SINGLE_VALUE_TYPE(switches::kEnableWebRTC)
455#else
456 SINGLE_VALUE_TYPE("")
457#endif
458 },
459 {
[email protected]96bcdc102012-05-24 23:42:10460 "fixed-position-creates-stacking-context",
461 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
462 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
463 kOsAll,
[email protected]de023762012-07-26 17:10:17464 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10465 },
[email protected]fb854192013-02-06 01:30:04466 {
467 "enable-compositing-for-fixed-position",
468 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
469 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
470 kOsAll,
471 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
472 },
[email protected]a7640ef22012-10-06 00:52:08473 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53474 {
[email protected]e3791ce92011-08-09 01:03:32475 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40476 IDS_FLAGS_ENABLE_NACL_NAME,
477 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56478 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19479 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40480 },
[email protected]b39c6d92012-01-31 16:38:41481 // TODO(halyavin): When exception handling is on by default, replace this
482 // flag with disable-nacl-exception-handling.
483 {
484 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
485 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
486 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56487 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41488 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
489 },
[email protected]4ff87d202010-11-06 01:28:40490 {
[email protected]9addd1c2012-09-15 14:28:24491 "enable-nacl-debug", // FLAGS:RECORD_UMA
492 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
493 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56494 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24495 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13496 },
497 {
[email protected]66f409c2012-10-04 20:59:04498 "nacl-debug-mask", // FLAGS:RECORD_UMA
499 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
500 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56501 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04502 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
503 },
504 {
[email protected]7babd1c2012-08-08 20:35:29505 "enable-pnacl", // FLAGS:RECORD_UMA
506 IDS_FLAGS_ENABLE_PNACL_NAME,
507 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56508 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29509 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
510 },
511 {
[email protected]4bc5050c2010-11-18 17:55:54512 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32513 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
514 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56515 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19516 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32517 },
[email protected]3627b06d2010-11-12 16:36:16518 {
[email protected]544471a2012-10-13 05:27:09519 "action-box",
[email protected]cab18ef2012-04-27 07:22:03520 IDS_FLAGS_ACTION_BOX_NAME,
521 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56522 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09523 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03524 },
525 {
[email protected]3a362432012-06-18 20:39:51526 "script-badges",
527 IDS_FLAGS_SCRIPT_BADGES_NAME,
528 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56529 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09530 SINGLE_VALUE_TYPE(switches::kScriptBadges)
531 },
532 {
533 "script-bubble",
534 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
535 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56536 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09537 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51538 },
539 {
[email protected]cbe224d2011-08-04 22:12:49540 "apps-new-install-bubble",
541 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
542 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56543 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49544 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
545 },
546 {
[email protected]80bd24e2010-11-30 09:34:38547 "disable-hyperlink-auditing",
548 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
549 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
550 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19551 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51552 },
553 {
554 "experimental-location-features", // FLAGS:RECORD_UMA
555 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
556 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
557 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19558 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
559 },
560 {
[email protected]5aea1862011-03-23 23:55:39561 "tab-groups-context-menu",
562 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
563 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
564 kOsWin,
565 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
566 },
[email protected]c94cebd2012-06-21 00:55:28567 {
568 "enable-instant-extended-api",
569 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
570 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56571 kOsDesktop,
[email protected]c94cebd2012-06-21 00:55:28572 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
573 },
[email protected]e9bf9d92011-03-31 20:57:15574 {
[email protected]354e33b2011-06-15 00:29:10575 "static-ip-config",
576 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
577 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
578 kOsCrOS,
579#if defined(OS_CHROMEOS)
580 // This switch exists only on Chrome OS.
581 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
582#else
583 SINGLE_VALUE_TYPE("")
584#endif
585 },
[email protected]3eb5728c2011-06-20 22:32:24586 {
587 "show-autofill-type-predictions",
588 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
589 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
590 kOsAll,
591 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
592 },
[email protected]bff4d3e2011-06-21 23:58:52593 {
[email protected]fdf4e252012-04-27 00:26:55594 "sync-tab-favicons",
595 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
596 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
597 kOsAll,
598 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
599 },
600 {
[email protected]aae9eeb12011-10-21 21:59:26601 "sync-app-notifications",
602 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
603 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56604 kOsDesktop,
[email protected]0b6fba82011-11-18 01:31:11605 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26606 },
607 {
[email protected]5d90a0a2012-11-15 02:43:40608 "sync-keystore-encryption",
609 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
610 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
611 kOsAll,
612 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
613 },
614 {
[email protected]e755a382012-09-13 17:16:35615 "enable-gesture-tap-highlight",
616 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
617 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
618 kOsLinux | kOsCrOS,
619 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
620 },
621 {
[email protected]a22ebd812011-06-23 00:05:39622 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
623 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
624 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
625 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40626 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25627 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39628 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
629 },
[email protected]81a6b0b2011-06-24 17:55:40630 {
[email protected]68317802012-06-07 19:13:23631 "omnibox-history-quick-provider-new-scoring",
632 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
633 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
634 kOsAll,
635 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
636 },
637 {
[email protected]128dc6c2012-06-22 20:30:35638 "omnibox-history-quick-provider-reorder-for-inlining",
639 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
640 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
641 kOsAll,
642 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
643 },
644 {
[email protected]032d5e6c2012-02-17 17:53:55645 "omnibox-inline-history-quick-provider",
646 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
647 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
648 kOsAll,
649 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
650 },
651 {
[email protected]7e7a28092011-12-09 22:24:55652 "enable-panels",
653 IDS_FLAGS_ENABLE_PANELS_NAME,
654 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56655 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55656 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54657 },
[email protected]e3749d12011-07-25 22:22:12658 {
[email protected]fd38cc82012-12-19 18:19:29659 "enable-panel-stacking",
660 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
661 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56662 kOsDesktop,
[email protected]fd38cc82012-12-19 18:19:29663 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
664 },
665 {
[email protected]27c14f02012-06-22 17:29:58666 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27667 "save-page-as-mhtml", // FLAGS:RECORD_UMA
668 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
669 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
670 kOsMac | kOsWin | kOsLinux,
671 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
672 },
673 {
[email protected]b7bb44f2011-09-01 05:17:03674 "enable-autologin",
675 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
676 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
677 kOsMac | kOsWin | kOsLinux,
678 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
679 },
[email protected]b9841172011-09-26 23:36:09680 {
[email protected]3231b612012-03-23 05:57:54681 "enable-spdy3",
682 IDS_FLAGS_ENABLE_SPDY3_NAME,
683 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
684 kOsAll,
685 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
686 },
687 {
[email protected]27b3fe92012-03-21 05:35:06688 "enable-async-dns",
689 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
690 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46691 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40692 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06693 },
694 {
[email protected]1eb93802012-09-11 18:57:56695 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11696 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
697 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32698 kOsAll,
[email protected]da43c082012-09-07 18:56:11699 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44700 },
[email protected]e4e68dbb2011-11-18 01:50:22701 {
[email protected]36d98412013-01-31 20:28:53702 "disable-encrypted-media",
703 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
704 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56705 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53706 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03707 },
[email protected]f88628792012-12-18 07:07:50708 {
709 "enable-opus-playback",
710 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
711 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56712 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50713 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
714 },
[email protected]ca6eaa5a2013-01-24 16:16:04715 {
[email protected]c54e1aa2013-01-25 09:26:17716 "enable-vp9-playback",
717 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
718 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
719 kOsDesktop,
720 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
721 },
722 {
[email protected]ca6eaa5a2013-01-24 16:16:04723 "enable-managed-users",
724 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
725 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
726 kOsAll,
727 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
728 },
[email protected]dc04be7c2012-03-15 23:57:49729#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50730 {
[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,
749#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37750 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15751#else
752 0,
753#endif
[email protected]65bfd9972012-10-19 03:39:37754 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15755 },
[email protected]bf88c032011-12-22 19:05:47756 {
757 "enable-javascript-harmony",
758 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
759 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
762 },
[email protected]7e7f378a2012-01-05 14:35:37763 {
[email protected]85646172012-01-09 22:45:54764 "enable-tab-browser-dragging",
765 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
766 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
767 kOsWin,
768 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
769 },
770 {
[email protected]068b7b52012-02-27 12:41:44771 "disable-restore-session-state",
772 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
773 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37774 kOsAll,
[email protected]068b7b52012-02-27 12:41:44775 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37776 },
[email protected]88864db2012-01-18 20:56:35777 {
778 "disable-software-rasterizer",
779 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
780 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
781#if defined(ENABLE_SWIFTSHADER)
782 kOsAll,
783#else
784 0,
785#endif
786 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
787 },
[email protected]15a5d722012-01-23 09:11:14788 {
[email protected]ff7b6dd2012-09-15 20:20:03789 "enable-experimental-webkit-features",
790 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
791 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16792 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03793 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49794 },
795 {
[email protected]0f95a252012-09-13 22:30:04796 "enable-css-shaders",
797 IDS_FLAGS_CSS_SHADERS_NAME,
798 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
799 kOsAll,
800 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
801 },
802 {
[email protected]9860c68b2012-02-02 01:58:09803 "enable-extension-activity-ui",
804 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
805 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56806 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09807 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00808 },
[email protected]54ae4e92012-02-16 15:19:05809 {
[email protected]3e8befc2012-03-13 01:17:03810 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16811 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
812 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56813 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03814 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16815 },
[email protected]dc04be7c2012-03-15 23:57:49816#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01817 {
[email protected]3cd198a22012-03-12 20:38:01818 "enable-ash-oak",
819 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
820 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
821 kOsAll,
822 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
823 },
[email protected]31cf1c52012-02-29 20:55:01824#endif
[email protected]184ec592012-03-01 11:54:28825 {
826 "enable-devtools-experiments",
827 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
828 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56829 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28830 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
831 },
[email protected]76d1854e2012-03-02 23:57:44832 {
833 "enable-suggestions-ntp",
834 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
835 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56836 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44837 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
838 },
[email protected]a3d54252012-04-05 20:04:13839 {
[email protected]1dbaf5e2012-11-30 05:51:32840 "spellcheck-autocorrect",
841 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
842 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
843 kOsWin | kOsLinux | kOsCrOS,
844 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
845 },
846 {
[email protected]d7932532012-11-21 21:10:31847 "touch-events",
848 IDS_TOUCH_EVENTS_NAME,
849 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56850 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31851 MULTI_VALUE_TYPE(kTouchEventsChoices)
852 },
853 {
[email protected]c9c73ad42012-04-18 03:35:59854 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06855 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
856 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55857 kOsWin,
[email protected]347a0c72012-05-14 20:28:06858 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59859 },
[email protected]8a6aaa72012-04-20 20:53:58860 {
[email protected]f6f82832012-09-04 17:12:04861 "enable-webkit-text-subpixel-positioning",
862 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
863 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
864 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48865 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04866 },
867 {
[email protected]b9c96ff2012-11-26 22:24:40868 "disable-touch-adjustment",
869 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
870 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
871 kOsWin | kOsLinux | kOsCrOS,
872 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
873 },
874 {
[email protected]0b9383a2012-10-26 00:58:16875 "enable-tab-capture",
876 IDS_ENABLE_TAB_CAPTURE_NAME,
877 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25878 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16879 MULTI_VALUE_TYPE(kTabCaptureChoices)
880 },
[email protected]0b60afa2012-04-19 17:36:39881#if defined(OS_CHROMEOS)
882 {
[email protected]7c4a9bc2012-09-11 22:10:05883 "enable-background-loader",
884 IDS_ENABLE_BACKLOADER_NAME,
885 IDS_ENABLE_BACKLOADER_DESCRIPTION,
886 kOsCrOS,
887 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
888 },
889 {
[email protected]c5667b282012-08-31 00:32:50890 "enable-bezel-touch",
891 IDS_ENABLE_BEZEL_TOUCH_NAME,
892 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47893 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50894 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47895 },
896 {
[email protected]3f4181a2013-02-01 21:31:07897 "enable-screensaver-extension",
898 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
899 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
900 kOsCrOS,
901 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
902 },
903 {
[email protected]0b60afa2012-04-19 17:36:39904 "no-discard-tabs",
905 IDS_FLAGS_NO_DISCARD_TABS_NAME,
906 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
907 kOsCrOS,
908 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
909 },
910#endif
[email protected]79be6d32012-04-24 20:47:44911 {
[email protected]8d68a3e02013-01-12 15:57:10912 "enable-download-resumption",
913 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
914 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56915 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10916 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
917 },
918 {
[email protected]9a5940d2012-04-27 19:16:23919 "allow-nacl-socket-api",
920 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
921 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56922 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23923 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
924 },
[email protected]85333732012-05-01 19:02:24925 {
[email protected]60673ad72012-05-02 06:16:33926 "stacked-tab-strip",
927 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
928 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
929 kOsWin,
930 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
931 },
932 {
[email protected]4bd20202012-06-14 17:35:01933 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24934 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
935 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
936 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01937 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24938 },
[email protected]190349fd2012-05-02 00:10:47939#if defined(OS_CHROMEOS)
940 {
941 "allow-touchpad-three-finger-click",
942 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
943 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
944 kOsCrOS,
945 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
946 },
[email protected]fbc176b62012-10-27 02:19:58947 {
948 "allow-touchpad-three-finger-swipe",
949 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
950 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
951 kOsCrOS,
952 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
953 },
[email protected]190349fd2012-05-02 00:10:47954#endif
[email protected]1992a2f42012-10-23 18:32:21955 {
[email protected]a585e462013-01-26 00:37:15956 "use-client-login-signin-flow",
957 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
958 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21959 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15960 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21961 },
[email protected]8ee02242012-12-04 15:23:32962 {
963 "enable-desktop-guest-mode",
964 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
965 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
966 kOsMac | kOsWin | kOsLinux,
967 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
968 },
[email protected]53520b1b2012-05-07 21:43:37969#if defined(USE_ASH)
970 {
[email protected]35a4ced2013-02-06 23:24:42971 "show-launcher-alignment-menu",
972 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
973 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
974 kOsAll,
975 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
976 },
977 {
[email protected]73074742012-05-17 01:44:41978 "show-touch-hud",
979 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
980 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
981 kOsAll,
982 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
983 },
984 {
[email protected]9f0940b62012-05-23 22:56:35985 "enable-pinch",
986 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
987 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06988 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35989 SINGLE_VALUE_TYPE(switches::kEnablePinch),
990 },
[email protected]a8379312012-06-15 00:20:43991 {
992 "app-list-show-apps-only",
993 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
994 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
995 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03996 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43997 },
[email protected]73074742012-05-17 01:44:41998#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28999#if defined(OS_CHROMEOS)
1000 {
[email protected]e03dc78d2012-07-24 08:21:431001 "disable-new-oobe",
1002 IDS_FLAGS_DISABLE_NEW_OOBE,
1003 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:281004 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:431005 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:281006 },
[email protected]8b04a1652012-08-04 02:59:491007 {
[email protected]528ced32012-12-14 00:40:441008 "disable-new-password-changed-dialog",
1009 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
1010 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
1011 kOsCrOS,
1012 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
1013 },
1014 {
[email protected]8b04a1652012-08-04 02:59:491015 "disable-boot-animation",
1016 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1017 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
1018 kOsCrOS,
1019 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
1020 },
[email protected]95058572012-08-20 14:57:291021 {
[email protected]b4557192012-09-19 11:29:581022 "disable-boot-animation2",
1023 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1024 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
1025 kOsCrOS,
1026 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1027 },
1028 {
[email protected]ea2f3342012-09-21 21:13:361029 "boot-animation-fucntion",
1030 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1031 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
1032 kOsCrOS,
1033 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1034 },
[email protected]839667d62012-10-23 19:38:571035 {
[email protected]d96aef22012-10-30 11:47:021036 "captive-portal-detector",
1037 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1038 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
1039 kOsCrOS,
1040 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1041 },
1042 {
[email protected]c11aa8f12012-12-18 18:43:141043 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571044 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1045 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1046 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141047 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571048 },
[email protected]f0280952012-11-06 20:30:501049 {
[email protected]0fb5c4852012-11-08 20:33:231050 "file-manager-packaged",
1051 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1052 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1053 kOsCrOS,
1054 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1055 },
[email protected]3e035e82012-11-27 20:54:321056 {
[email protected]8039e06c2013-01-17 23:34:501057 "disable-launcher-per-display",
1058 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1059 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351060 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501061 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351062 },
[email protected]06b146d2013-02-07 06:06:471063 {
1064 "enable-app-mode",
1065 IDS_FLAGS_ENABLE_KIOSK_APPS_NAME,
1066 IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION,
1067 kOsCrOS,
1068 SINGLE_VALUE_TYPE(switches::kEnableAppMode),
1069 },
[email protected]62018dc2012-12-13 00:37:351070#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391071 {
1072 "enable-views-textfield",
1073 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
1074 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
1075 kOsWin,
1076 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
1077 },
[email protected]bd0cd3bb2012-06-14 03:03:381078 {
[email protected]ef41b7ee2012-07-24 19:10:411079 "old-checkbox-style",
1080 IDS_FLAGS_OLD_CHECKBOX_STYLE,
1081 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
1082 kOsLinux | kOsCrOS,
1083 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
1084 },
1085 {
[email protected]2d4817742012-12-17 20:16:181086 "enable-new-dialog-style",
1087 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1088 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321089 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181090 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321091 },
[email protected]7db8893a2012-07-26 00:49:401092 { "disable-accelerated-video-decode",
1093 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1094 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561095 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401096 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151097 },
[email protected]66ae9fc2012-06-19 21:33:521098#if defined(USE_ASH)
1099 {
1100 "ash-debug-shortcuts",
1101 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1102 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1103 kOsAll,
1104 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1105 },
1106#endif
[email protected]37fee0942012-08-07 21:07:451107 {
[email protected]e2e8e322012-09-12 04:37:021108 "enable-webaudio-input",
1109 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1110 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561111 kOsDesktop,
[email protected]e2e8e322012-09-12 04:37:021112 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1113 },
1114 {
[email protected]ad3f6d22012-08-29 02:34:191115 "enable-contacts",
1116 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1117 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1118 kOsCrOS,
1119 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1120 },
[email protected]1d9bb9cd2012-08-28 22:02:501121#if defined(USE_ASH)
1122 { "ash-enable-advanced-gestures",
1123 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1124 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1125 kOsCrOS,
1126 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1127 },
[email protected]cfa24e62013-02-13 21:19:111128 { "ash-disable-tab-scrubbing",
1129 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1130 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161131 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111132 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161133 },
[email protected]83eef802012-12-02 07:43:521134 { "ash-enable-workspace-scrubbing",
1135 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1136 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1137 kOsCrOS,
1138 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1139 },
[email protected]d153e6f2012-12-21 07:38:091140 { "ash-immersive-mode",
1141 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1142 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241143 kOsCrOS,
[email protected]75ac23b2013-02-05 19:55:051144 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveMode),
[email protected]c043df272012-11-21 00:43:241145 },
[email protected]316708a2012-11-05 22:57:021146#if defined(OS_LINUX)
1147 { "ash-enable-memory-monitor",
1148 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1149 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1150 kOsCrOS,
1151 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1152 },
1153#endif
[email protected]1d9bb9cd2012-08-28 22:02:501154#endif
[email protected]9b7ab882012-09-10 23:46:361155#if defined(OS_CHROMEOS)
[email protected]88471ff2013-02-04 20:39:001156 { "ash-enable-new-network-status-area",
1157 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_NAME,
1158 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461159 kOsCrOS,
[email protected]88471ff2013-02-04 20:39:001160 SINGLE_VALUE_TYPE(ash::switches::kAshEnableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461161 },
[email protected]9b7ab882012-09-10 23:46:361162 {
[email protected]205f07892012-10-16 20:26:221163 "enable-carrier-switching",
1164 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1165 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1166 kOsCrOS,
1167 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1168 },
1169 {
[email protected]9b7ab882012-09-10 23:46:361170 "enable-request-tablet-site",
1171 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1172 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1173 kOsCrOS,
1174 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1175 },
1176#endif
[email protected]dab49c0b2012-10-04 05:55:351177 {
1178 "debug-packed-apps",
1179 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1180 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561181 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351182 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1183 },
[email protected]d1459ed2012-10-10 01:29:331184 {
1185 "enable-password-generation",
1186 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1187 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561188 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331189 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1190 },
[email protected]26d045f2012-10-18 21:18:431191 {
1192 "crash-on-gpu-hang",
1193 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1194 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1195 kOsAll,
1196 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1197 },
[email protected]075543d2012-10-24 01:29:141198 {
[email protected]76f7d4882012-10-26 21:09:221199 "enable-deferred-image-decoding",
1200 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1201 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1202#if defined(USE_SKIA)
1203 kOsMac | kOsLinux | kOsCrOS,
1204#else
1205 0,
1206#endif
1207 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1208 },
1209 {
[email protected]075543d2012-10-24 01:29:141210 "performance-monitor-gathering",
1211 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1212 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1213 kOsAll,
1214 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1215 },
[email protected]783d5bb2012-10-24 03:47:141216 {
[email protected]0572fb2e2012-11-03 00:38:591217 "enable-new-autofill-ui",
1218 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1219 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561220 kOsDesktop,
[email protected]0572fb2e2012-11-03 00:38:591221 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1222 },
1223 {
[email protected]783d5bb2012-10-24 03:47:141224 "enable-new-autofill-heuristics",
1225 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1226 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1227 kOsAll,
1228 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1229 },
[email protected]2c273bd2012-10-25 18:55:031230 {
[email protected]99002fd2012-11-06 04:35:521231 "show-app-list-shortcut",
1232 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1233 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1234 kOsWin,
1235 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1236 },
[email protected]a7259fb2012-11-08 06:22:231237 {
1238 "enable-experimental-form-filling",
1239 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1240 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1241 kOsWin | kOsCrOS,
1242 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1243 },
[email protected]6e6efe42013-01-30 00:04:501244 {
1245 "enable-interactive-autocomplete",
1246 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1247 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1248 kOsWin | kOsCrOS,
1249 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1250 },
[email protected]e42b1f82012-11-16 21:18:461251#if defined(USE_AURA)
1252 {
[email protected]9fb64a12013-02-11 21:16:011253 "enable-overscroll-history-navigation",
1254 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1255 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461256 kOsAll,
[email protected]9fb64a12013-02-11 21:16:011257 SINGLE_VALUE_TYPE(switches::kEnableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461258 },
1259#endif
[email protected]edbea622012-11-28 20:39:381260 {
1261 "enable-touch-drag-drop",
1262 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1263 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1264 kOsWin | kOsCrOS,
1265 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1266 },
[email protected]f1c39242013-01-29 16:13:011267#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201268 {
1269 "enable-rich-notifications",
1270 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1271 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1272 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011273 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201274 },
[email protected]f1c39242013-01-29 16:13:011275#endif
[email protected]4d51c682012-12-11 11:34:551276 {
1277 "full-history-sync",
1278 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1279 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1280 kOsAll,
1281 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1282 },
[email protected]628a69a92012-12-23 04:09:341283 {
[email protected]fd030142013-02-08 02:04:381284 "enable-usermedia-screen-capture",
1285 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1286 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1287 kOsDesktop,
1288 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1289 },
[email protected]5b93e162013-02-19 06:33:091290 {
1291 "enable-apps-devtool-app",
1292 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1293 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1294 kOsDesktop,
1295 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1296 },
[email protected]a0e4b072011-08-17 01:47:071297};
[email protected]ad2a3ded2010-08-27 13:19:051298
[email protected]a314ee5a2010-10-26 21:23:281299const Experiment* experiments = kExperiments;
1300size_t num_experiments = arraysize(kExperiments);
1301
[email protected]e2ddbc92010-10-15 20:02:071302// Stores and encapsulates the little state that about:flags has.
1303class FlagsState {
1304 public:
1305 FlagsState() : needs_restart_(false) {}
1306 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1307 bool IsRestartNeededToCommitChanges();
1308 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281309 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071310 void RemoveFlagsSwitches(
1311 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001312 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071313 void reset();
1314
1315 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551316 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071317 return Singleton<FlagsState>::get();
1318 }
1319
1320 private:
1321 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531322 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071323
1324 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1325};
1326
[email protected]c7b7800a2010-10-07 18:51:351327// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051328// in a set.
[email protected]1a47d7e2010-10-15 00:37:241329void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051330 const ListValue* enabled_experiments = prefs->GetList(
1331 prefs::kEnabledLabsExperiments);
1332 if (!enabled_experiments)
1333 return;
1334
1335 for (ListValue::const_iterator it = enabled_experiments->begin();
1336 it != enabled_experiments->end();
1337 ++it) {
1338 std::string experiment_name;
1339 if (!(*it)->GetAsString(&experiment_name)) {
1340 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1341 continue;
1342 }
1343 result->insert(experiment_name);
1344 }
1345}
1346
1347// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241348void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051349 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381350 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1351 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051352
1353 experiments_list->Clear();
1354 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1355 it != enabled_experiments.end();
1356 ++it) {
1357 experiments_list->Append(new StringValue(*it));
1358 }
1359}
1360
[email protected]8a6ff28d2010-12-02 16:35:191361// Returns the name used in prefs for the choice at the specified index.
1362std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341363 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1364 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191365 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1366 base::IntToString(index);
1367}
1368
1369// Adds the internal names for the specified experiment to |names|.
1370void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1371 if (e.type == Experiment::SINGLE_VALUE) {
1372 names->insert(e.internal_name);
1373 } else {
[email protected]2ce9c89752011-02-25 18:24:341374 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191375 for (int i = 0; i < e.num_choices; ++i)
1376 names->insert(NameForChoice(e, i));
1377 }
1378}
1379
[email protected]28e35af2011-02-09 12:56:221380// Confirms that an experiment is valid, used in a DCHECK in
1381// SanitizeList below.
1382bool ValidateExperiment(const Experiment& e) {
1383 switch (e.type) {
1384 case Experiment::SINGLE_VALUE:
1385 DCHECK_EQ(0, e.num_choices);
1386 DCHECK(!e.choices);
1387 break;
1388 case Experiment::MULTI_VALUE:
1389 DCHECK_GT(e.num_choices, 0);
1390 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531391 DCHECK(e.choices[0].command_line_switch);
1392 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221393 break;
1394 default:
1395 NOTREACHED();
1396 }
1397 return true;
1398}
1399
[email protected]ad2a3ded2010-08-27 13:19:051400// Removes all experiments from prefs::kEnabledLabsExperiments that are
1401// unknown, to prevent this list to become very long as experiments are added
1402// and removed.
1403void SanitizeList(PrefService* prefs) {
1404 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221405 for (size_t i = 0; i < num_experiments; ++i) {
1406 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191407 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221408 }
[email protected]ad2a3ded2010-08-27 13:19:051409
1410 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241411 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051412
1413 std::set<std::string> new_enabled_experiments;
1414 std::set_intersection(
1415 known_experiments.begin(), known_experiments.end(),
1416 enabled_experiments.begin(), enabled_experiments.end(),
1417 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1418
[email protected]4c8853f2012-07-23 01:29:161419 if (new_enabled_experiments != enabled_experiments)
1420 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051421}
1422
[email protected]1a47d7e2010-10-15 00:37:241423void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051424 PrefService* prefs, std::set<std::string>* result) {
1425 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241426 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051427}
1428
[email protected]a314ee5a2010-10-26 21:23:281429// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1430// enabled on the current platform.
1431void GetSanitizedEnabledFlagsForCurrentPlatform(
1432 PrefService* prefs, std::set<std::string>* result) {
1433 GetSanitizedEnabledFlags(prefs, result);
1434
1435 // Filter out any experiments that aren't enabled on the current platform. We
1436 // don't remove these from prefs else syncing to a platform with a different
1437 // set of experiments would be lossy.
1438 std::set<std::string> platform_experiments;
1439 int current_platform = GetCurrentPlatform();
1440 for (size_t i = 0; i < num_experiments; ++i) {
1441 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191442 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281443 }
1444
1445 std::set<std::string> new_enabled_experiments;
1446 std::set_intersection(
1447 platform_experiments.begin(), platform_experiments.end(),
1448 result->begin(), result->end(),
1449 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1450
1451 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051452}
1453
[email protected]8a6ff28d2010-12-02 16:35:191454// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191455Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221456 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341457 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191458 ListValue* result = new ListValue;
1459 for (int i = 0; i < experiment.num_choices; ++i) {
1460 const Experiment::Choice& choice = experiment.choices[i];
1461 DictionaryValue* value = new DictionaryValue;
1462 std::string name = NameForChoice(experiment, i);
1463 value->SetString("description",
1464 l10n_util::GetStringUTF16(choice.description_id));
1465 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221466 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191467 result->Append(value);
1468 }
1469 return result;
1470}
1471
[email protected]e2ddbc92010-10-15 20:02:071472} // namespace
1473
[email protected]1a47d7e2010-10-15 00:37:241474void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551475 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051476}
1477
[email protected]1a47d7e2010-10-15 00:37:241478ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051479 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241480 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051481
1482 int current_platform = GetCurrentPlatform();
1483
1484 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281485 for (size_t i = 0; i < num_experiments; ++i) {
1486 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051487
1488 DictionaryValue* data = new DictionaryValue();
1489 data->SetString("internal_name", experiment.internal_name);
1490 data->SetString("name",
1491 l10n_util::GetStringUTF16(experiment.visible_name_id));
1492 data->SetString("description",
1493 l10n_util::GetStringUTF16(
1494 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401495 bool supported = !!(experiment.supported_platforms & current_platform);
1496 data->SetBoolean("supported", supported);
1497
1498 ListValue* supported_platforms = new ListValue();
1499 AddOsStrings(experiment.supported_platforms, supported_platforms);
1500 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051501
[email protected]28e35af2011-02-09 12:56:221502 switch (experiment.type) {
1503 case Experiment::SINGLE_VALUE:
1504 data->SetBoolean(
1505 "enabled",
1506 enabled_experiments.count(experiment.internal_name) > 0);
1507 break;
1508 case Experiment::MULTI_VALUE:
1509 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1510 break;
1511 default:
1512 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191513 }
1514
[email protected]ad2a3ded2010-08-27 13:19:051515 experiments_data->Append(data);
1516 }
1517 return experiments_data;
1518}
1519
[email protected]ad2a3ded2010-08-27 13:19:051520bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551521 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051522}
1523
1524void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351525 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551526 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071527}
1528
1529void RemoveFlagsSwitches(
1530 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551531 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071532}
1533
[email protected]cb93bf52013-02-20 01:20:001534void ResetAllFlags(PrefService* prefs) {
1535 FlagsState::GetInstance()->ResetAllFlags(prefs);
1536}
1537
[email protected]a314ee5a2010-10-26 21:23:281538int GetCurrentPlatform() {
1539#if defined(OS_MACOSX)
1540 return kOsMac;
1541#elif defined(OS_WIN)
1542 return kOsWin;
1543#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1544 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211545#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281546 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401547#elif defined(OS_ANDROID)
1548 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281549#else
1550#error Unknown platform
1551#endif
1552}
1553
[email protected]4bc5050c2010-11-18 17:55:541554void RecordUMAStatistics(const PrefService* prefs) {
1555 std::set<std::string> flags;
1556 GetEnabledFlags(prefs, &flags);
1557 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1558 ++it) {
1559 std::string action("AboutFlags_");
1560 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381561 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541562 }
1563 // Since flag metrics are recorded every startup, add a tick so that the
1564 // stats can be made meaningful.
1565 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381566 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1567 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541568}
1569
[email protected]e2ddbc92010-10-15 20:02:071570//////////////////////////////////////////////////////////////////////////////
1571// FlagsState implementation.
1572
1573namespace {
1574
1575void FlagsState::ConvertFlagsToSwitches(
1576 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071577 if (command_line->HasSwitch(switches::kNoExperiments))
1578 return;
1579
1580 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001581
[email protected]a314ee5a2010-10-26 21:23:281582 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071583
[email protected]a82744532011-02-11 16:15:531584 typedef std::map<std::string, std::pair<std::string, std::string> >
1585 NameToSwitchAndValueMap;
1586 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191587 for (size_t i = 0; i < num_experiments; ++i) {
1588 const Experiment& e = experiments[i];
1589 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531590 name_to_switch_map[e.internal_name] =
1591 std::pair<std::string, std::string>(e.command_line_switch,
1592 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191593 } else {
1594 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531595 name_to_switch_map[NameForChoice(e, j)] =
1596 std::pair<std::string, std::string>(
1597 e.choices[j].command_line_switch,
1598 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191599 }
1600 }
[email protected]e2ddbc92010-10-15 20:02:071601
1602 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531603 flags_switches_.insert(
1604 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1605 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071606 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1607 it != enabled_experiments.end();
1608 ++it) {
1609 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531610 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191611 name_to_switch_map.find(experiment_name);
1612 if (name_to_switch_it == name_to_switch_map.end()) {
1613 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071614 continue;
[email protected]8a6ff28d2010-12-02 16:35:191615 }
[email protected]e2ddbc92010-10-15 20:02:071616
[email protected]a82744532011-02-11 16:15:531617 const std::pair<std::string, std::string>&
1618 switch_and_value_pair = name_to_switch_it->second;
1619
1620 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1621 switch_and_value_pair.second);
1622 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071623 }
1624 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531625 flags_switches_.insert(
1626 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1627 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071628}
1629
1630bool FlagsState::IsRestartNeededToCommitChanges() {
1631 return needs_restart_;
1632}
1633
1634void FlagsState::SetExperimentEnabled(
1635 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051636 needs_restart_ = true;
1637
[email protected]8a6ff28d2010-12-02 16:35:191638 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1639 if (at_index != std::string::npos) {
1640 DCHECK(enable);
1641 // We're being asked to enable a multi-choice experiment. Disable the
1642 // currently selected choice.
1643 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221644 const std::string experiment_name = internal_name.substr(0, at_index);
1645 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191646
[email protected]28e35af2011-02-09 12:56:221647 // And enable the new choice, if it is not the default first choice.
1648 if (internal_name != experiment_name + "@0") {
1649 std::set<std::string> enabled_experiments;
1650 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1651 enabled_experiments.insert(internal_name);
1652 SetEnabledFlags(prefs, enabled_experiments);
1653 }
[email protected]8a6ff28d2010-12-02 16:35:191654 return;
1655 }
1656
[email protected]ad2a3ded2010-08-27 13:19:051657 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241658 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051659
[email protected]8a6ff28d2010-12-02 16:35:191660 const Experiment* e = NULL;
1661 for (size_t i = 0; i < num_experiments; ++i) {
1662 if (experiments[i].internal_name == internal_name) {
1663 e = experiments + i;
1664 break;
1665 }
1666 }
1667 DCHECK(e);
1668
1669 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591670 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191671 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591672 else
[email protected]8a6ff28d2010-12-02 16:35:191673 enabled_experiments.erase(internal_name);
1674 } else {
1675 if (enable) {
1676 // Enable the first choice.
1677 enabled_experiments.insert(NameForChoice(*e, 0));
1678 } else {
1679 // Find the currently enabled choice and disable it.
1680 for (int i = 0; i < e->num_choices; ++i) {
1681 std::string choice_name = NameForChoice(*e, i);
1682 if (enabled_experiments.find(choice_name) !=
1683 enabled_experiments.end()) {
1684 enabled_experiments.erase(choice_name);
1685 // Continue on just in case there's a bug and more than one
1686 // experiment for this choice was enabled.
1687 }
1688 }
1689 }
1690 }
[email protected]ad2a3ded2010-08-27 13:19:051691
[email protected]1a47d7e2010-10-15 00:37:241692 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051693}
1694
[email protected]e2ddbc92010-10-15 20:02:071695void FlagsState::RemoveFlagsSwitches(
1696 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531697 for (std::map<std::string, std::string>::const_iterator
1698 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1699 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071700 }
1701}
1702
[email protected]cb93bf52013-02-20 01:20:001703void FlagsState::ResetAllFlags(PrefService* prefs) {
1704 needs_restart_ = true;
1705
1706 std::set<std::string> no_experiments;
1707 SetEnabledFlags(prefs, no_experiments);
1708}
1709
[email protected]e2ddbc92010-10-15 20:02:071710void FlagsState::reset() {
1711 needs_restart_ = false;
1712 flags_switches_.clear();
1713}
1714
[email protected]38e46812011-05-09 20:49:221715} // namespace
[email protected]e2ddbc92010-10-15 20:02:071716
1717namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191718
1719// WARNING: '@' is also used in the html file. If you update this constant you
1720// also need to update the html file.
1721const char kMultiSeparator[] = "@";
1722
[email protected]e2ddbc92010-10-15 20:02:071723void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551724 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071725}
[email protected]a314ee5a2010-10-26 21:23:281726
1727void SetExperiments(const Experiment* e, size_t count) {
1728 if (!e) {
1729 experiments = kExperiments;
1730 num_experiments = arraysize(kExperiments);
1731 } else {
1732 experiments = e;
1733 num_experiments = count;
1734 }
1735}
1736
[email protected]8a6ff28d2010-12-02 16:35:191737const Experiment* GetExperiments(size_t* count) {
1738 *count = num_experiments;
1739 return experiments;
1740}
1741
[email protected]e2ddbc92010-10-15 20:02:071742} // namespace testing
1743
[email protected]1a47d7e2010-10-15 00:37:241744} // namespace about_flags