blob: 8f5ee79629596a2dae35c8e7a93ca60cb0205ad0 [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>
[email protected]83e9fa702013-02-25 19:30:4411#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0512
[email protected]ad2a3ded2010-08-27 13:19:0513#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1514#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5715#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4116#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0317#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0518#include "base/values.h"
[email protected]65bfd9972012-10-19 03:39:3719#include "cc/switches.h"
[email protected]1bc78422011-03-31 08:41:3820#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0321#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0522#include "chrome/common/chrome_switches.h"
23#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3824#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0225#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0526#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0227#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0228#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0329#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1730#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5931#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4832#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2733#include "ui/gl/gl_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4334#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0535
[email protected]f1c39242013-01-29 16:13:0136#if defined(ENABLE_MESSAGE_CENTER)
37#include "ui/message_center/message_center_switches.h"
38#endif
39
[email protected]dc04be7c2012-03-15 23:57:4940#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3141#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4942#endif
43
[email protected]badba1ad2012-11-16 17:21:4644#if defined(OS_CHROMEOS)
45#include "chromeos/chromeos_switches.h"
46#endif
47
[email protected]7f6f44c2011-12-14 13:23:3848using content::UserMetricsAction;
49
[email protected]1a47d7e2010-10-15 00:37:2450namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0551
[email protected]8a6ff28d2010-12-02 16:35:1952// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5353#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4454 Experiment::SINGLE_VALUE, \
55 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5356#define SINGLE_VALUE_TYPE(command_line_switch) \
57 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4458#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
59 disable_switch, disable_value) \
60 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
61 disable_switch, disable_value, NULL, 3
62#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
63 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5364#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4465 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1966
[email protected]e2ddbc92010-10-15 20:02:0767namespace {
68
[email protected]9c7453d2012-01-21 00:45:4069const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5670const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0571
[email protected]cc3e2052011-12-20 01:01:4072// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
73// whether the experiment is available on that platform.
74void AddOsStrings(unsigned bitmask, ListValue* list) {
75 struct {
76 unsigned bit;
77 const char* const name;
78 } kBitsToOs[] = {
79 {kOsMac, "Mac"},
80 {kOsWin, "Windows"},
81 {kOsLinux, "Linux"},
82 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0183 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4084 };
85 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
86 if (bitmask & kBitsToOs[i].bit)
87 list->Append(new StringValue(kBitsToOs[i].name));
88}
89
[email protected]68317802012-06-07 19:13:2390const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
91 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
92 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
93 switches::kOmniboxHistoryQuickProviderNewScoring,
94 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
95 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
96 switches::kOmniboxHistoryQuickProviderNewScoring,
97 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
98};
99
[email protected]128dc6c2012-06-22 20:30:35100const Experiment::Choice
101 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
102 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
103 "",
104 "" },
105 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
106 switches::kOmniboxHistoryQuickProviderReorderForInlining,
107 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
108 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
109 switches::kOmniboxHistoryQuickProviderReorderForInlining,
110 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
111};
112
[email protected]032d5e6c2012-02-17 17:53:55113const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
114 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
115 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
116 switches::kOmniboxInlineHistoryQuickProvider,
117 switches::kOmniboxInlineHistoryQuickProviderAllowed },
118 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
119 switches::kOmniboxInlineHistoryQuickProvider,
120 switches::kOmniboxInlineHistoryQuickProviderProhibited }
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]8b1c3c72013-01-25 01:48:43133const Experiment::Choice kGDIPresentChoices[] = {
134 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
135 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
136 switches::kDoFirstShowPresentWithGDI, ""},
137 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
138 switches::kDoAllShowPresentWithGDI, ""}
139};
140
[email protected]d7932532012-11-21 21:10:31141const Experiment::Choice kTouchEventsChoices[] = {
142 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
143 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
144 switches::kTouchEvents,
145 switches::kTouchEventsEnabled },
146 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
147 switches::kTouchEvents,
148 switches::kTouchEventsDisabled }
149};
150
[email protected]347a0c72012-05-14 20:28:06151const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31152 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20153 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06154 switches::kTouchOptimizedUI,
155 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20156 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06157 switches::kTouchOptimizedUI,
158 switches::kTouchOptimizedUIDisabled }
159};
160
[email protected]66f409c2012-10-04 20:59:04161const Experiment::Choice kNaClDebugMaskChoices[] = {
162 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
163 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
164 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
165 // an option to switch off its debugging.
166 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
167 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
168 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
169 switches::kNaClDebugMask, "*://*/*debug.nmf" }
170};
171
[email protected]ea2f3342012-09-21 21:13:36172#if defined(OS_CHROMEOS)
173const Experiment::Choice kAshBootAnimationFunction[] = {
174 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
175 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
176 ash::switches::kAshBootAnimationFunction2, ""},
177 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
178 ash::switches::kAshBootAnimationFunction3, ""}
179};
[email protected]d96aef22012-10-30 11:47:02180
181const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19182 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02183 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19184 switches::kEnableChromeCaptivePortalDetector, ""},
185 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
186 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02187};
[email protected]ea2f3342012-09-21 21:13:36188#endif
189
[email protected]9323fdd12013-02-23 00:31:36190const Experiment::Choice kImplSidePaintingChoices[] = {
191 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
192 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
193 cc::switches::kEnableImplSidePainting, ""},
194 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
195 cc::switches::kDisableImplSidePainting, ""}
196};
197
[email protected]4bc5050c2010-11-18 17:55:54198// RECORDING USER METRICS FOR FLAGS:
199// -----------------------------------------------------------------------------
200// The first line of the experiment is the internal name. If you'd like to
201// gather statistics about the usage of your flag, you should append a marker
202// comment to the end of the feature name, like so:
203// "my-special-feature", // FLAGS:RECORD_UMA
204//
205// After doing that, run //chrome/tools/extract_actions.py (see instructions at
206// the top of that file for details) to update the chromeactions.txt file, which
207// will enable UMA to record your feature flag.
208//
[email protected]783d5bb2012-10-24 03:47:14209// After your feature has shipped under a flag, you can locate the metrics under
210// the action name AboutFlags_internal-action-name. Actions are recorded once
211// per startup, so you should divide this number by AboutFlags_StartupTick to
212// get a sense of usage. Note that this will not be the same as number of users
213// with a given feature enabled because users can quit and relaunch the
214// application multiple times over a given time interval. The dashboard also
215// shows you how many (metrics reporting) users have enabled the flag over the
216// last seven days. However, note that this is not the same as the number of
217// users who have the flag enabled, since enabling the flag happens once,
218// whereas running with the flag enabled happens until the user flips the flag
219// again.
[email protected]4bc5050c2010-11-18 17:55:54220
[email protected]8a6ff28d2010-12-02 16:35:19221// To add a new experiment add to the end of kExperiments. There are two
222// distinct types of experiments:
223// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
224// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22225// . MULTI_VALUE: a list of choices, the first of which should correspond to a
226// deactivated state for this lab (i.e. no command line option). To specify
227// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
228// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19229// See the documentation of Experiment for details on the fields.
230//
231// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05232const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44233#if defined(OS_ANDROID)
234 {
[email protected]199def22013-02-21 17:52:29235 "enable-spdy-proxy-auth",
236 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
237 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44238 kOsAndroid,
[email protected]199def22013-02-21 17:52:29239 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44240 },
241#endif
[email protected]ad2a3ded2010-08-27 13:19:05242 {
[email protected]aac169d2011-03-18 19:53:03243 "expose-for-tabs", // FLAGS:RECORD_UMA
244 IDS_FLAGS_TABPOSE_NAME,
245 IDS_FLAGS_TABPOSE_DESCRIPTION,
246 kOsMac,
247#if defined(OS_MACOSX)
248 // The switch exists only on OS X.
249 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
250#else
251 SINGLE_VALUE_TYPE("")
252#endif
253 },
254 {
[email protected]4bc5050c2010-11-18 17:55:54255 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05256 IDS_FLAGS_CONFLICTS_CHECK_NAME,
257 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
258 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19259 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05260 },
261 {
[email protected]4bc5050c2010-11-18 17:55:54262 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54263 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
264 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45265 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22266 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31267 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22268 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
269 // always have PDF rasterization available, so no flag needed there.
270#if !defined(GOOGLE_CHROME_BUILD)
271 kOsWin,
272#else
273 0,
[email protected]fa6d2a2f2010-11-30 21:47:19274#endif
[email protected]8a6ff28d2010-12-02 16:35:19275 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42276 },
[email protected]60d77bd2012-08-22 00:10:07277#if defined(OS_WIN)
278 {
279 "print-raster",
280 IDS_FLAGS_PRINT_RASTER_NAME,
281 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
282 kOsWin,
283 SINGLE_VALUE_TYPE(switches::kPrintRaster)
284 },
285#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05286 {
[email protected]bb461532010-11-26 21:50:23287 "crxless-web-apps",
288 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
289 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56290 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19291 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23292 },
293 {
[email protected]96c6f4c2011-05-18 19:36:22294 "ignore-gpu-blacklist",
295 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
296 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
297 kOsAll,
298 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
299 },
300 {
[email protected]0110cf112011-07-02 00:39:43301 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22302 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
303 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23304 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44305 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
306 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22307 },
308 {
[email protected]72787e392012-03-23 05:55:43309 "threaded-compositing-mode",
310 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
311 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56312 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44313 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
314 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59315 },
316 {
[email protected]17e27692013-02-06 17:02:09317 "force-accelerated-composited-scrolling",
318 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
319 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
320 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44321 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
322 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09323 },
324 {
[email protected]8b1c3c72013-01-25 01:48:43325 "present-with-GDI",
326 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
327 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
328 kOsWin,
329 MULTI_VALUE_TYPE(kGDIPresentChoices)
330 },
331 {
[email protected]81c64af62012-06-06 20:15:52332 "disable-accelerated-2d-canvas",
333 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
334 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
335 kOsAll,
336 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
337 },
338 {
[email protected]69cffc82012-08-10 13:27:27339 "disable-deferred-2d-canvas",
340 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
341 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
342 kOsAll,
343 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
344 },
345 {
[email protected]efcde132012-05-30 01:05:18346 "disable-threaded-animation",
347 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
348 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59349 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37350 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59351 },
352 {
[email protected]5963b772011-02-09 22:55:38353 "composited-layer-borders",
354 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
355 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
356 kOsAll,
357 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
358 },
359 {
[email protected]a8f1eaa2011-03-07 19:00:58360 "show-fps-counter",
361 IDS_FLAGS_SHOW_FPS_COUNTER,
362 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
363 kOsAll,
364 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
365 },
[email protected]8ff7f342011-05-25 01:49:47366 {
[email protected]70c98a332011-12-21 20:51:52367 "accelerated-filters",
368 IDS_FLAGS_ACCELERATED_FILTERS,
369 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
370 kOsAll,
371 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
372 },
373 {
[email protected]8ff7f342011-05-25 01:49:47374 "disable-gpu-vsync",
375 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
376 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56377 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47378 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
379 },
[email protected]deaba6d52011-09-23 14:47:12380 {
[email protected]4052d832013-01-16 05:31:01381 "enable-webgl",
382 IDS_FLAGS_ENABLE_WEBGL_NAME,
383 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
384 kOsAndroid,
385#if defined(OS_ANDROID)
386 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
387#else
388 SINGLE_VALUE_TYPE("")
389#endif
390 },
391 {
[email protected]deaba6d52011-09-23 14:47:12392 "disable-webgl",
393 IDS_FLAGS_DISABLE_WEBGL_NAME,
394 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56395 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01396#if defined(OS_ANDROID)
397 SINGLE_VALUE_TYPE("")
398#else
[email protected]deaba6d52011-09-23 14:47:12399 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01400#endif
[email protected]deaba6d52011-09-23 14:47:12401 },
[email protected]09096e02012-05-24 11:12:04402 {
[email protected]d9da9582013-01-31 04:59:05403 "enable-webrtc",
404 IDS_FLAGS_ENABLE_WEBRTC_NAME,
405 IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION,
406 kOsAndroid,
407#if defined(OS_ANDROID)
408 SINGLE_VALUE_TYPE(switches::kEnableWebRTC)
409#else
410 SINGLE_VALUE_TYPE("")
411#endif
412 },
413 {
[email protected]96bcdc102012-05-24 23:42:10414 "fixed-position-creates-stacking-context",
415 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
416 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
417 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44418 ENABLE_DISABLE_VALUE_TYPE(
419 switches::kEnableFixedPositionCreatesStackingContext,
420 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10421 },
[email protected]fb854192013-02-06 01:30:04422 {
423 "enable-compositing-for-fixed-position",
424 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
425 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
426 kOsAll,
427 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
428 },
[email protected]a7640ef22012-10-06 00:52:08429 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53430 {
[email protected]e3791ce92011-08-09 01:03:32431 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40432 IDS_FLAGS_ENABLE_NACL_NAME,
433 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56434 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19435 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40436 },
[email protected]b39c6d92012-01-31 16:38:41437 // TODO(halyavin): When exception handling is on by default, replace this
438 // flag with disable-nacl-exception-handling.
439 {
440 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
441 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
442 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56443 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41444 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
445 },
[email protected]4ff87d202010-11-06 01:28:40446 {
[email protected]9addd1c2012-09-15 14:28:24447 "enable-nacl-debug", // FLAGS:RECORD_UMA
448 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
449 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56450 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24451 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13452 },
453 {
[email protected]66f409c2012-10-04 20:59:04454 "nacl-debug-mask", // FLAGS:RECORD_UMA
455 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
456 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56457 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04458 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
459 },
460 {
[email protected]7babd1c2012-08-08 20:35:29461 "enable-pnacl", // FLAGS:RECORD_UMA
462 IDS_FLAGS_ENABLE_PNACL_NAME,
463 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56464 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29465 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
466 },
467 {
[email protected]4bc5050c2010-11-18 17:55:54468 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32469 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
470 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56471 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19472 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32473 },
[email protected]3627b06d2010-11-12 16:36:16474 {
[email protected]544471a2012-10-13 05:27:09475 "action-box",
[email protected]cab18ef2012-04-27 07:22:03476 IDS_FLAGS_ACTION_BOX_NAME,
477 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56478 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44479 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
480 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03481 },
482 {
[email protected]3a362432012-06-18 20:39:51483 "script-badges",
484 IDS_FLAGS_SCRIPT_BADGES_NAME,
485 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56486 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09487 SINGLE_VALUE_TYPE(switches::kScriptBadges)
488 },
489 {
490 "script-bubble",
491 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
492 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56493 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44494 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
495 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51496 },
497 {
[email protected]cbe224d2011-08-04 22:12:49498 "apps-new-install-bubble",
499 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
500 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56501 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49502 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
503 },
504 {
[email protected]80bd24e2010-11-30 09:34:38505 "disable-hyperlink-auditing",
506 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
507 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
508 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19509 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51510 },
511 {
512 "experimental-location-features", // FLAGS:RECORD_UMA
513 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
514 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
515 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19516 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
517 },
518 {
[email protected]5aea1862011-03-23 23:55:39519 "tab-groups-context-menu",
520 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
521 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
522 kOsWin,
523 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
524 },
[email protected]c94cebd2012-06-21 00:55:28525 {
526 "enable-instant-extended-api",
527 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
528 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56529 kOsDesktop,
[email protected]73444382013-02-26 19:31:51530 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
531 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28532 },
[email protected]e9bf9d92011-03-31 20:57:15533 {
[email protected]354e33b2011-06-15 00:29:10534 "static-ip-config",
535 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
536 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
537 kOsCrOS,
538#if defined(OS_CHROMEOS)
539 // This switch exists only on Chrome OS.
540 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
541#else
542 SINGLE_VALUE_TYPE("")
543#endif
544 },
[email protected]3eb5728c2011-06-20 22:32:24545 {
546 "show-autofill-type-predictions",
547 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
548 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
549 kOsAll,
550 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
551 },
[email protected]bff4d3e2011-06-21 23:58:52552 {
[email protected]fdf4e252012-04-27 00:26:55553 "sync-tab-favicons",
554 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
555 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
556 kOsAll,
557 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
558 },
559 {
[email protected]aae9eeb12011-10-21 21:59:26560 "sync-app-notifications",
561 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
562 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56563 kOsDesktop,
[email protected]0b6fba82011-11-18 01:31:11564 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26565 },
566 {
[email protected]5d90a0a2012-11-15 02:43:40567 "sync-keystore-encryption",
568 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
569 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
570 kOsAll,
571 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
572 },
573 {
[email protected]e755a382012-09-13 17:16:35574 "enable-gesture-tap-highlight",
575 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
576 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
577 kOsLinux | kOsCrOS,
578 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
579 },
580 {
[email protected]a22ebd812011-06-23 00:05:39581 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
582 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
583 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
584 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40585 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25586 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39587 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
588 },
[email protected]81a6b0b2011-06-24 17:55:40589 {
[email protected]68317802012-06-07 19:13:23590 "omnibox-history-quick-provider-new-scoring",
591 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
592 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
593 kOsAll,
594 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
595 },
596 {
[email protected]128dc6c2012-06-22 20:30:35597 "omnibox-history-quick-provider-reorder-for-inlining",
598 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
599 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
600 kOsAll,
601 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
602 },
603 {
[email protected]032d5e6c2012-02-17 17:53:55604 "omnibox-inline-history-quick-provider",
605 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
606 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
607 kOsAll,
608 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
609 },
610 {
[email protected]7e7a28092011-12-09 22:24:55611 "enable-panels",
612 IDS_FLAGS_ENABLE_PANELS_NAME,
613 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56614 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55615 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54616 },
[email protected]e3749d12011-07-25 22:22:12617 {
[email protected]fd38cc82012-12-19 18:19:29618 "enable-panel-stacking",
619 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
620 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56621 kOsDesktop,
[email protected]fd38cc82012-12-19 18:19:29622 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
623 },
624 {
[email protected]27c14f02012-06-22 17:29:58625 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27626 "save-page-as-mhtml", // FLAGS:RECORD_UMA
627 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
628 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
629 kOsMac | kOsWin | kOsLinux,
630 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
631 },
632 {
[email protected]b7bb44f2011-09-01 05:17:03633 "enable-autologin",
634 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
635 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
636 kOsMac | kOsWin | kOsLinux,
637 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
638 },
[email protected]b9841172011-09-26 23:36:09639 {
[email protected]3231b612012-03-23 05:57:54640 "enable-spdy3",
641 IDS_FLAGS_ENABLE_SPDY3_NAME,
642 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
643 kOsAll,
644 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
645 },
646 {
[email protected]27b3fe92012-03-21 05:35:06647 "enable-async-dns",
648 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
649 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46650 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44651 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
652 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06653 },
654 {
[email protected]1eb93802012-09-11 18:57:56655 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11656 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
657 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32658 kOsAll,
[email protected]da43c082012-09-07 18:56:11659 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44660 },
[email protected]e4e68dbb2011-11-18 01:50:22661 {
[email protected]36d98412013-01-31 20:28:53662 "disable-encrypted-media",
663 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
664 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56665 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53666 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03667 },
[email protected]f88628792012-12-18 07:07:50668 {
669 "enable-opus-playback",
670 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
671 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56672 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50673 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
674 },
[email protected]ca6eaa5a2013-01-24 16:16:04675 {
[email protected]c54e1aa2013-01-25 09:26:17676 "enable-vp9-playback",
677 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
678 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
679 kOsDesktop,
680 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
681 },
682 {
[email protected]ca6eaa5a2013-01-24 16:16:04683 "enable-managed-users",
684 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
685 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
686 kOsAll,
687 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
688 },
[email protected]dc04be7c2012-03-15 23:57:49689#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50690 {
[email protected]cda278d2012-10-30 20:31:40691 "ash-disable-auto-window-placement",
692 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
693 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
694 kOsWin | kOsLinux | kOsCrOS,
695 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
696 },
[email protected]b4e4ec42012-11-29 21:42:40697 {
[email protected]16f55a22013-02-13 23:47:34698 "ash-disable-per-app-launcher",
699 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
700 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40701 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34702 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40703 },
[email protected]dc04be7c2012-03-15 23:57:49704#endif
[email protected]eaae8b462012-01-20 22:20:39705 {
[email protected]db543d322011-12-15 20:40:15706 "per-tile-painting",
707 IDS_FLAGS_PER_TILE_PAINTING_NAME,
708 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
709#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37710 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15711#else
712 0,
713#endif
[email protected]65bfd9972012-10-19 03:39:37714 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15715 },
[email protected]bf88c032011-12-22 19:05:47716 {
717 "enable-javascript-harmony",
718 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
719 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
720 kOsAll,
721 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
722 },
[email protected]7e7f378a2012-01-05 14:35:37723 {
[email protected]85646172012-01-09 22:45:54724 "enable-tab-browser-dragging",
725 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
726 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
727 kOsWin,
728 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
729 },
730 {
[email protected]068b7b52012-02-27 12:41:44731 "disable-restore-session-state",
732 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
733 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37734 kOsAll,
[email protected]068b7b52012-02-27 12:41:44735 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37736 },
[email protected]88864db2012-01-18 20:56:35737 {
738 "disable-software-rasterizer",
739 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
740 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
741#if defined(ENABLE_SWIFTSHADER)
742 kOsAll,
743#else
744 0,
745#endif
746 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
747 },
[email protected]15a5d722012-01-23 09:11:14748 {
[email protected]ff7b6dd2012-09-15 20:20:03749 "enable-experimental-webkit-features",
750 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
751 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16752 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03753 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49754 },
755 {
[email protected]0f95a252012-09-13 22:30:04756 "enable-css-shaders",
757 IDS_FLAGS_CSS_SHADERS_NAME,
758 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
759 kOsAll,
760 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
761 },
762 {
[email protected]9860c68b2012-02-02 01:58:09763 "enable-extension-activity-ui",
764 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
765 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56766 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09767 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00768 },
[email protected]54ae4e92012-02-16 15:19:05769 {
[email protected]3e8befc2012-03-13 01:17:03770 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16771 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
772 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56773 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03774 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16775 },
[email protected]dc04be7c2012-03-15 23:57:49776#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01777 {
[email protected]3cd198a22012-03-12 20:38:01778 "enable-ash-oak",
779 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
780 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
781 kOsAll,
782 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
783 },
[email protected]31cf1c52012-02-29 20:55:01784#endif
[email protected]184ec592012-03-01 11:54:28785 {
786 "enable-devtools-experiments",
787 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
788 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56789 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28790 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
791 },
[email protected]76d1854e2012-03-02 23:57:44792 {
[email protected]2fefdb32013-02-26 14:28:10793 "silent-debugger-extension-api",
794 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
795 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
796 kOsDesktop,
797 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
798 },
799 {
[email protected]76d1854e2012-03-02 23:57:44800 "enable-suggestions-ntp",
801 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
802 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56803 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44804 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
805 },
[email protected]a3d54252012-04-05 20:04:13806 {
[email protected]1dbaf5e2012-11-30 05:51:32807 "spellcheck-autocorrect",
808 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
809 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
810 kOsWin | kOsLinux | kOsCrOS,
811 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
812 },
813 {
[email protected]d7932532012-11-21 21:10:31814 "touch-events",
815 IDS_TOUCH_EVENTS_NAME,
816 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56817 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31818 MULTI_VALUE_TYPE(kTouchEventsChoices)
819 },
820 {
[email protected]c9c73ad42012-04-18 03:35:59821 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06822 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
823 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55824 kOsWin,
[email protected]347a0c72012-05-14 20:28:06825 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59826 },
[email protected]8a6aaa72012-04-20 20:53:58827 {
[email protected]f6f82832012-09-04 17:12:04828 "enable-webkit-text-subpixel-positioning",
829 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
830 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
831 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48832 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04833 },
834 {
[email protected]b9c96ff2012-11-26 22:24:40835 "disable-touch-adjustment",
836 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
837 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
838 kOsWin | kOsLinux | kOsCrOS,
839 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
840 },
841 {
[email protected]0b9383a2012-10-26 00:58:16842 "enable-tab-capture",
843 IDS_ENABLE_TAB_CAPTURE_NAME,
844 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25845 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44846 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
847 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16848 },
[email protected]0b60afa2012-04-19 17:36:39849#if defined(OS_CHROMEOS)
850 {
[email protected]7c4a9bc2012-09-11 22:10:05851 "enable-background-loader",
852 IDS_ENABLE_BACKLOADER_NAME,
853 IDS_ENABLE_BACKLOADER_DESCRIPTION,
854 kOsCrOS,
855 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
856 },
857 {
[email protected]c5667b282012-08-31 00:32:50858 "enable-bezel-touch",
859 IDS_ENABLE_BEZEL_TOUCH_NAME,
860 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47861 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50862 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47863 },
864 {
[email protected]3f4181a2013-02-01 21:31:07865 "enable-screensaver-extension",
866 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
867 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
868 kOsCrOS,
869 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
870 },
871 {
[email protected]0b60afa2012-04-19 17:36:39872 "no-discard-tabs",
873 IDS_FLAGS_NO_DISCARD_TABS_NAME,
874 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
875 kOsCrOS,
876 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
877 },
878#endif
[email protected]79be6d32012-04-24 20:47:44879 {
[email protected]8d68a3e02013-01-12 15:57:10880 "enable-download-resumption",
881 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
882 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56883 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10884 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
885 },
886 {
[email protected]9a5940d2012-04-27 19:16:23887 "allow-nacl-socket-api",
888 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
889 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56890 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23891 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
892 },
[email protected]85333732012-05-01 19:02:24893 {
[email protected]60673ad72012-05-02 06:16:33894 "stacked-tab-strip",
895 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
896 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
897 kOsWin,
898 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
899 },
900 {
[email protected]4bd20202012-06-14 17:35:01901 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24902 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
903 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
904 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01905 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24906 },
[email protected]190349fd2012-05-02 00:10:47907#if defined(OS_CHROMEOS)
908 {
909 "allow-touchpad-three-finger-click",
910 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
911 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
912 kOsCrOS,
913 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
914 },
[email protected]fbc176b62012-10-27 02:19:58915 {
916 "allow-touchpad-three-finger-swipe",
917 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
918 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
919 kOsCrOS,
920 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
921 },
[email protected]190349fd2012-05-02 00:10:47922#endif
[email protected]1992a2f42012-10-23 18:32:21923 {
[email protected]a585e462013-01-26 00:37:15924 "use-client-login-signin-flow",
925 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
926 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21927 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15928 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21929 },
[email protected]8ee02242012-12-04 15:23:32930 {
931 "enable-desktop-guest-mode",
932 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
933 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
934 kOsMac | kOsWin | kOsLinux,
935 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
936 },
[email protected]53520b1b2012-05-07 21:43:37937#if defined(USE_ASH)
938 {
[email protected]35a4ced2013-02-06 23:24:42939 "show-launcher-alignment-menu",
940 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
941 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
942 kOsAll,
943 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
944 },
945 {
[email protected]73074742012-05-17 01:44:41946 "show-touch-hud",
947 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
948 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
949 kOsAll,
950 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
951 },
952 {
[email protected]9f0940b62012-05-23 22:56:35953 "enable-pinch",
954 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
955 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06956 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35957 SINGLE_VALUE_TYPE(switches::kEnablePinch),
958 },
[email protected]a8379312012-06-15 00:20:43959 {
960 "app-list-show-apps-only",
961 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
962 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
963 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03964 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43965 },
[email protected]73074742012-05-17 01:44:41966#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28967#if defined(OS_CHROMEOS)
968 {
[email protected]8b04a1652012-08-04 02:59:49969 "disable-boot-animation",
970 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
971 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
972 kOsCrOS,
973 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
974 },
[email protected]95058572012-08-20 14:57:29975 {
[email protected]b4557192012-09-19 11:29:58976 "disable-boot-animation2",
977 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
978 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
979 kOsCrOS,
980 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
981 },
982 {
[email protected]ea2f3342012-09-21 21:13:36983 "boot-animation-fucntion",
984 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
985 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
986 kOsCrOS,
987 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
988 },
[email protected]839667d62012-10-23 19:38:57989 {
[email protected]d96aef22012-10-30 11:47:02990 "captive-portal-detector",
991 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
992 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
993 kOsCrOS,
994 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
995 },
996 {
[email protected]c11aa8f12012-12-18 18:43:14997 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57998 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
999 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1000 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141001 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571002 },
[email protected]f0280952012-11-06 20:30:501003 {
[email protected]0fb5c4852012-11-08 20:33:231004 "file-manager-packaged",
1005 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1006 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1007 kOsCrOS,
1008 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1009 },
[email protected]3e035e82012-11-27 20:54:321010 {
[email protected]8039e06c2013-01-17 23:34:501011 "disable-launcher-per-display",
1012 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1013 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351014 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501015 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351016 },
[email protected]06b146d2013-02-07 06:06:471017 {
1018 "enable-app-mode",
1019 IDS_FLAGS_ENABLE_KIOSK_APPS_NAME,
1020 IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION,
1021 kOsCrOS,
1022 SINGLE_VALUE_TYPE(switches::kEnableAppMode),
1023 },
[email protected]62018dc2012-12-13 00:37:351024#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391025 {
1026 "enable-views-textfield",
1027 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
1028 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
1029 kOsWin,
1030 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
1031 },
[email protected]bd0cd3bb2012-06-14 03:03:381032 {
[email protected]ef41b7ee2012-07-24 19:10:411033 "old-checkbox-style",
1034 IDS_FLAGS_OLD_CHECKBOX_STYLE,
1035 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
1036 kOsLinux | kOsCrOS,
1037 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
1038 },
1039 {
[email protected]2d4817742012-12-17 20:16:181040 "enable-new-dialog-style",
1041 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1042 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321043 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181044 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321045 },
[email protected]7db8893a2012-07-26 00:49:401046 { "disable-accelerated-video-decode",
1047 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1048 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561049 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401050 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151051 },
[email protected]66ae9fc2012-06-19 21:33:521052#if defined(USE_ASH)
1053 {
1054 "ash-debug-shortcuts",
1055 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1056 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1057 kOsAll,
1058 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1059 },
1060#endif
[email protected]37fee0942012-08-07 21:07:451061 {
[email protected]e2e8e322012-09-12 04:37:021062 "enable-webaudio-input",
1063 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1064 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561065 kOsDesktop,
[email protected]e2e8e322012-09-12 04:37:021066 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1067 },
1068 {
[email protected]ad3f6d22012-08-29 02:34:191069 "enable-contacts",
1070 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1071 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1072 kOsCrOS,
1073 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1074 },
[email protected]1d9bb9cd2012-08-28 22:02:501075#if defined(USE_ASH)
1076 { "ash-enable-advanced-gestures",
1077 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1078 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1079 kOsCrOS,
1080 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1081 },
[email protected]cfa24e62013-02-13 21:19:111082 { "ash-disable-tab-scrubbing",
1083 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1084 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161085 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111086 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161087 },
[email protected]83eef802012-12-02 07:43:521088 { "ash-enable-workspace-scrubbing",
1089 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1090 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1091 kOsCrOS,
1092 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1093 },
[email protected]d153e6f2012-12-21 07:38:091094 { "ash-immersive-mode",
1095 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1096 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241097 kOsCrOS,
[email protected]75ac23b2013-02-05 19:55:051098 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveMode),
[email protected]c043df272012-11-21 00:43:241099 },
[email protected]316708a2012-11-05 22:57:021100#if defined(OS_LINUX)
1101 { "ash-enable-memory-monitor",
1102 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1103 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1104 kOsCrOS,
1105 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1106 },
1107#endif
[email protected]1d9bb9cd2012-08-28 22:02:501108#endif
[email protected]9b7ab882012-09-10 23:46:361109#if defined(OS_CHROMEOS)
[email protected]88471ff2013-02-04 20:39:001110 { "ash-enable-new-network-status-area",
1111 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_NAME,
1112 IDS_FLAGS_ASH_ENABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461113 kOsCrOS,
[email protected]88471ff2013-02-04 20:39:001114 SINGLE_VALUE_TYPE(ash::switches::kAshEnableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461115 },
[email protected]9b7ab882012-09-10 23:46:361116 {
[email protected]205f07892012-10-16 20:26:221117 "enable-carrier-switching",
1118 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1119 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1120 kOsCrOS,
1121 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1122 },
1123 {
[email protected]9b7ab882012-09-10 23:46:361124 "enable-request-tablet-site",
1125 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1126 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1127 kOsCrOS,
1128 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1129 },
1130#endif
[email protected]dab49c0b2012-10-04 05:55:351131 {
1132 "debug-packed-apps",
1133 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1134 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561135 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351136 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1137 },
[email protected]d1459ed2012-10-10 01:29:331138 {
1139 "enable-password-generation",
1140 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1141 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561142 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331143 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1144 },
[email protected]26d045f2012-10-18 21:18:431145 {
1146 "crash-on-gpu-hang",
1147 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1148 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1149 kOsAll,
1150 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1151 },
[email protected]075543d2012-10-24 01:29:141152 {
[email protected]76f7d4882012-10-26 21:09:221153 "enable-deferred-image-decoding",
1154 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1155 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1156#if defined(USE_SKIA)
1157 kOsMac | kOsLinux | kOsCrOS,
1158#else
1159 0,
1160#endif
1161 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1162 },
1163 {
[email protected]075543d2012-10-24 01:29:141164 "performance-monitor-gathering",
1165 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1166 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1167 kOsAll,
1168 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1169 },
[email protected]783d5bb2012-10-24 03:47:141170 {
[email protected]4ec93802013-02-23 05:56:221171 "disable-native-autofill-ui",
1172 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1173 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561174 kOsDesktop,
[email protected]4ec93802013-02-23 05:56:221175 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]0572fb2e2012-11-03 00:38:591176 },
1177 {
[email protected]99002fd2012-11-06 04:35:521178 "show-app-list-shortcut",
1179 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1180 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1181 kOsWin,
1182 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1183 },
[email protected]a7259fb2012-11-08 06:22:231184 {
1185 "enable-experimental-form-filling",
1186 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1187 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1188 kOsWin | kOsCrOS,
1189 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1190 },
[email protected]6e6efe42013-01-30 00:04:501191 {
1192 "enable-interactive-autocomplete",
1193 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1194 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221195 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501196 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1197 },
[email protected]e42b1f82012-11-16 21:18:461198#if defined(USE_AURA)
1199 {
[email protected]b75ba132013-02-26 19:38:311200 "disable-overscroll-history-navigation",
1201 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1202 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461203 kOsAll,
[email protected]b75ba132013-02-26 19:38:311204 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461205 },
1206#endif
[email protected]edbea622012-11-28 20:39:381207 {
1208 "enable-touch-drag-drop",
1209 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1210 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1211 kOsWin | kOsCrOS,
1212 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1213 },
[email protected]0e2f43b62013-02-21 00:47:151214 {
1215 "enable-touch-editing",
1216 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1217 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1218 kOsCrOS,
1219 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1220 },
[email protected]f1c39242013-01-29 16:13:011221#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201222 {
1223 "enable-rich-notifications",
1224 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1225 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1226 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011227 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201228 },
[email protected]f1c39242013-01-29 16:13:011229#endif
[email protected]4d51c682012-12-11 11:34:551230 {
1231 "full-history-sync",
1232 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1233 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1234 kOsAll,
1235 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1236 },
[email protected]628a69a92012-12-23 04:09:341237 {
[email protected]fd030142013-02-08 02:04:381238 "enable-usermedia-screen-capture",
1239 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1240 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1241 kOsDesktop,
1242 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1243 },
[email protected]5b93e162013-02-19 06:33:091244 {
1245 "enable-apps-devtool-app",
1246 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1247 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1248 kOsDesktop,
1249 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1250 },
[email protected]9323fdd12013-02-23 00:31:361251 {
1252 "impl-side-painting",
1253 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1254 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
1255 kOsAndroid,
1256 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1257 },
[email protected]a0e4b072011-08-17 01:47:071258};
[email protected]ad2a3ded2010-08-27 13:19:051259
[email protected]a314ee5a2010-10-26 21:23:281260const Experiment* experiments = kExperiments;
1261size_t num_experiments = arraysize(kExperiments);
1262
[email protected]e2ddbc92010-10-15 20:02:071263// Stores and encapsulates the little state that about:flags has.
1264class FlagsState {
1265 public:
1266 FlagsState() : needs_restart_(false) {}
1267 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1268 bool IsRestartNeededToCommitChanges();
1269 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281270 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071271 void RemoveFlagsSwitches(
1272 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001273 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071274 void reset();
1275
1276 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551277 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071278 return Singleton<FlagsState>::get();
1279 }
1280
1281 private:
1282 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531283 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071284
1285 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1286};
1287
[email protected]c7b7800a2010-10-07 18:51:351288// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051289// in a set.
[email protected]1a47d7e2010-10-15 00:37:241290void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051291 const ListValue* enabled_experiments = prefs->GetList(
1292 prefs::kEnabledLabsExperiments);
1293 if (!enabled_experiments)
1294 return;
1295
1296 for (ListValue::const_iterator it = enabled_experiments->begin();
1297 it != enabled_experiments->end();
1298 ++it) {
1299 std::string experiment_name;
1300 if (!(*it)->GetAsString(&experiment_name)) {
1301 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1302 continue;
1303 }
1304 result->insert(experiment_name);
1305 }
1306}
1307
1308// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241309void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051310 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381311 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1312 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051313
1314 experiments_list->Clear();
1315 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1316 it != enabled_experiments.end();
1317 ++it) {
1318 experiments_list->Append(new StringValue(*it));
1319 }
1320}
1321
[email protected]8a6ff28d2010-12-02 16:35:191322// Adds the internal names for the specified experiment to |names|.
1323void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1324 if (e.type == Experiment::SINGLE_VALUE) {
1325 names->insert(e.internal_name);
1326 } else {
[email protected]83e9fa702013-02-25 19:30:441327 DCHECK(e.type == Experiment::MULTI_VALUE ||
1328 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191329 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441330 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191331 }
1332}
1333
[email protected]28e35af2011-02-09 12:56:221334// Confirms that an experiment is valid, used in a DCHECK in
1335// SanitizeList below.
1336bool ValidateExperiment(const Experiment& e) {
1337 switch (e.type) {
1338 case Experiment::SINGLE_VALUE:
1339 DCHECK_EQ(0, e.num_choices);
1340 DCHECK(!e.choices);
1341 break;
1342 case Experiment::MULTI_VALUE:
1343 DCHECK_GT(e.num_choices, 0);
1344 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531345 DCHECK(e.choices[0].command_line_switch);
1346 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221347 break;
[email protected]83e9fa702013-02-25 19:30:441348 case Experiment::ENABLE_DISABLE_VALUE:
1349 DCHECK_EQ(3, e.num_choices);
1350 DCHECK(!e.choices);
1351 DCHECK(e.command_line_switch);
1352 DCHECK(e.command_line_value);
1353 DCHECK(e.disable_command_line_switch);
1354 DCHECK(e.disable_command_line_value);
1355 break;
[email protected]28e35af2011-02-09 12:56:221356 default:
1357 NOTREACHED();
1358 }
1359 return true;
1360}
1361
[email protected]ad2a3ded2010-08-27 13:19:051362// Removes all experiments from prefs::kEnabledLabsExperiments that are
1363// unknown, to prevent this list to become very long as experiments are added
1364// and removed.
1365void SanitizeList(PrefService* prefs) {
1366 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221367 for (size_t i = 0; i < num_experiments; ++i) {
1368 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191369 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221370 }
[email protected]ad2a3ded2010-08-27 13:19:051371
1372 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241373 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051374
1375 std::set<std::string> new_enabled_experiments;
1376 std::set_intersection(
1377 known_experiments.begin(), known_experiments.end(),
1378 enabled_experiments.begin(), enabled_experiments.end(),
1379 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1380
[email protected]4c8853f2012-07-23 01:29:161381 if (new_enabled_experiments != enabled_experiments)
1382 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051383}
1384
[email protected]1a47d7e2010-10-15 00:37:241385void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051386 PrefService* prefs, std::set<std::string>* result) {
1387 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241388 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051389}
1390
[email protected]a314ee5a2010-10-26 21:23:281391// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1392// enabled on the current platform.
1393void GetSanitizedEnabledFlagsForCurrentPlatform(
1394 PrefService* prefs, std::set<std::string>* result) {
1395 GetSanitizedEnabledFlags(prefs, result);
1396
1397 // Filter out any experiments that aren't enabled on the current platform. We
1398 // don't remove these from prefs else syncing to a platform with a different
1399 // set of experiments would be lossy.
1400 std::set<std::string> platform_experiments;
1401 int current_platform = GetCurrentPlatform();
1402 for (size_t i = 0; i < num_experiments; ++i) {
1403 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191404 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281405 }
1406
1407 std::set<std::string> new_enabled_experiments;
1408 std::set_intersection(
1409 platform_experiments.begin(), platform_experiments.end(),
1410 result->begin(), result->end(),
1411 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1412
1413 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051414}
1415
[email protected]8a6ff28d2010-12-02 16:35:191416// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191417Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221418 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441419 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1420 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191421 ListValue* result = new ListValue;
1422 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191423 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441424 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191425 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441426 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221427 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191428 result->Append(value);
1429 }
1430 return result;
1431}
1432
[email protected]e2ddbc92010-10-15 20:02:071433} // namespace
1434
[email protected]83e9fa702013-02-25 19:30:441435std::string Experiment::NameForChoice(int index) const {
1436 DCHECK(type == Experiment::MULTI_VALUE ||
1437 type == Experiment::ENABLE_DISABLE_VALUE);
1438 DCHECK_LT(index, num_choices);
1439 return std::string(internal_name) + testing::kMultiSeparator +
1440 base::IntToString(index);
1441}
1442
1443string16 Experiment::DescriptionForChoice(int index) const {
1444 DCHECK(type == Experiment::MULTI_VALUE ||
1445 type == Experiment::ENABLE_DISABLE_VALUE);
1446 DCHECK_LT(index, num_choices);
1447 int description_id;
1448 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1449 const int kEnableDisableDescriptionIds[] = {
1450 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1451 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1452 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1453 };
1454 description_id = kEnableDisableDescriptionIds[index];
1455 } else {
1456 description_id = choices[index].description_id;
1457 }
1458 return l10n_util::GetStringUTF16(description_id);
1459}
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:
[email protected]83e9fa702013-02-25 19:30:441496 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221497 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1498 break;
1499 default:
1500 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191501 }
1502
[email protected]ad2a3ded2010-08-27 13:19:051503 experiments_data->Append(data);
1504 }
1505 return experiments_data;
1506}
1507
[email protected]ad2a3ded2010-08-27 13:19:051508bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551509 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051510}
1511
1512void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351513 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551514 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071515}
1516
1517void RemoveFlagsSwitches(
1518 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551519 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071520}
1521
[email protected]cb93bf52013-02-20 01:20:001522void ResetAllFlags(PrefService* prefs) {
1523 FlagsState::GetInstance()->ResetAllFlags(prefs);
1524}
1525
[email protected]a314ee5a2010-10-26 21:23:281526int GetCurrentPlatform() {
1527#if defined(OS_MACOSX)
1528 return kOsMac;
1529#elif defined(OS_WIN)
1530 return kOsWin;
1531#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1532 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211533#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281534 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401535#elif defined(OS_ANDROID)
1536 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281537#else
1538#error Unknown platform
1539#endif
1540}
1541
[email protected]4bc5050c2010-11-18 17:55:541542void RecordUMAStatistics(const PrefService* prefs) {
1543 std::set<std::string> flags;
1544 GetEnabledFlags(prefs, &flags);
1545 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1546 ++it) {
1547 std::string action("AboutFlags_");
1548 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381549 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541550 }
1551 // Since flag metrics are recorded every startup, add a tick so that the
1552 // stats can be made meaningful.
1553 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381554 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1555 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541556}
1557
[email protected]e2ddbc92010-10-15 20:02:071558//////////////////////////////////////////////////////////////////////////////
1559// FlagsState implementation.
1560
1561namespace {
1562
[email protected]83e9fa702013-02-25 19:30:441563typedef std::map<std::string, std::pair<std::string, std::string> >
1564 NameToSwitchAndValueMap;
1565
1566void SetFlagToSwitchMapping(const std::string& key,
1567 const std::string& switch_name,
1568 const std::string& switch_value,
1569 NameToSwitchAndValueMap* name_to_switch_map) {
1570 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1571 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1572}
1573
[email protected]e2ddbc92010-10-15 20:02:071574void FlagsState::ConvertFlagsToSwitches(
1575 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071576 if (command_line->HasSwitch(switches::kNoExperiments))
1577 return;
1578
1579 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001580
[email protected]a314ee5a2010-10-26 21:23:281581 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071582
[email protected]a82744532011-02-11 16:15:531583 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191584 for (size_t i = 0; i < num_experiments; ++i) {
1585 const Experiment& e = experiments[i];
1586 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441587 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1588 e.command_line_value, &name_to_switch_map);
1589 } else if (e.type == Experiment::MULTI_VALUE) {
1590 for (int j = 0; j < e.num_choices; ++j) {
1591 SetFlagToSwitchMapping(e.NameForChoice(j),
1592 e.choices[j].command_line_switch,
1593 e.choices[j].command_line_value,
1594 &name_to_switch_map);
1595 }
[email protected]8a6ff28d2010-12-02 16:35:191596 } else {
[email protected]83e9fa702013-02-25 19:30:441597 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1598 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1599 &name_to_switch_map);
1600 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1601 e.command_line_value, &name_to_switch_map);
1602 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1603 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191604 }
1605 }
[email protected]e2ddbc92010-10-15 20:02:071606
1607 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531608 flags_switches_.insert(
1609 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1610 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071611 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1612 it != enabled_experiments.end();
1613 ++it) {
1614 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531615 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191616 name_to_switch_map.find(experiment_name);
1617 if (name_to_switch_it == name_to_switch_map.end()) {
1618 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071619 continue;
[email protected]8a6ff28d2010-12-02 16:35:191620 }
[email protected]e2ddbc92010-10-15 20:02:071621
[email protected]a82744532011-02-11 16:15:531622 const std::pair<std::string, std::string>&
1623 switch_and_value_pair = name_to_switch_it->second;
1624
1625 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1626 switch_and_value_pair.second);
1627 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071628 }
1629 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531630 flags_switches_.insert(
1631 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1632 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071633}
1634
1635bool FlagsState::IsRestartNeededToCommitChanges() {
1636 return needs_restart_;
1637}
1638
1639void FlagsState::SetExperimentEnabled(
1640 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051641 needs_restart_ = true;
1642
[email protected]83e9fa702013-02-25 19:30:441643 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191644 if (at_index != std::string::npos) {
1645 DCHECK(enable);
1646 // We're being asked to enable a multi-choice experiment. Disable the
1647 // currently selected choice.
1648 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221649 const std::string experiment_name = internal_name.substr(0, at_index);
1650 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191651
[email protected]28e35af2011-02-09 12:56:221652 // And enable the new choice, if it is not the default first choice.
1653 if (internal_name != experiment_name + "@0") {
1654 std::set<std::string> enabled_experiments;
1655 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1656 enabled_experiments.insert(internal_name);
1657 SetEnabledFlags(prefs, enabled_experiments);
1658 }
[email protected]8a6ff28d2010-12-02 16:35:191659 return;
1660 }
1661
[email protected]ad2a3ded2010-08-27 13:19:051662 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241663 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051664
[email protected]8a6ff28d2010-12-02 16:35:191665 const Experiment* e = NULL;
1666 for (size_t i = 0; i < num_experiments; ++i) {
1667 if (experiments[i].internal_name == internal_name) {
1668 e = experiments + i;
1669 break;
1670 }
1671 }
1672 DCHECK(e);
1673
1674 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591675 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191676 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591677 else
[email protected]8a6ff28d2010-12-02 16:35:191678 enabled_experiments.erase(internal_name);
1679 } else {
1680 if (enable) {
1681 // Enable the first choice.
[email protected]83e9fa702013-02-25 19:30:441682 enabled_experiments.insert(e->NameForChoice(0));
[email protected]8a6ff28d2010-12-02 16:35:191683 } else {
1684 // Find the currently enabled choice and disable it.
1685 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441686 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191687 if (enabled_experiments.find(choice_name) !=
1688 enabled_experiments.end()) {
1689 enabled_experiments.erase(choice_name);
1690 // Continue on just in case there's a bug and more than one
1691 // experiment for this choice was enabled.
1692 }
1693 }
1694 }
1695 }
[email protected]ad2a3ded2010-08-27 13:19:051696
[email protected]1a47d7e2010-10-15 00:37:241697 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051698}
1699
[email protected]e2ddbc92010-10-15 20:02:071700void FlagsState::RemoveFlagsSwitches(
1701 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531702 for (std::map<std::string, std::string>::const_iterator
1703 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1704 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071705 }
1706}
1707
[email protected]cb93bf52013-02-20 01:20:001708void FlagsState::ResetAllFlags(PrefService* prefs) {
1709 needs_restart_ = true;
1710
1711 std::set<std::string> no_experiments;
1712 SetEnabledFlags(prefs, no_experiments);
1713}
1714
[email protected]e2ddbc92010-10-15 20:02:071715void FlagsState::reset() {
1716 needs_restart_ = false;
1717 flags_switches_.clear();
1718}
1719
[email protected]38e46812011-05-09 20:49:221720} // namespace
[email protected]e2ddbc92010-10-15 20:02:071721
1722namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191723
1724// WARNING: '@' is also used in the html file. If you update this constant you
1725// also need to update the html file.
1726const char kMultiSeparator[] = "@";
1727
[email protected]e2ddbc92010-10-15 20:02:071728void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551729 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071730}
[email protected]a314ee5a2010-10-26 21:23:281731
1732void SetExperiments(const Experiment* e, size_t count) {
1733 if (!e) {
1734 experiments = kExperiments;
1735 num_experiments = arraysize(kExperiments);
1736 } else {
1737 experiments = e;
1738 num_experiments = count;
1739 }
1740}
1741
[email protected]8a6ff28d2010-12-02 16:35:191742const Experiment* GetExperiments(size_t* count) {
1743 *count = num_experiments;
1744 return experiments;
1745}
1746
[email protected]e2ddbc92010-10-15 20:02:071747} // namespace testing
1748
[email protected]1a47d7e2010-10-15 00:37:241749} // namespace about_flags