blob: 154dc0e1e156997764ff754ab16a5b88b53ca246 [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
43#if defined(USE_AURA)
[email protected]308aaa32012-03-12 13:14:5044#include "ui/aura/aura_switches.h"
[email protected]8cc10df2011-11-03 23:57:5045#endif
46
[email protected]badba1ad2012-11-16 17:21:4647#if defined(OS_CHROMEOS)
48#include "chromeos/chromeos_switches.h"
49#endif
50
[email protected]7f6f44c2011-12-14 13:23:3851using content::UserMetricsAction;
52
[email protected]1a47d7e2010-10-15 00:37:2453namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0554
[email protected]8a6ff28d2010-12-02 16:35:1955// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5356#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
57 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
58#define SINGLE_VALUE_TYPE(command_line_switch) \
59 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
60#define MULTI_VALUE_TYPE(choices) \
[email protected]0e6f56d2011-02-12 23:45:1561 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1962
[email protected]e2ddbc92010-10-15 20:02:0763namespace {
64
[email protected]9c7453d2012-01-21 00:45:4065const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5666const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0567
[email protected]cc3e2052011-12-20 01:01:4068// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
69// whether the experiment is available on that platform.
70void AddOsStrings(unsigned bitmask, ListValue* list) {
71 struct {
72 unsigned bit;
73 const char* const name;
74 } kBitsToOs[] = {
75 {kOsMac, "Mac"},
76 {kOsWin, "Windows"},
77 {kOsLinux, "Linux"},
78 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0179 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4080 };
81 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
82 if (bitmask & kBitsToOs[i].bit)
83 list->Append(new StringValue(kBitsToOs[i].name));
84}
85
[email protected]68317802012-06-07 19:13:2386const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
87 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
88 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
89 switches::kOmniboxHistoryQuickProviderNewScoring,
90 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
91 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
92 switches::kOmniboxHistoryQuickProviderNewScoring,
93 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
94};
95
[email protected]128dc6c2012-06-22 20:30:3596const Experiment::Choice
97 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
98 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
99 "",
100 "" },
101 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
102 switches::kOmniboxHistoryQuickProviderReorderForInlining,
103 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
104 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
105 switches::kOmniboxHistoryQuickProviderReorderForInlining,
106 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
107};
108
[email protected]032d5e6c2012-02-17 17:53:55109const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
110 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
111 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
112 switches::kOmniboxInlineHistoryQuickProvider,
113 switches::kOmniboxInlineHistoryQuickProviderAllowed },
114 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
115 switches::kOmniboxInlineHistoryQuickProvider,
116 switches::kOmniboxInlineHistoryQuickProviderProhibited }
117};
118
[email protected]de023762012-07-26 17:10:17119const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = {
120 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
121 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
122 switches::kEnableFixedPositionCreatesStackingContext, ""},
123 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
124 switches::kDisableFixedPositionCreatesStackingContext, ""}
125};
126
[email protected]fb854192013-02-06 01:30:04127const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
128 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
129 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
130 switches::kEnableCompositingForFixedPosition, ""},
131 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
132 switches::kDisableCompositingForFixedPosition, ""},
133 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
134 switches::kEnableHighDpiCompositingForFixedPosition, ""}
135};
136
[email protected]9b19cf82012-06-13 06:23:23137const Experiment::Choice kForceCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20138 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
139 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]9b19cf82012-06-13 06:23:23140 switches::kForceCompositingMode, ""},
[email protected]a45c69402012-06-24 16:32:20141 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]9b19cf82012-06-13 06:23:23142 switches::kDisableForceCompositingMode, ""}
143};
144
[email protected]72787e392012-03-23 05:55:43145const Experiment::Choice kThreadedCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20146 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
147 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]72787e392012-03-23 05:55:43148 switches::kDisableThreadedCompositing, ""},
[email protected]a45c69402012-06-24 16:32:20149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]72787e392012-03-23 05:55:43150 switches::kEnableThreadedCompositing, ""}
151};
152
[email protected]17e27692013-02-06 17:02:09153const Experiment::Choice kForceAcceleratedOverflowScrollModeChoices[] = {
154 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
155 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
156 switches::kDisableAcceleratedOverflowScroll, ""},
157 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
158 switches::kEnableAcceleratedOverflowScroll, ""}
159};
160
[email protected]8b1c3c72013-01-25 01:48:43161const Experiment::Choice kGDIPresentChoices[] = {
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
163 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
164 switches::kDoFirstShowPresentWithGDI, ""},
165 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
166 switches::kDoAllShowPresentWithGDI, ""}
167};
168
169
[email protected]d7932532012-11-21 21:10:31170const Experiment::Choice kTouchEventsChoices[] = {
171 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
172 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
173 switches::kTouchEvents,
174 switches::kTouchEventsEnabled },
175 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
176 switches::kTouchEvents,
177 switches::kTouchEventsDisabled }
178};
179
[email protected]347a0c72012-05-14 20:28:06180const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31181 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20182 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06183 switches::kTouchOptimizedUI,
184 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20185 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06186 switches::kTouchOptimizedUI,
187 switches::kTouchOptimizedUIDisabled }
188};
189
[email protected]026876f32012-08-22 23:53:40190const Experiment::Choice kAsyncDnsChoices[] = {
191 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
192 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
193 switches::kDisableAsyncDns, ""},
194 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
195 switches::kEnableAsyncDns, ""}
196};
197
[email protected]66f409c2012-10-04 20:59:04198const Experiment::Choice kNaClDebugMaskChoices[] = {
199 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
200 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
201 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
202 // an option to switch off its debugging.
203 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
204 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
205 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
206 switches::kNaClDebugMask, "*://*/*debug.nmf" }
207};
208
[email protected]544471a2012-10-13 05:27:09209const Experiment::Choice kActionBoxChoices[] = {
210 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
211 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
212 switches::kActionBox, "0"},
213 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
214 switches::kActionBox, "1"}
215};
216
217const Experiment::Choice kScriptBubbleChoices[] = {
218 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
219 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
220 switches::kScriptBubble, "0"},
221 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
222 switches::kScriptBubble, "1"}
223};
224
[email protected]0b9383a2012-10-26 00:58:16225const Experiment::Choice kTabCaptureChoices[] = {
226 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
227 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
228 switches::kTabCapture, "0"},
229 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
230 switches::kTabCapture, "1"}
231};
232
[email protected]ea2f3342012-09-21 21:13:36233#if defined(OS_CHROMEOS)
234const Experiment::Choice kAshBootAnimationFunction[] = {
235 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
236 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
237 ash::switches::kAshBootAnimationFunction2, ""},
238 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
239 ash::switches::kAshBootAnimationFunction3, ""}
240};
[email protected]d96aef22012-10-30 11:47:02241
242const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19243 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02244 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19245 switches::kEnableChromeCaptivePortalDetector, ""},
246 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
247 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02248};
[email protected]ea2f3342012-09-21 21:13:36249#endif
250
[email protected]4bc5050c2010-11-18 17:55:54251// RECORDING USER METRICS FOR FLAGS:
252// -----------------------------------------------------------------------------
253// The first line of the experiment is the internal name. If you'd like to
254// gather statistics about the usage of your flag, you should append a marker
255// comment to the end of the feature name, like so:
256// "my-special-feature", // FLAGS:RECORD_UMA
257//
258// After doing that, run //chrome/tools/extract_actions.py (see instructions at
259// the top of that file for details) to update the chromeactions.txt file, which
260// will enable UMA to record your feature flag.
261//
[email protected]783d5bb2012-10-24 03:47:14262// After your feature has shipped under a flag, you can locate the metrics under
263// the action name AboutFlags_internal-action-name. Actions are recorded once
264// per startup, so you should divide this number by AboutFlags_StartupTick to
265// get a sense of usage. Note that this will not be the same as number of users
266// with a given feature enabled because users can quit and relaunch the
267// application multiple times over a given time interval. The dashboard also
268// shows you how many (metrics reporting) users have enabled the flag over the
269// last seven days. However, note that this is not the same as the number of
270// users who have the flag enabled, since enabling the flag happens once,
271// whereas running with the flag enabled happens until the user flips the flag
272// again.
[email protected]4bc5050c2010-11-18 17:55:54273
[email protected]8a6ff28d2010-12-02 16:35:19274// To add a new experiment add to the end of kExperiments. There are two
275// distinct types of experiments:
276// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
277// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22278// . MULTI_VALUE: a list of choices, the first of which should correspond to a
279// deactivated state for this lab (i.e. no command line option). To specify
280// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
281// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19282// See the documentation of Experiment for details on the fields.
283//
284// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05285const Experiment kExperiments[] = {
286 {
[email protected]aac169d2011-03-18 19:53:03287 "expose-for-tabs", // FLAGS:RECORD_UMA
288 IDS_FLAGS_TABPOSE_NAME,
289 IDS_FLAGS_TABPOSE_DESCRIPTION,
290 kOsMac,
291#if defined(OS_MACOSX)
292 // The switch exists only on OS X.
293 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
294#else
295 SINGLE_VALUE_TYPE("")
296#endif
297 },
298 {
[email protected]4bc5050c2010-11-18 17:55:54299 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05300 IDS_FLAGS_CONFLICTS_CHECK_NAME,
301 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
302 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19303 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05304 },
305 {
[email protected]4bc5050c2010-11-18 17:55:54306 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54307 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
308 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45309 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22310 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31311 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22312 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
313 // always have PDF rasterization available, so no flag needed there.
314#if !defined(GOOGLE_CHROME_BUILD)
315 kOsWin,
316#else
317 0,
[email protected]fa6d2a2f2010-11-30 21:47:19318#endif
[email protected]8a6ff28d2010-12-02 16:35:19319 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42320 },
[email protected]60d77bd2012-08-22 00:10:07321#if defined(OS_WIN)
322 {
323 "print-raster",
324 IDS_FLAGS_PRINT_RASTER_NAME,
325 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
326 kOsWin,
327 SINGLE_VALUE_TYPE(switches::kPrintRaster)
328 },
329#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05330 {
[email protected]bb461532010-11-26 21:50:23331 "crxless-web-apps",
332 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
333 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56334 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19335 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23336 },
337 {
[email protected]96c6f4c2011-05-18 19:36:22338 "ignore-gpu-blacklist",
339 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
340 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
341 kOsAll,
342 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
343 },
344 {
[email protected]0110cf112011-07-02 00:39:43345 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22346 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
347 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23348 kOsMac | kOsWin | kOsLinux,
349 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22350 },
351 {
[email protected]72787e392012-03-23 05:55:43352 "threaded-compositing-mode",
353 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
354 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56355 kOsDesktop & ~kOsCrOS,
[email protected]72787e392012-03-23 05:55:43356 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59357 },
358 {
[email protected]17e27692013-02-06 17:02:09359 "force-accelerated-composited-scrolling",
360 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
361 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
362 kOsAll,
363 MULTI_VALUE_TYPE(kForceAcceleratedOverflowScrollModeChoices)
364 },
365 {
[email protected]8b1c3c72013-01-25 01:48:43366 "present-with-GDI",
367 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
368 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
369 kOsWin,
370 MULTI_VALUE_TYPE(kGDIPresentChoices)
371 },
372 {
[email protected]81c64af62012-06-06 20:15:52373 "disable-accelerated-2d-canvas",
374 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
375 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
376 kOsAll,
377 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
378 },
379 {
[email protected]69cffc82012-08-10 13:27:27380 "disable-deferred-2d-canvas",
381 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
382 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
383 kOsAll,
384 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
385 },
386 {
[email protected]efcde132012-05-30 01:05:18387 "disable-threaded-animation",
388 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
389 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59390 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37391 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59392 },
393 {
[email protected]5963b772011-02-09 22:55:38394 "composited-layer-borders",
395 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
396 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
397 kOsAll,
398 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
399 },
400 {
[email protected]a8f1eaa2011-03-07 19:00:58401 "show-fps-counter",
402 IDS_FLAGS_SHOW_FPS_COUNTER,
403 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
404 kOsAll,
405 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
406 },
[email protected]8ff7f342011-05-25 01:49:47407 {
[email protected]70c98a332011-12-21 20:51:52408 "accelerated-filters",
409 IDS_FLAGS_ACCELERATED_FILTERS,
410 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
411 kOsAll,
412 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
413 },
414 {
[email protected]8ff7f342011-05-25 01:49:47415 "disable-gpu-vsync",
416 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
417 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56418 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47419 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
420 },
[email protected]deaba6d52011-09-23 14:47:12421 {
[email protected]4052d832013-01-16 05:31:01422 "enable-webgl",
423 IDS_FLAGS_ENABLE_WEBGL_NAME,
424 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
425 kOsAndroid,
426#if defined(OS_ANDROID)
427 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
428#else
429 SINGLE_VALUE_TYPE("")
430#endif
431 },
432 {
[email protected]deaba6d52011-09-23 14:47:12433 "disable-webgl",
434 IDS_FLAGS_DISABLE_WEBGL_NAME,
435 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56436 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01437#if defined(OS_ANDROID)
438 SINGLE_VALUE_TYPE("")
439#else
[email protected]deaba6d52011-09-23 14:47:12440 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01441#endif
[email protected]deaba6d52011-09-23 14:47:12442 },
[email protected]09096e02012-05-24 11:12:04443 {
[email protected]d9da9582013-01-31 04:59:05444 "enable-webrtc",
445 IDS_FLAGS_ENABLE_WEBRTC_NAME,
446 IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION,
447 kOsAndroid,
448#if defined(OS_ANDROID)
449 SINGLE_VALUE_TYPE(switches::kEnableWebRTC)
450#else
451 SINGLE_VALUE_TYPE("")
452#endif
453 },
454 {
[email protected]96bcdc102012-05-24 23:42:10455 "fixed-position-creates-stacking-context",
456 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
457 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
458 kOsAll,
[email protected]de023762012-07-26 17:10:17459 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10460 },
[email protected]fb854192013-02-06 01:30:04461 {
462 "enable-compositing-for-fixed-position",
463 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
464 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
465 kOsAll,
466 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
467 },
[email protected]a7640ef22012-10-06 00:52:08468 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53469 {
[email protected]e3791ce92011-08-09 01:03:32470 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40471 IDS_FLAGS_ENABLE_NACL_NAME,
472 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56473 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19474 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40475 },
[email protected]b39c6d92012-01-31 16:38:41476 // TODO(halyavin): When exception handling is on by default, replace this
477 // flag with disable-nacl-exception-handling.
478 {
479 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
480 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
481 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56482 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41483 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
484 },
[email protected]4ff87d202010-11-06 01:28:40485 {
[email protected]9addd1c2012-09-15 14:28:24486 "enable-nacl-debug", // FLAGS:RECORD_UMA
487 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
488 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56489 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24490 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13491 },
492 {
[email protected]66f409c2012-10-04 20:59:04493 "nacl-debug-mask", // FLAGS:RECORD_UMA
494 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
495 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56496 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04497 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
498 },
499 {
[email protected]7babd1c2012-08-08 20:35:29500 "enable-pnacl", // FLAGS:RECORD_UMA
501 IDS_FLAGS_ENABLE_PNACL_NAME,
502 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56503 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29504 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
505 },
506 {
[email protected]4bc5050c2010-11-18 17:55:54507 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32508 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
509 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56510 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19511 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32512 },
[email protected]3627b06d2010-11-12 16:36:16513 {
[email protected]544471a2012-10-13 05:27:09514 "action-box",
[email protected]cab18ef2012-04-27 07:22:03515 IDS_FLAGS_ACTION_BOX_NAME,
516 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56517 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09518 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03519 },
520 {
[email protected]3a362432012-06-18 20:39:51521 "script-badges",
522 IDS_FLAGS_SCRIPT_BADGES_NAME,
523 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56524 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09525 SINGLE_VALUE_TYPE(switches::kScriptBadges)
526 },
527 {
528 "script-bubble",
529 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
530 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56531 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09532 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51533 },
534 {
[email protected]cbe224d2011-08-04 22:12:49535 "apps-new-install-bubble",
536 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
537 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56538 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49539 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
540 },
541 {
[email protected]80bd24e2010-11-30 09:34:38542 "disable-hyperlink-auditing",
543 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
544 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
545 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19546 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51547 },
548 {
549 "experimental-location-features", // FLAGS:RECORD_UMA
550 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
551 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
552 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19553 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
554 },
555 {
[email protected]5aea1862011-03-23 23:55:39556 "tab-groups-context-menu",
557 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
558 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
559 kOsWin,
560 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
561 },
[email protected]c94cebd2012-06-21 00:55:28562 {
563 "enable-instant-extended-api",
564 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
565 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56566 kOsDesktop,
[email protected]c94cebd2012-06-21 00:55:28567 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
568 },
[email protected]e9bf9d92011-03-31 20:57:15569 {
[email protected]354e33b2011-06-15 00:29:10570 "static-ip-config",
571 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
572 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
573 kOsCrOS,
574#if defined(OS_CHROMEOS)
575 // This switch exists only on Chrome OS.
576 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
577#else
578 SINGLE_VALUE_TYPE("")
579#endif
580 },
[email protected]3eb5728c2011-06-20 22:32:24581 {
582 "show-autofill-type-predictions",
583 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
584 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
585 kOsAll,
586 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
587 },
[email protected]bff4d3e2011-06-21 23:58:52588 {
[email protected]fdf4e252012-04-27 00:26:55589 "sync-tab-favicons",
590 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
591 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
592 kOsAll,
593 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
594 },
595 {
[email protected]aae9eeb12011-10-21 21:59:26596 "sync-app-notifications",
597 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
598 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56599 kOsDesktop,
[email protected]0b6fba82011-11-18 01:31:11600 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26601 },
602 {
[email protected]5d90a0a2012-11-15 02:43:40603 "sync-keystore-encryption",
604 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
605 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
606 kOsAll,
607 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
608 },
609 {
[email protected]e755a382012-09-13 17:16:35610 "enable-gesture-tap-highlight",
611 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
612 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
613 kOsLinux | kOsCrOS,
614 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
615 },
616 {
[email protected]a22ebd812011-06-23 00:05:39617 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
618 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
619 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
620 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40621 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25622 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39623 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
624 },
[email protected]81a6b0b2011-06-24 17:55:40625 {
[email protected]68317802012-06-07 19:13:23626 "omnibox-history-quick-provider-new-scoring",
627 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
628 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
629 kOsAll,
630 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
631 },
632 {
[email protected]128dc6c2012-06-22 20:30:35633 "omnibox-history-quick-provider-reorder-for-inlining",
634 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
635 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
636 kOsAll,
637 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
638 },
639 {
[email protected]032d5e6c2012-02-17 17:53:55640 "omnibox-inline-history-quick-provider",
641 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
642 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
643 kOsAll,
644 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
645 },
646 {
[email protected]7e7a28092011-12-09 22:24:55647 "enable-panels",
648 IDS_FLAGS_ENABLE_PANELS_NAME,
649 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56650 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55651 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54652 },
[email protected]e3749d12011-07-25 22:22:12653 {
[email protected]fd38cc82012-12-19 18:19:29654 "enable-panel-stacking",
655 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
656 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56657 kOsDesktop,
[email protected]fd38cc82012-12-19 18:19:29658 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
659 },
660 {
[email protected]27c14f02012-06-22 17:29:58661 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27662 "save-page-as-mhtml", // FLAGS:RECORD_UMA
663 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
664 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
665 kOsMac | kOsWin | kOsLinux,
666 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
667 },
668 {
[email protected]b7bb44f2011-09-01 05:17:03669 "enable-autologin",
670 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
671 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
672 kOsMac | kOsWin | kOsLinux,
673 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
674 },
[email protected]b9841172011-09-26 23:36:09675 {
[email protected]3231b612012-03-23 05:57:54676 "enable-spdy3",
677 IDS_FLAGS_ENABLE_SPDY3_NAME,
678 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
679 kOsAll,
680 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
681 },
682 {
[email protected]27b3fe92012-03-21 05:35:06683 "enable-async-dns",
684 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
685 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46686 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40687 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06688 },
689 {
[email protected]1eb93802012-09-11 18:57:56690 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11691 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
692 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32693 kOsAll,
[email protected]da43c082012-09-07 18:56:11694 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44695 },
[email protected]e4e68dbb2011-11-18 01:50:22696 {
[email protected]36d98412013-01-31 20:28:53697 "disable-encrypted-media",
698 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
699 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56700 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53701 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03702 },
[email protected]f88628792012-12-18 07:07:50703 {
704 "enable-opus-playback",
705 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
706 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56707 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50708 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
709 },
[email protected]ca6eaa5a2013-01-24 16:16:04710 {
[email protected]c54e1aa2013-01-25 09:26:17711 "enable-vp9-playback",
712 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
713 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
714 kOsDesktop,
715 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
716 },
717 {
[email protected]ca6eaa5a2013-01-24 16:16:04718 "enable-managed-users",
719 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
720 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
721 kOsAll,
722 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
723 },
[email protected]dc04be7c2012-03-15 23:57:49724#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50725 {
[email protected]cda278d2012-10-30 20:31:40726 "ash-disable-auto-window-placement",
727 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
728 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
729 kOsWin | kOsLinux | kOsCrOS,
730 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
731 },
[email protected]b4e4ec42012-11-29 21:42:40732 {
[email protected]e4b81222013-02-05 15:38:42733 "ash-enable-per-app-launcher",
734 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_NAME,
735 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40736 kOsWin | kOsLinux | kOsCrOS,
[email protected]e4b81222013-02-05 15:38:42737 SINGLE_VALUE_TYPE(ash::switches::kAshEnablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40738 },
[email protected]dc04be7c2012-03-15 23:57:49739#endif
[email protected]eaae8b462012-01-20 22:20:39740 {
[email protected]db543d322011-12-15 20:40:15741 "per-tile-painting",
742 IDS_FLAGS_PER_TILE_PAINTING_NAME,
743 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
744#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37745 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15746#else
747 0,
748#endif
[email protected]65bfd9972012-10-19 03:39:37749 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15750 },
[email protected]bf88c032011-12-22 19:05:47751 {
752 "enable-javascript-harmony",
753 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
754 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
755 kOsAll,
756 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
757 },
[email protected]7e7f378a2012-01-05 14:35:37758 {
[email protected]85646172012-01-09 22:45:54759 "enable-tab-browser-dragging",
760 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
761 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
762 kOsWin,
763 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
764 },
765 {
[email protected]068b7b52012-02-27 12:41:44766 "disable-restore-session-state",
767 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
768 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37769 kOsAll,
[email protected]068b7b52012-02-27 12:41:44770 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37771 },
[email protected]88864db2012-01-18 20:56:35772 {
773 "disable-software-rasterizer",
774 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
775 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
776#if defined(ENABLE_SWIFTSHADER)
777 kOsAll,
778#else
779 0,
780#endif
781 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
782 },
[email protected]15a5d722012-01-23 09:11:14783 {
[email protected]ff7b6dd2012-09-15 20:20:03784 "enable-experimental-webkit-features",
785 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
786 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16787 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03788 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49789 },
790 {
[email protected]0f95a252012-09-13 22:30:04791 "enable-css-shaders",
792 IDS_FLAGS_CSS_SHADERS_NAME,
793 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
794 kOsAll,
795 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
796 },
797 {
[email protected]9860c68b2012-02-02 01:58:09798 "enable-extension-activity-ui",
799 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
800 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56801 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09802 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00803 },
[email protected]54ae4e92012-02-16 15:19:05804 {
[email protected]3e8befc2012-03-13 01:17:03805 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16806 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
807 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56808 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03809 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16810 },
[email protected]dc04be7c2012-03-15 23:57:49811#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01812 {
[email protected]3cd198a22012-03-12 20:38:01813 "enable-ash-oak",
814 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
815 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
816 kOsAll,
817 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
818 },
[email protected]31cf1c52012-02-29 20:55:01819#endif
[email protected]184ec592012-03-01 11:54:28820 {
821 "enable-devtools-experiments",
822 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
823 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56824 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28825 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
826 },
[email protected]76d1854e2012-03-02 23:57:44827 {
828 "enable-suggestions-ntp",
829 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
830 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56831 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44832 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
833 },
[email protected]a3d54252012-04-05 20:04:13834 {
[email protected]1dbaf5e2012-11-30 05:51:32835 "spellcheck-autocorrect",
836 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
837 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
838 kOsWin | kOsLinux | kOsCrOS,
839 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
840 },
841 {
[email protected]d7932532012-11-21 21:10:31842 "touch-events",
843 IDS_TOUCH_EVENTS_NAME,
844 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56845 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31846 MULTI_VALUE_TYPE(kTouchEventsChoices)
847 },
848 {
[email protected]c9c73ad42012-04-18 03:35:59849 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06850 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
851 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55852 kOsWin,
[email protected]347a0c72012-05-14 20:28:06853 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59854 },
[email protected]8a6aaa72012-04-20 20:53:58855 {
[email protected]f6f82832012-09-04 17:12:04856 "enable-webkit-text-subpixel-positioning",
857 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
858 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
859 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48860 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04861 },
862 {
[email protected]b9c96ff2012-11-26 22:24:40863 "disable-touch-adjustment",
864 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
865 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
866 kOsWin | kOsLinux | kOsCrOS,
867 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
868 },
869 {
[email protected]0b9383a2012-10-26 00:58:16870 "enable-tab-capture",
871 IDS_ENABLE_TAB_CAPTURE_NAME,
872 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25873 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16874 MULTI_VALUE_TYPE(kTabCaptureChoices)
875 },
[email protected]0b60afa2012-04-19 17:36:39876#if defined(OS_CHROMEOS)
877 {
[email protected]7c4a9bc2012-09-11 22:10:05878 "enable-background-loader",
879 IDS_ENABLE_BACKLOADER_NAME,
880 IDS_ENABLE_BACKLOADER_DESCRIPTION,
881 kOsCrOS,
882 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
883 },
884 {
[email protected]c5667b282012-08-31 00:32:50885 "enable-bezel-touch",
886 IDS_ENABLE_BEZEL_TOUCH_NAME,
887 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47888 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50889 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47890 },
891 {
[email protected]3f4181a2013-02-01 21:31:07892 "enable-screensaver-extension",
893 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
894 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
895 kOsCrOS,
896 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
897 },
898 {
[email protected]0b60afa2012-04-19 17:36:39899 "no-discard-tabs",
900 IDS_FLAGS_NO_DISCARD_TABS_NAME,
901 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
902 kOsCrOS,
903 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
904 },
905#endif
[email protected]79be6d32012-04-24 20:47:44906 {
[email protected]8d68a3e02013-01-12 15:57:10907 "enable-download-resumption",
908 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
909 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56910 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10911 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
912 },
913 {
[email protected]9a5940d2012-04-27 19:16:23914 "allow-nacl-socket-api",
915 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
916 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56917 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23918 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
919 },
[email protected]85333732012-05-01 19:02:24920 {
[email protected]60673ad72012-05-02 06:16:33921 "stacked-tab-strip",
922 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
923 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
924 kOsWin,
925 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
926 },
927 {
[email protected]4bd20202012-06-14 17:35:01928 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24929 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
930 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
931 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01932 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24933 },
[email protected]190349fd2012-05-02 00:10:47934#if defined(OS_CHROMEOS)
935 {
936 "allow-touchpad-three-finger-click",
937 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
938 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
939 kOsCrOS,
940 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
941 },
[email protected]fbc176b62012-10-27 02:19:58942 {
943 "allow-touchpad-three-finger-swipe",
944 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
945 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
946 kOsCrOS,
947 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
948 },
[email protected]190349fd2012-05-02 00:10:47949#endif
[email protected]1992a2f42012-10-23 18:32:21950 {
[email protected]a585e462013-01-26 00:37:15951 "use-client-login-signin-flow",
952 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
953 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21954 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15955 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21956 },
[email protected]8ee02242012-12-04 15:23:32957 {
958 "enable-desktop-guest-mode",
959 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
960 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
961 kOsMac | kOsWin | kOsLinux,
962 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
963 },
[email protected]53520b1b2012-05-07 21:43:37964#if defined(USE_ASH)
965 {
[email protected]35a4ced2013-02-06 23:24:42966 "show-launcher-alignment-menu",
967 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
968 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
969 kOsAll,
970 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
971 },
972 {
[email protected]73074742012-05-17 01:44:41973 "show-touch-hud",
974 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
975 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
976 kOsAll,
977 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
978 },
979 {
[email protected]9f0940b62012-05-23 22:56:35980 "enable-pinch",
981 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
982 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06983 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35984 SINGLE_VALUE_TYPE(switches::kEnablePinch),
985 },
[email protected]a8379312012-06-15 00:20:43986 {
987 "app-list-show-apps-only",
988 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
989 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
990 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03991 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43992 },
[email protected]73074742012-05-17 01:44:41993#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28994#if defined(OS_CHROMEOS)
995 {
[email protected]e03dc78d2012-07-24 08:21:43996 "disable-new-oobe",
997 IDS_FLAGS_DISABLE_NEW_OOBE,
998 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:28999 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:431000 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:281001 },
[email protected]8b04a1652012-08-04 02:59:491002 {
[email protected]528ced32012-12-14 00:40:441003 "disable-new-password-changed-dialog",
1004 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
1005 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
1006 kOsCrOS,
1007 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
1008 },
1009 {
[email protected]8b04a1652012-08-04 02:59:491010 "disable-boot-animation",
1011 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
1012 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
1013 kOsCrOS,
1014 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
1015 },
[email protected]95058572012-08-20 14:57:291016 {
[email protected]b4557192012-09-19 11:29:581017 "disable-boot-animation2",
1018 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
1019 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
1020 kOsCrOS,
1021 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1022 },
1023 {
[email protected]ea2f3342012-09-21 21:13:361024 "boot-animation-fucntion",
1025 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1026 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
1027 kOsCrOS,
1028 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1029 },
[email protected]839667d62012-10-23 19:38:571030 {
[email protected]d96aef22012-10-30 11:47:021031 "captive-portal-detector",
1032 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1033 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
1034 kOsCrOS,
1035 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1036 },
1037 {
[email protected]c11aa8f12012-12-18 18:43:141038 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571039 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1040 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1041 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141042 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571043 },
[email protected]f0280952012-11-06 20:30:501044 {
[email protected]0fb5c4852012-11-08 20:33:231045 "file-manager-packaged",
1046 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1047 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1048 kOsCrOS,
1049 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1050 },
[email protected]3e035e82012-11-27 20:54:321051 {
[email protected]8039e06c2013-01-17 23:34:501052 "disable-launcher-per-display",
1053 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1054 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351055 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501056 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351057 },
[email protected]06b146d2013-02-07 06:06:471058 {
1059 "enable-app-mode",
1060 IDS_FLAGS_ENABLE_KIOSK_APPS_NAME,
1061 IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION,
1062 kOsCrOS,
1063 SINGLE_VALUE_TYPE(switches::kEnableAppMode),
1064 },
[email protected]62018dc2012-12-13 00:37:351065#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391066 {
1067 "enable-views-textfield",
1068 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
1069 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
1070 kOsWin,
1071 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
1072 },
[email protected]bd0cd3bb2012-06-14 03:03:381073 {
[email protected]ef41b7ee2012-07-24 19:10:411074 "old-checkbox-style",
1075 IDS_FLAGS_OLD_CHECKBOX_STYLE,
1076 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
1077 kOsLinux | kOsCrOS,
1078 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
1079 },
1080 {
[email protected]2d4817742012-12-17 20:16:181081 "enable-new-dialog-style",
1082 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1083 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321084 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181085 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321086 },
[email protected]7db8893a2012-07-26 00:49:401087 { "disable-accelerated-video-decode",
1088 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1089 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561090 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401091 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151092 },
[email protected]66ae9fc2012-06-19 21:33:521093#if defined(USE_ASH)
1094 {
1095 "ash-debug-shortcuts",
1096 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1097 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1098 kOsAll,
1099 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1100 },
1101#endif
[email protected]37fee0942012-08-07 21:07:451102 {
[email protected]e2e8e322012-09-12 04:37:021103 "enable-webaudio-input",
1104 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1105 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561106 kOsDesktop,
[email protected]e2e8e322012-09-12 04:37:021107 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1108 },
1109 {
[email protected]ad3f6d22012-08-29 02:34:191110 "enable-contacts",
1111 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1112 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1113 kOsCrOS,
1114 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1115 },
[email protected]1d9bb9cd2012-08-28 22:02:501116#if defined(USE_ASH)
1117 { "ash-enable-advanced-gestures",
1118 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1119 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1120 kOsCrOS,
1121 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1122 },
[email protected]cfa24e62013-02-13 21:19:111123 { "ash-disable-tab-scrubbing",
1124 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1125 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161126 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111127 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161128 },
[email protected]83eef802012-12-02 07:43:521129 { "ash-enable-workspace-scrubbing",
1130 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1131 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1132 kOsCrOS,
1133 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1134 },
[email protected]d153e6f2012-12-21 07:38:091135 { "ash-immersive-mode",
1136 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1137 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241138 kOsCrOS,
[email protected]75ac23b2013-02-05 19:55:051139 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveMode),
[email protected]c043df272012-11-21 00:43:241140 },
[email protected]316708a2012-11-05 22:57:021141#if defined(OS_LINUX)
1142 { "ash-enable-memory-monitor",
1143 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1144 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1145 kOsCrOS,
1146 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1147 },
1148#endif
[email protected]1d9bb9cd2012-08-28 22:02:501149#endif
[email protected]9b7ab882012-09-10 23:46:361150#if defined(OS_CHROMEOS)
[email protected]88471ff2013-02-04 20:39:001151 { "ash-enable-new-network-status-area",
1152 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_NAME,
1153 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461154 kOsCrOS,
[email protected]88471ff2013-02-04 20:39:001155 SINGLE_VALUE_TYPE(ash::switches::kAshEnableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461156 },
[email protected]9b7ab882012-09-10 23:46:361157 {
[email protected]205f07892012-10-16 20:26:221158 "enable-carrier-switching",
1159 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1160 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1161 kOsCrOS,
1162 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1163 },
1164 {
[email protected]9b7ab882012-09-10 23:46:361165 "enable-request-tablet-site",
1166 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1167 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1168 kOsCrOS,
1169 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1170 },
1171#endif
[email protected]dab49c0b2012-10-04 05:55:351172 {
1173 "debug-packed-apps",
1174 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1175 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561176 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351177 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1178 },
[email protected]d1459ed2012-10-10 01:29:331179 {
1180 "enable-password-generation",
1181 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1182 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561183 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331184 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1185 },
[email protected]26d045f2012-10-18 21:18:431186 {
1187 "crash-on-gpu-hang",
1188 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1189 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1190 kOsAll,
1191 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1192 },
[email protected]075543d2012-10-24 01:29:141193 {
[email protected]76f7d4882012-10-26 21:09:221194 "enable-deferred-image-decoding",
1195 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1196 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1197#if defined(USE_SKIA)
1198 kOsMac | kOsLinux | kOsCrOS,
1199#else
1200 0,
1201#endif
1202 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1203 },
1204 {
[email protected]075543d2012-10-24 01:29:141205 "performance-monitor-gathering",
1206 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1207 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1208 kOsAll,
1209 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1210 },
[email protected]783d5bb2012-10-24 03:47:141211 {
[email protected]0572fb2e2012-11-03 00:38:591212 "enable-new-autofill-ui",
1213 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1214 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561215 kOsDesktop,
[email protected]0572fb2e2012-11-03 00:38:591216 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1217 },
1218 {
[email protected]783d5bb2012-10-24 03:47:141219 "enable-new-autofill-heuristics",
1220 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1221 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1222 kOsAll,
1223 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1224 },
[email protected]2c273bd2012-10-25 18:55:031225 {
[email protected]99002fd2012-11-06 04:35:521226 "show-app-list-shortcut",
1227 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1228 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1229 kOsWin,
1230 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1231 },
[email protected]a7259fb2012-11-08 06:22:231232 {
1233 "enable-experimental-form-filling",
1234 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1235 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1236 kOsWin | kOsCrOS,
1237 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1238 },
[email protected]6e6efe42013-01-30 00:04:501239 {
1240 "enable-interactive-autocomplete",
1241 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1242 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1243 kOsWin | kOsCrOS,
1244 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1245 },
[email protected]e42b1f82012-11-16 21:18:461246#if defined(USE_AURA)
1247 {
[email protected]9fb64a12013-02-11 21:16:011248 "enable-overscroll-history-navigation",
1249 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1250 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461251 kOsAll,
[email protected]9fb64a12013-02-11 21:16:011252 SINGLE_VALUE_TYPE(switches::kEnableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461253 },
1254#endif
[email protected]edbea622012-11-28 20:39:381255 {
1256 "enable-touch-drag-drop",
1257 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1258 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1259 kOsWin | kOsCrOS,
1260 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1261 },
[email protected]f1c39242013-01-29 16:13:011262#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201263 {
1264 "enable-rich-notifications",
1265 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1266 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1267 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011268 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201269 },
[email protected]f1c39242013-01-29 16:13:011270#endif
[email protected]4d51c682012-12-11 11:34:551271 {
1272 "full-history-sync",
1273 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1274 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1275 kOsAll,
1276 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1277 },
[email protected]628a69a92012-12-23 04:09:341278 {
[email protected]fd030142013-02-08 02:04:381279 "enable-usermedia-screen-capture",
1280 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1281 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1282 kOsDesktop,
1283 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1284 },
[email protected]a0e4b072011-08-17 01:47:071285};
[email protected]ad2a3ded2010-08-27 13:19:051286
[email protected]a314ee5a2010-10-26 21:23:281287const Experiment* experiments = kExperiments;
1288size_t num_experiments = arraysize(kExperiments);
1289
[email protected]e2ddbc92010-10-15 20:02:071290// Stores and encapsulates the little state that about:flags has.
1291class FlagsState {
1292 public:
1293 FlagsState() : needs_restart_(false) {}
1294 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1295 bool IsRestartNeededToCommitChanges();
1296 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281297 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071298 void RemoveFlagsSwitches(
1299 std::map<std::string, CommandLine::StringType>* switch_list);
1300 void reset();
1301
1302 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551303 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071304 return Singleton<FlagsState>::get();
1305 }
1306
1307 private:
1308 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531309 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071310
1311 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1312};
1313
[email protected]c7b7800a2010-10-07 18:51:351314// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051315// in a set.
[email protected]1a47d7e2010-10-15 00:37:241316void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051317 const ListValue* enabled_experiments = prefs->GetList(
1318 prefs::kEnabledLabsExperiments);
1319 if (!enabled_experiments)
1320 return;
1321
1322 for (ListValue::const_iterator it = enabled_experiments->begin();
1323 it != enabled_experiments->end();
1324 ++it) {
1325 std::string experiment_name;
1326 if (!(*it)->GetAsString(&experiment_name)) {
1327 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1328 continue;
1329 }
1330 result->insert(experiment_name);
1331 }
1332}
1333
1334// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241335void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051336 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381337 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1338 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051339
1340 experiments_list->Clear();
1341 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1342 it != enabled_experiments.end();
1343 ++it) {
1344 experiments_list->Append(new StringValue(*it));
1345 }
1346}
1347
[email protected]8a6ff28d2010-12-02 16:35:191348// Returns the name used in prefs for the choice at the specified index.
1349std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341350 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1351 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191352 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1353 base::IntToString(index);
1354}
1355
1356// Adds the internal names for the specified experiment to |names|.
1357void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1358 if (e.type == Experiment::SINGLE_VALUE) {
1359 names->insert(e.internal_name);
1360 } else {
[email protected]2ce9c89752011-02-25 18:24:341361 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191362 for (int i = 0; i < e.num_choices; ++i)
1363 names->insert(NameForChoice(e, i));
1364 }
1365}
1366
[email protected]28e35af2011-02-09 12:56:221367// Confirms that an experiment is valid, used in a DCHECK in
1368// SanitizeList below.
1369bool ValidateExperiment(const Experiment& e) {
1370 switch (e.type) {
1371 case Experiment::SINGLE_VALUE:
1372 DCHECK_EQ(0, e.num_choices);
1373 DCHECK(!e.choices);
1374 break;
1375 case Experiment::MULTI_VALUE:
1376 DCHECK_GT(e.num_choices, 0);
1377 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531378 DCHECK(e.choices[0].command_line_switch);
1379 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221380 break;
1381 default:
1382 NOTREACHED();
1383 }
1384 return true;
1385}
1386
[email protected]ad2a3ded2010-08-27 13:19:051387// Removes all experiments from prefs::kEnabledLabsExperiments that are
1388// unknown, to prevent this list to become very long as experiments are added
1389// and removed.
1390void SanitizeList(PrefService* prefs) {
1391 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221392 for (size_t i = 0; i < num_experiments; ++i) {
1393 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191394 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221395 }
[email protected]ad2a3ded2010-08-27 13:19:051396
1397 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241398 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051399
1400 std::set<std::string> new_enabled_experiments;
1401 std::set_intersection(
1402 known_experiments.begin(), known_experiments.end(),
1403 enabled_experiments.begin(), enabled_experiments.end(),
1404 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1405
[email protected]4c8853f2012-07-23 01:29:161406 if (new_enabled_experiments != enabled_experiments)
1407 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051408}
1409
[email protected]1a47d7e2010-10-15 00:37:241410void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051411 PrefService* prefs, std::set<std::string>* result) {
1412 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241413 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051414}
1415
[email protected]a314ee5a2010-10-26 21:23:281416// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1417// enabled on the current platform.
1418void GetSanitizedEnabledFlagsForCurrentPlatform(
1419 PrefService* prefs, std::set<std::string>* result) {
1420 GetSanitizedEnabledFlags(prefs, result);
1421
1422 // Filter out any experiments that aren't enabled on the current platform. We
1423 // don't remove these from prefs else syncing to a platform with a different
1424 // set of experiments would be lossy.
1425 std::set<std::string> platform_experiments;
1426 int current_platform = GetCurrentPlatform();
1427 for (size_t i = 0; i < num_experiments; ++i) {
1428 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191429 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281430 }
1431
1432 std::set<std::string> new_enabled_experiments;
1433 std::set_intersection(
1434 platform_experiments.begin(), platform_experiments.end(),
1435 result->begin(), result->end(),
1436 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1437
1438 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051439}
1440
[email protected]8a6ff28d2010-12-02 16:35:191441// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191442Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221443 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341444 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191445 ListValue* result = new ListValue;
1446 for (int i = 0; i < experiment.num_choices; ++i) {
1447 const Experiment::Choice& choice = experiment.choices[i];
1448 DictionaryValue* value = new DictionaryValue;
1449 std::string name = NameForChoice(experiment, i);
1450 value->SetString("description",
1451 l10n_util::GetStringUTF16(choice.description_id));
1452 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221453 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191454 result->Append(value);
1455 }
1456 return result;
1457}
1458
[email protected]e2ddbc92010-10-15 20:02:071459} // namespace
1460
[email protected]1a47d7e2010-10-15 00:37:241461void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551462 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051463}
1464
[email protected]1a47d7e2010-10-15 00:37:241465ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051466 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241467 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051468
1469 int current_platform = GetCurrentPlatform();
1470
1471 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281472 for (size_t i = 0; i < num_experiments; ++i) {
1473 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051474
1475 DictionaryValue* data = new DictionaryValue();
1476 data->SetString("internal_name", experiment.internal_name);
1477 data->SetString("name",
1478 l10n_util::GetStringUTF16(experiment.visible_name_id));
1479 data->SetString("description",
1480 l10n_util::GetStringUTF16(
1481 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401482 bool supported = !!(experiment.supported_platforms & current_platform);
1483 data->SetBoolean("supported", supported);
1484
1485 ListValue* supported_platforms = new ListValue();
1486 AddOsStrings(experiment.supported_platforms, supported_platforms);
1487 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051488
[email protected]28e35af2011-02-09 12:56:221489 switch (experiment.type) {
1490 case Experiment::SINGLE_VALUE:
1491 data->SetBoolean(
1492 "enabled",
1493 enabled_experiments.count(experiment.internal_name) > 0);
1494 break;
1495 case Experiment::MULTI_VALUE:
1496 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1497 break;
1498 default:
1499 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191500 }
1501
[email protected]ad2a3ded2010-08-27 13:19:051502 experiments_data->Append(data);
1503 }
1504 return experiments_data;
1505}
1506
[email protected]ad2a3ded2010-08-27 13:19:051507bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551508 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051509}
1510
1511void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351512 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551513 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071514}
1515
1516void RemoveFlagsSwitches(
1517 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551518 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071519}
1520
[email protected]a314ee5a2010-10-26 21:23:281521int GetCurrentPlatform() {
1522#if defined(OS_MACOSX)
1523 return kOsMac;
1524#elif defined(OS_WIN)
1525 return kOsWin;
1526#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1527 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211528#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281529 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401530#elif defined(OS_ANDROID)
1531 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281532#else
1533#error Unknown platform
1534#endif
1535}
1536
[email protected]4bc5050c2010-11-18 17:55:541537void RecordUMAStatistics(const PrefService* prefs) {
1538 std::set<std::string> flags;
1539 GetEnabledFlags(prefs, &flags);
1540 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1541 ++it) {
1542 std::string action("AboutFlags_");
1543 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381544 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541545 }
1546 // Since flag metrics are recorded every startup, add a tick so that the
1547 // stats can be made meaningful.
1548 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381549 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1550 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541551}
1552
[email protected]e2ddbc92010-10-15 20:02:071553//////////////////////////////////////////////////////////////////////////////
1554// FlagsState implementation.
1555
1556namespace {
1557
1558void FlagsState::ConvertFlagsToSwitches(
1559 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071560 if (command_line->HasSwitch(switches::kNoExperiments))
1561 return;
1562
1563 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001564
[email protected]a314ee5a2010-10-26 21:23:281565 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071566
[email protected]a82744532011-02-11 16:15:531567 typedef std::map<std::string, std::pair<std::string, std::string> >
1568 NameToSwitchAndValueMap;
1569 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191570 for (size_t i = 0; i < num_experiments; ++i) {
1571 const Experiment& e = experiments[i];
1572 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531573 name_to_switch_map[e.internal_name] =
1574 std::pair<std::string, std::string>(e.command_line_switch,
1575 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191576 } else {
1577 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531578 name_to_switch_map[NameForChoice(e, j)] =
1579 std::pair<std::string, std::string>(
1580 e.choices[j].command_line_switch,
1581 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191582 }
1583 }
[email protected]e2ddbc92010-10-15 20:02:071584
1585 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531586 flags_switches_.insert(
1587 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1588 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071589 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1590 it != enabled_experiments.end();
1591 ++it) {
1592 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531593 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191594 name_to_switch_map.find(experiment_name);
1595 if (name_to_switch_it == name_to_switch_map.end()) {
1596 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071597 continue;
[email protected]8a6ff28d2010-12-02 16:35:191598 }
[email protected]e2ddbc92010-10-15 20:02:071599
[email protected]a82744532011-02-11 16:15:531600 const std::pair<std::string, std::string>&
1601 switch_and_value_pair = name_to_switch_it->second;
1602
1603 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1604 switch_and_value_pair.second);
1605 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071606 }
1607 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531608 flags_switches_.insert(
1609 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1610 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071611}
1612
1613bool FlagsState::IsRestartNeededToCommitChanges() {
1614 return needs_restart_;
1615}
1616
1617void FlagsState::SetExperimentEnabled(
1618 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051619 needs_restart_ = true;
1620
[email protected]8a6ff28d2010-12-02 16:35:191621 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1622 if (at_index != std::string::npos) {
1623 DCHECK(enable);
1624 // We're being asked to enable a multi-choice experiment. Disable the
1625 // currently selected choice.
1626 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221627 const std::string experiment_name = internal_name.substr(0, at_index);
1628 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191629
[email protected]28e35af2011-02-09 12:56:221630 // And enable the new choice, if it is not the default first choice.
1631 if (internal_name != experiment_name + "@0") {
1632 std::set<std::string> enabled_experiments;
1633 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1634 enabled_experiments.insert(internal_name);
1635 SetEnabledFlags(prefs, enabled_experiments);
1636 }
[email protected]8a6ff28d2010-12-02 16:35:191637 return;
1638 }
1639
[email protected]ad2a3ded2010-08-27 13:19:051640 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241641 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051642
[email protected]8a6ff28d2010-12-02 16:35:191643 const Experiment* e = NULL;
1644 for (size_t i = 0; i < num_experiments; ++i) {
1645 if (experiments[i].internal_name == internal_name) {
1646 e = experiments + i;
1647 break;
1648 }
1649 }
1650 DCHECK(e);
1651
1652 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591653 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191654 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591655 else
[email protected]8a6ff28d2010-12-02 16:35:191656 enabled_experiments.erase(internal_name);
1657 } else {
1658 if (enable) {
1659 // Enable the first choice.
1660 enabled_experiments.insert(NameForChoice(*e, 0));
1661 } else {
1662 // Find the currently enabled choice and disable it.
1663 for (int i = 0; i < e->num_choices; ++i) {
1664 std::string choice_name = NameForChoice(*e, i);
1665 if (enabled_experiments.find(choice_name) !=
1666 enabled_experiments.end()) {
1667 enabled_experiments.erase(choice_name);
1668 // Continue on just in case there's a bug and more than one
1669 // experiment for this choice was enabled.
1670 }
1671 }
1672 }
1673 }
[email protected]ad2a3ded2010-08-27 13:19:051674
[email protected]1a47d7e2010-10-15 00:37:241675 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051676}
1677
[email protected]e2ddbc92010-10-15 20:02:071678void FlagsState::RemoveFlagsSwitches(
1679 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531680 for (std::map<std::string, std::string>::const_iterator
1681 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1682 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071683 }
1684}
1685
1686void FlagsState::reset() {
1687 needs_restart_ = false;
1688 flags_switches_.clear();
1689}
1690
[email protected]38e46812011-05-09 20:49:221691} // namespace
[email protected]e2ddbc92010-10-15 20:02:071692
1693namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191694
1695// WARNING: '@' is also used in the html file. If you update this constant you
1696// also need to update the html file.
1697const char kMultiSeparator[] = "@";
1698
[email protected]e2ddbc92010-10-15 20:02:071699void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551700 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071701}
[email protected]a314ee5a2010-10-26 21:23:281702
1703void SetExperiments(const Experiment* e, size_t count) {
1704 if (!e) {
1705 experiments = kExperiments;
1706 num_experiments = arraysize(kExperiments);
1707 } else {
1708 experiments = e;
1709 num_experiments = count;
1710 }
1711}
1712
[email protected]8a6ff28d2010-12-02 16:35:191713const Experiment* GetExperiments(size_t* count) {
1714 *count = num_experiments;
1715 return experiments;
1716}
1717
[email protected]e2ddbc92010-10-15 20:02:071718} // namespace testing
1719
[email protected]1a47d7e2010-10-15 00:37:241720} // namespace about_flags