blob: b98e5cb2451adc8f025f5f765fdd365c6be85286 [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]7d1d2092013-03-04 04:12:4313#include "apps/switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0514#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1515#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5716#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4117#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0318#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0519#include "base/values.h"
[email protected]65bfd9972012-10-19 03:39:3720#include "cc/switches.h"
[email protected]1bc78422011-03-31 08:41:3821#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0322#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0523#include "chrome/common/chrome_switches.h"
24#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3825#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0226#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0527#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0228#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0229#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0330#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1731#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5932#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4833#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2734#include "ui/gl/gl_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4335#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0536
[email protected]f1c39242013-01-29 16:13:0137#if defined(ENABLE_MESSAGE_CENTER)
38#include "ui/message_center/message_center_switches.h"
39#endif
40
[email protected]dc04be7c2012-03-15 23:57:4941#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3142#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4943#endif
44
[email protected]badba1ad2012-11-16 17:21:4645#if defined(OS_CHROMEOS)
46#include "chromeos/chromeos_switches.h"
47#endif
48
[email protected]7f6f44c2011-12-14 13:23:3849using content::UserMetricsAction;
50
[email protected]1a47d7e2010-10-15 00:37:2451namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0552
[email protected]8a6ff28d2010-12-02 16:35:1953// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5354#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4455 Experiment::SINGLE_VALUE, \
56 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5357#define SINGLE_VALUE_TYPE(command_line_switch) \
58 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4459#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
60 disable_switch, disable_value) \
61 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
62 disable_switch, disable_value, NULL, 3
63#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
64 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5365#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4466 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1967
[email protected]e2ddbc92010-10-15 20:02:0768namespace {
69
[email protected]9c7453d2012-01-21 00:45:4070const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5671const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0572
[email protected]cc3e2052011-12-20 01:01:4073// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
74// whether the experiment is available on that platform.
75void AddOsStrings(unsigned bitmask, ListValue* list) {
76 struct {
77 unsigned bit;
78 const char* const name;
79 } kBitsToOs[] = {
80 {kOsMac, "Mac"},
81 {kOsWin, "Windows"},
82 {kOsLinux, "Linux"},
83 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0184 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4085 };
86 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
87 if (bitmask & kBitsToOs[i].bit)
88 list->Append(new StringValue(kBitsToOs[i].name));
89}
90
[email protected]68317802012-06-07 19:13:2391const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
92 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
93 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
94 switches::kOmniboxHistoryQuickProviderNewScoring,
95 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
97 switches::kOmniboxHistoryQuickProviderNewScoring,
98 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
99};
100
[email protected]128dc6c2012-06-22 20:30:35101const Experiment::Choice
102 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
103 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
104 "",
105 "" },
106 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
107 switches::kOmniboxHistoryQuickProviderReorderForInlining,
108 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
109 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
110 switches::kOmniboxHistoryQuickProviderReorderForInlining,
111 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
112};
113
[email protected]032d5e6c2012-02-17 17:53:55114const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
115 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
116 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
117 switches::kOmniboxInlineHistoryQuickProvider,
118 switches::kOmniboxInlineHistoryQuickProviderAllowed },
119 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
120 switches::kOmniboxInlineHistoryQuickProvider,
121 switches::kOmniboxInlineHistoryQuickProviderProhibited }
122};
123
[email protected]fb854192013-02-06 01:30:04124const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
125 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
126 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
127 switches::kEnableCompositingForFixedPosition, ""},
128 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
129 switches::kDisableCompositingForFixedPosition, ""},
130 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
131 switches::kEnableHighDpiCompositingForFixedPosition, ""}
132};
133
[email protected]8b1c3c72013-01-25 01:48:43134const Experiment::Choice kGDIPresentChoices[] = {
135 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
136 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
137 switches::kDoFirstShowPresentWithGDI, ""},
138 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
139 switches::kDoAllShowPresentWithGDI, ""}
140};
141
[email protected]d7932532012-11-21 21:10:31142const Experiment::Choice kTouchEventsChoices[] = {
143 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
144 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
145 switches::kTouchEvents,
146 switches::kTouchEventsEnabled },
147 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
148 switches::kTouchEvents,
149 switches::kTouchEventsDisabled }
150};
151
[email protected]347a0c72012-05-14 20:28:06152const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31153 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20154 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06155 switches::kTouchOptimizedUI,
156 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20157 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06158 switches::kTouchOptimizedUI,
159 switches::kTouchOptimizedUIDisabled }
160};
161
[email protected]66f409c2012-10-04 20:59:04162const Experiment::Choice kNaClDebugMaskChoices[] = {
163 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
164 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
165 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
166 // an option to switch off its debugging.
167 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
168 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
169 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
170 switches::kNaClDebugMask, "*://*/*debug.nmf" }
171};
172
[email protected]ea2f3342012-09-21 21:13:36173#if defined(OS_CHROMEOS)
174const Experiment::Choice kAshBootAnimationFunction[] = {
175 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
176 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
177 ash::switches::kAshBootAnimationFunction2, ""},
178 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
179 ash::switches::kAshBootAnimationFunction3, ""}
180};
[email protected]d96aef22012-10-30 11:47:02181
182const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19183 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02184 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19185 switches::kEnableChromeCaptivePortalDetector, ""},
186 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
187 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02188};
[email protected]a78c7432013-03-13 06:22:43189
190const Experiment::Choice kAshInternalDisplayUIScaleChoices[] = {
191 { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_DEFAULT, "", "" },
192 { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_80,
193 ash::switches::kAshInternalDisplayUIScale, "0.8"},
194 { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_125,
195 ash::switches::kAshInternalDisplayUIScale, "1.25"},
196 { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_150,
197 ash::switches::kAshInternalDisplayUIScale, "1.5"},
198};
199
[email protected]ea2f3342012-09-21 21:13:36200#endif
201
[email protected]9323fdd12013-02-23 00:31:36202const Experiment::Choice kImplSidePaintingChoices[] = {
203 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
204 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
205 cc::switches::kEnableImplSidePainting, ""},
206 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
207 cc::switches::kDisableImplSidePainting, ""}
208};
209
[email protected]4bc5050c2010-11-18 17:55:54210// RECORDING USER METRICS FOR FLAGS:
211// -----------------------------------------------------------------------------
212// The first line of the experiment is the internal name. If you'd like to
213// gather statistics about the usage of your flag, you should append a marker
214// comment to the end of the feature name, like so:
215// "my-special-feature", // FLAGS:RECORD_UMA
216//
217// After doing that, run //chrome/tools/extract_actions.py (see instructions at
218// the top of that file for details) to update the chromeactions.txt file, which
219// will enable UMA to record your feature flag.
220//
[email protected]783d5bb2012-10-24 03:47:14221// After your feature has shipped under a flag, you can locate the metrics under
222// the action name AboutFlags_internal-action-name. Actions are recorded once
223// per startup, so you should divide this number by AboutFlags_StartupTick to
224// get a sense of usage. Note that this will not be the same as number of users
225// with a given feature enabled because users can quit and relaunch the
226// application multiple times over a given time interval. The dashboard also
227// shows you how many (metrics reporting) users have enabled the flag over the
228// last seven days. However, note that this is not the same as the number of
229// users who have the flag enabled, since enabling the flag happens once,
230// whereas running with the flag enabled happens until the user flips the flag
231// again.
[email protected]4bc5050c2010-11-18 17:55:54232
[email protected]8a6ff28d2010-12-02 16:35:19233// To add a new experiment add to the end of kExperiments. There are two
234// distinct types of experiments:
235// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
236// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22237// . MULTI_VALUE: a list of choices, the first of which should correspond to a
238// deactivated state for this lab (i.e. no command line option). To specify
239// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
240// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19241// See the documentation of Experiment for details on the fields.
242//
243// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05244const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44245#if defined(OS_ANDROID)
246 {
[email protected]199def22013-02-21 17:52:29247 "enable-spdy-proxy-auth",
248 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
249 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44250 kOsAndroid,
[email protected]199def22013-02-21 17:52:29251 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44252 },
253#endif
[email protected]ad2a3ded2010-08-27 13:19:05254 {
[email protected]aac169d2011-03-18 19:53:03255 "expose-for-tabs", // FLAGS:RECORD_UMA
256 IDS_FLAGS_TABPOSE_NAME,
257 IDS_FLAGS_TABPOSE_DESCRIPTION,
258 kOsMac,
259#if defined(OS_MACOSX)
260 // The switch exists only on OS X.
261 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
262#else
263 SINGLE_VALUE_TYPE("")
264#endif
265 },
266 {
[email protected]4bc5050c2010-11-18 17:55:54267 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05268 IDS_FLAGS_CONFLICTS_CHECK_NAME,
269 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
270 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19271 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05272 },
273 {
[email protected]4bc5050c2010-11-18 17:55:54274 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54275 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
276 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45277 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22278 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31279 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22280 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
281 // always have PDF rasterization available, so no flag needed there.
282#if !defined(GOOGLE_CHROME_BUILD)
283 kOsWin,
284#else
285 0,
[email protected]fa6d2a2f2010-11-30 21:47:19286#endif
[email protected]8a6ff28d2010-12-02 16:35:19287 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42288 },
[email protected]60d77bd2012-08-22 00:10:07289#if defined(OS_WIN)
290 {
291 "print-raster",
292 IDS_FLAGS_PRINT_RASTER_NAME,
293 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
294 kOsWin,
295 SINGLE_VALUE_TYPE(switches::kPrintRaster)
296 },
297#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05298 {
[email protected]bb461532010-11-26 21:50:23299 "crxless-web-apps",
300 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
301 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56302 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19303 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23304 },
305 {
[email protected]96c6f4c2011-05-18 19:36:22306 "ignore-gpu-blacklist",
307 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
308 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
309 kOsAll,
310 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
311 },
312 {
[email protected]0110cf112011-07-02 00:39:43313 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22314 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
315 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23316 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44317 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
318 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22319 },
320 {
[email protected]72787e392012-03-23 05:55:43321 "threaded-compositing-mode",
322 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
323 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56324 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44325 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
326 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59327 },
328 {
[email protected]17e27692013-02-06 17:02:09329 "force-accelerated-composited-scrolling",
330 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
331 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
332 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44333 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
334 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09335 },
336 {
[email protected]8b1c3c72013-01-25 01:48:43337 "present-with-GDI",
338 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
339 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
340 kOsWin,
341 MULTI_VALUE_TYPE(kGDIPresentChoices)
342 },
343 {
[email protected]81c64af62012-06-06 20:15:52344 "disable-accelerated-2d-canvas",
345 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
346 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
347 kOsAll,
348 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
349 },
350 {
[email protected]69cffc82012-08-10 13:27:27351 "disable-deferred-2d-canvas",
352 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
353 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
354 kOsAll,
355 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
356 },
357 {
[email protected]efcde132012-05-30 01:05:18358 "disable-threaded-animation",
359 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
360 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59361 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37362 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59363 },
364 {
[email protected]5963b772011-02-09 22:55:38365 "composited-layer-borders",
366 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
367 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
368 kOsAll,
369 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
370 },
371 {
[email protected]a8f1eaa2011-03-07 19:00:58372 "show-fps-counter",
373 IDS_FLAGS_SHOW_FPS_COUNTER,
374 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
375 kOsAll,
376 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
377 },
[email protected]8ff7f342011-05-25 01:49:47378 {
[email protected]70c98a332011-12-21 20:51:52379 "accelerated-filters",
380 IDS_FLAGS_ACCELERATED_FILTERS,
381 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
382 kOsAll,
383 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
384 },
385 {
[email protected]8ff7f342011-05-25 01:49:47386 "disable-gpu-vsync",
387 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
388 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56389 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47390 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
391 },
[email protected]deaba6d52011-09-23 14:47:12392 {
[email protected]4052d832013-01-16 05:31:01393 "enable-webgl",
394 IDS_FLAGS_ENABLE_WEBGL_NAME,
395 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
396 kOsAndroid,
397#if defined(OS_ANDROID)
398 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
399#else
400 SINGLE_VALUE_TYPE("")
401#endif
402 },
403 {
[email protected]deaba6d52011-09-23 14:47:12404 "disable-webgl",
405 IDS_FLAGS_DISABLE_WEBGL_NAME,
406 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56407 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01408#if defined(OS_ANDROID)
409 SINGLE_VALUE_TYPE("")
410#else
[email protected]deaba6d52011-09-23 14:47:12411 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01412#endif
[email protected]deaba6d52011-09-23 14:47:12413 },
[email protected]09096e02012-05-24 11:12:04414 {
[email protected]d9da9582013-01-31 04:59:05415 "enable-webrtc",
416 IDS_FLAGS_ENABLE_WEBRTC_NAME,
417 IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION,
418 kOsAndroid,
419#if defined(OS_ANDROID)
420 SINGLE_VALUE_TYPE(switches::kEnableWebRTC)
421#else
422 SINGLE_VALUE_TYPE("")
423#endif
424 },
425 {
[email protected]96bcdc102012-05-24 23:42:10426 "fixed-position-creates-stacking-context",
427 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
428 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
429 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44430 ENABLE_DISABLE_VALUE_TYPE(
431 switches::kEnableFixedPositionCreatesStackingContext,
432 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10433 },
[email protected]fb854192013-02-06 01:30:04434 {
435 "enable-compositing-for-fixed-position",
436 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
437 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
438 kOsAll,
439 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
440 },
[email protected]a7640ef22012-10-06 00:52:08441 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53442 {
[email protected]e3791ce92011-08-09 01:03:32443 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40444 IDS_FLAGS_ENABLE_NACL_NAME,
445 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56446 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19447 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40448 },
[email protected]b39c6d92012-01-31 16:38:41449 // TODO(halyavin): When exception handling is on by default, replace this
450 // flag with disable-nacl-exception-handling.
451 {
452 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
453 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
454 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56455 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41456 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
457 },
[email protected]4ff87d202010-11-06 01:28:40458 {
[email protected]9addd1c2012-09-15 14:28:24459 "enable-nacl-debug", // FLAGS:RECORD_UMA
460 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
461 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56462 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24463 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13464 },
465 {
[email protected]66f409c2012-10-04 20:59:04466 "nacl-debug-mask", // FLAGS:RECORD_UMA
467 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
468 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56469 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04470 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
471 },
472 {
[email protected]7babd1c2012-08-08 20:35:29473 "enable-pnacl", // FLAGS:RECORD_UMA
474 IDS_FLAGS_ENABLE_PNACL_NAME,
475 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56476 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29477 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
478 },
479 {
[email protected]4bc5050c2010-11-18 17:55:54480 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32481 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
482 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56483 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19484 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32485 },
[email protected]3627b06d2010-11-12 16:36:16486 {
[email protected]544471a2012-10-13 05:27:09487 "action-box",
[email protected]cab18ef2012-04-27 07:22:03488 IDS_FLAGS_ACTION_BOX_NAME,
489 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56490 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44491 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
492 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03493 },
494 {
[email protected]3a362432012-06-18 20:39:51495 "script-badges",
496 IDS_FLAGS_SCRIPT_BADGES_NAME,
497 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56498 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09499 SINGLE_VALUE_TYPE(switches::kScriptBadges)
500 },
501 {
502 "script-bubble",
503 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
504 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56505 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44506 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
507 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51508 },
509 {
[email protected]cbe224d2011-08-04 22:12:49510 "apps-new-install-bubble",
511 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
512 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56513 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49514 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
515 },
516 {
[email protected]80bd24e2010-11-30 09:34:38517 "disable-hyperlink-auditing",
518 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
519 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
520 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19521 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51522 },
523 {
524 "experimental-location-features", // FLAGS:RECORD_UMA
525 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
526 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
527 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19528 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
529 },
530 {
[email protected]5aea1862011-03-23 23:55:39531 "tab-groups-context-menu",
532 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
533 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
534 kOsWin,
535 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
536 },
[email protected]c94cebd2012-06-21 00:55:28537 {
538 "enable-instant-extended-api",
539 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
540 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56541 kOsDesktop,
[email protected]73444382013-02-26 19:31:51542 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
543 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28544 },
[email protected]e9bf9d92011-03-31 20:57:15545 {
[email protected]354e33b2011-06-15 00:29:10546 "static-ip-config",
547 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
548 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
549 kOsCrOS,
550#if defined(OS_CHROMEOS)
551 // This switch exists only on Chrome OS.
552 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
553#else
554 SINGLE_VALUE_TYPE("")
555#endif
556 },
[email protected]3eb5728c2011-06-20 22:32:24557 {
558 "show-autofill-type-predictions",
559 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
560 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
561 kOsAll,
562 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
563 },
[email protected]bff4d3e2011-06-21 23:58:52564 {
[email protected]fdf4e252012-04-27 00:26:55565 "sync-tab-favicons",
566 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
567 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
568 kOsAll,
569 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
570 },
571 {
[email protected]5d90a0a2012-11-15 02:43:40572 "sync-keystore-encryption",
573 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
574 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
575 kOsAll,
576 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
577 },
578 {
[email protected]e755a382012-09-13 17:16:35579 "enable-gesture-tap-highlight",
580 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
581 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
582 kOsLinux | kOsCrOS,
583 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
584 },
585 {
[email protected]a22ebd812011-06-23 00:05:39586 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
587 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
588 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
589 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40590 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25591 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39592 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
593 },
[email protected]81a6b0b2011-06-24 17:55:40594 {
[email protected]68317802012-06-07 19:13:23595 "omnibox-history-quick-provider-new-scoring",
596 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
597 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
598 kOsAll,
599 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
600 },
601 {
[email protected]128dc6c2012-06-22 20:30:35602 "omnibox-history-quick-provider-reorder-for-inlining",
603 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
604 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
605 kOsAll,
606 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
607 },
608 {
[email protected]032d5e6c2012-02-17 17:53:55609 "omnibox-inline-history-quick-provider",
610 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
611 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
612 kOsAll,
613 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
614 },
615 {
[email protected]7e7a28092011-12-09 22:24:55616 "enable-panels",
617 IDS_FLAGS_ENABLE_PANELS_NAME,
618 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56619 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55620 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54621 },
[email protected]e3749d12011-07-25 22:22:12622 {
[email protected]27c14f02012-06-22 17:29:58623 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27624 "save-page-as-mhtml", // FLAGS:RECORD_UMA
625 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
626 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
627 kOsMac | kOsWin | kOsLinux,
628 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
629 },
630 {
[email protected]b7bb44f2011-09-01 05:17:03631 "enable-autologin",
632 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
633 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
634 kOsMac | kOsWin | kOsLinux,
635 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
636 },
[email protected]b9841172011-09-26 23:36:09637 {
[email protected]3231b612012-03-23 05:57:54638 "enable-spdy3",
639 IDS_FLAGS_ENABLE_SPDY3_NAME,
640 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
641 kOsAll,
642 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
643 },
644 {
[email protected]27b3fe92012-03-21 05:35:06645 "enable-async-dns",
646 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
647 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46648 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44649 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
650 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06651 },
652 {
[email protected]1eb93802012-09-11 18:57:56653 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11654 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
655 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32656 kOsAll,
[email protected]da43c082012-09-07 18:56:11657 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44658 },
[email protected]e4e68dbb2011-11-18 01:50:22659 {
[email protected]36d98412013-01-31 20:28:53660 "disable-encrypted-media",
661 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
662 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56663 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53664 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03665 },
[email protected]f88628792012-12-18 07:07:50666 {
667 "enable-opus-playback",
668 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
669 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56670 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50671 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
672 },
[email protected]ca6eaa5a2013-01-24 16:16:04673 {
[email protected]c54e1aa2013-01-25 09:26:17674 "enable-vp9-playback",
675 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
676 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
677 kOsDesktop,
678 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
679 },
680 {
[email protected]ca6eaa5a2013-01-24 16:16:04681 "enable-managed-users",
682 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
683 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
684 kOsAll,
685 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
686 },
[email protected]dc04be7c2012-03-15 23:57:49687#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50688 {
[email protected]cda278d2012-10-30 20:31:40689 "ash-disable-auto-window-placement",
690 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
691 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
692 kOsWin | kOsLinux | kOsCrOS,
693 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
694 },
[email protected]b4e4ec42012-11-29 21:42:40695 {
[email protected]16f55a22013-02-13 23:47:34696 "ash-disable-per-app-launcher",
697 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
698 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40699 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34700 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40701 },
[email protected]1c92d8622013-03-06 13:06:13702 {
703 "ash-enable-full-browser-list-in-launcher",
704 IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_NAME,
705 IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_DESCRIPTION,
706 kOsWin | kOsLinux | kOsCrOS,
707 SINGLE_VALUE_TYPE(ash::switches::kAshEnableFullBrowserListInLauncher)
708 },
[email protected]dc04be7c2012-03-15 23:57:49709#endif
[email protected]eaae8b462012-01-20 22:20:39710 {
[email protected]db543d322011-12-15 20:40:15711 "per-tile-painting",
712 IDS_FLAGS_PER_TILE_PAINTING_NAME,
713 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37714 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37715 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15716 },
[email protected]bf88c032011-12-22 19:05:47717 {
718 "enable-javascript-harmony",
719 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
720 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
721 kOsAll,
722 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
723 },
[email protected]7e7f378a2012-01-05 14:35:37724 {
[email protected]85646172012-01-09 22:45:54725 "enable-tab-browser-dragging",
726 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
727 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
728 kOsWin,
729 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
730 },
731 {
[email protected]068b7b52012-02-27 12:41:44732 "disable-restore-session-state",
733 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
734 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37735 kOsAll,
[email protected]068b7b52012-02-27 12:41:44736 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37737 },
[email protected]88864db2012-01-18 20:56:35738 {
739 "disable-software-rasterizer",
740 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
741 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
742#if defined(ENABLE_SWIFTSHADER)
743 kOsAll,
744#else
745 0,
746#endif
747 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
748 },
[email protected]15a5d722012-01-23 09:11:14749 {
[email protected]ff7b6dd2012-09-15 20:20:03750 "enable-experimental-webkit-features",
751 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
752 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16753 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03754 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49755 },
756 {
[email protected]0f95a252012-09-13 22:30:04757 "enable-css-shaders",
758 IDS_FLAGS_CSS_SHADERS_NAME,
759 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
762 },
763 {
[email protected]9860c68b2012-02-02 01:58:09764 "enable-extension-activity-ui",
765 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
766 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56767 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09768 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00769 },
[email protected]54ae4e92012-02-16 15:19:05770 {
[email protected]3e8befc2012-03-13 01:17:03771 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16772 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
773 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56774 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03775 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16776 },
[email protected]dc04be7c2012-03-15 23:57:49777#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01778 {
[email protected]3cd198a22012-03-12 20:38:01779 "enable-ash-oak",
780 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
781 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
782 kOsAll,
783 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
784 },
[email protected]31cf1c52012-02-29 20:55:01785#endif
[email protected]184ec592012-03-01 11:54:28786 {
787 "enable-devtools-experiments",
788 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
789 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56790 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28791 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
792 },
[email protected]76d1854e2012-03-02 23:57:44793 {
[email protected]2fefdb32013-02-26 14:28:10794 "silent-debugger-extension-api",
795 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
796 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
797 kOsDesktop,
798 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
799 },
800 {
[email protected]76d1854e2012-03-02 23:57:44801 "enable-suggestions-ntp",
802 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
803 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56804 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44805 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
806 },
[email protected]a3d54252012-04-05 20:04:13807 {
[email protected]1dbaf5e2012-11-30 05:51:32808 "spellcheck-autocorrect",
809 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
810 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
811 kOsWin | kOsLinux | kOsCrOS,
812 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
813 },
814 {
[email protected]d7932532012-11-21 21:10:31815 "touch-events",
816 IDS_TOUCH_EVENTS_NAME,
817 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56818 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31819 MULTI_VALUE_TYPE(kTouchEventsChoices)
820 },
821 {
[email protected]c9c73ad42012-04-18 03:35:59822 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06823 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
824 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55825 kOsWin,
[email protected]347a0c72012-05-14 20:28:06826 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59827 },
[email protected]8a6aaa72012-04-20 20:53:58828 {
[email protected]b9c96ff2012-11-26 22:24:40829 "disable-touch-adjustment",
830 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
831 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
832 kOsWin | kOsLinux | kOsCrOS,
833 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
834 },
835 {
[email protected]0b9383a2012-10-26 00:58:16836 "enable-tab-capture",
837 IDS_ENABLE_TAB_CAPTURE_NAME,
838 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25839 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44840 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
841 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16842 },
[email protected]0b60afa2012-04-19 17:36:39843#if defined(OS_CHROMEOS)
844 {
[email protected]7c4a9bc2012-09-11 22:10:05845 "enable-background-loader",
846 IDS_ENABLE_BACKLOADER_NAME,
847 IDS_ENABLE_BACKLOADER_DESCRIPTION,
848 kOsCrOS,
849 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
850 },
851 {
[email protected]c5667b282012-08-31 00:32:50852 "enable-bezel-touch",
853 IDS_ENABLE_BEZEL_TOUCH_NAME,
854 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47855 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50856 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47857 },
858 {
[email protected]3f4181a2013-02-01 21:31:07859 "enable-screensaver-extension",
860 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
861 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
862 kOsCrOS,
863 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
864 },
865 {
[email protected]0b60afa2012-04-19 17:36:39866 "no-discard-tabs",
867 IDS_FLAGS_NO_DISCARD_TABS_NAME,
868 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
869 kOsCrOS,
870 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
871 },
872#endif
[email protected]79be6d32012-04-24 20:47:44873 {
[email protected]8d68a3e02013-01-12 15:57:10874 "enable-download-resumption",
875 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
876 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56877 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10878 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
879 },
880 {
[email protected]9a5940d2012-04-27 19:16:23881 "allow-nacl-socket-api",
882 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
883 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56884 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23885 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
886 },
[email protected]85333732012-05-01 19:02:24887 {
[email protected]60673ad72012-05-02 06:16:33888 "stacked-tab-strip",
889 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
890 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
891 kOsWin,
892 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
893 },
894 {
[email protected]4bd20202012-06-14 17:35:01895 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24896 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
897 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
898 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01899 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24900 },
[email protected]190349fd2012-05-02 00:10:47901#if defined(OS_CHROMEOS)
902 {
903 "allow-touchpad-three-finger-click",
904 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
905 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
906 kOsCrOS,
907 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
908 },
[email protected]fbc176b62012-10-27 02:19:58909 {
910 "allow-touchpad-three-finger-swipe",
911 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
912 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
913 kOsCrOS,
914 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
915 },
[email protected]190349fd2012-05-02 00:10:47916#endif
[email protected]1992a2f42012-10-23 18:32:21917 {
[email protected]a585e462013-01-26 00:37:15918 "use-client-login-signin-flow",
919 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
920 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21921 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15922 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21923 },
[email protected]8ee02242012-12-04 15:23:32924 {
925 "enable-desktop-guest-mode",
926 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
927 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
928 kOsMac | kOsWin | kOsLinux,
929 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
930 },
[email protected]53520b1b2012-05-07 21:43:37931#if defined(USE_ASH)
932 {
[email protected]fac380e02013-03-08 20:06:30933 "hide-launcher-alignment-menu",
934 IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_NAME,
935 IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42936 kOsAll,
[email protected]fac380e02013-03-08 20:06:30937 SINGLE_VALUE_TYPE(switches::kHideLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42938 },
939 {
[email protected]73074742012-05-17 01:44:41940 "show-touch-hud",
941 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
942 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
943 kOsAll,
944 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
945 },
946 {
[email protected]9f0940b62012-05-23 22:56:35947 "enable-pinch",
948 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
949 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06950 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35951 SINGLE_VALUE_TYPE(switches::kEnablePinch),
952 },
[email protected]a8379312012-06-15 00:20:43953 {
954 "app-list-show-apps-only",
955 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
956 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
957 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03958 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43959 },
[email protected]73074742012-05-17 01:44:41960#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28961#if defined(OS_CHROMEOS)
962 {
[email protected]8b04a1652012-08-04 02:59:49963 "disable-boot-animation",
964 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
965 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
966 kOsCrOS,
967 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
968 },
[email protected]95058572012-08-20 14:57:29969 {
[email protected]b4557192012-09-19 11:29:58970 "disable-boot-animation2",
971 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
972 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
973 kOsCrOS,
974 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
975 },
976 {
[email protected]ea2f3342012-09-21 21:13:36977 "boot-animation-fucntion",
978 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
979 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
980 kOsCrOS,
981 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
982 },
[email protected]839667d62012-10-23 19:38:57983 {
[email protected]d96aef22012-10-30 11:47:02984 "captive-portal-detector",
985 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
986 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
987 kOsCrOS,
988 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
989 },
990 {
[email protected]c11aa8f12012-12-18 18:43:14991 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57992 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
993 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
994 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14995 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57996 },
[email protected]f0280952012-11-06 20:30:50997 {
[email protected]0fb5c4852012-11-08 20:33:23998 "file-manager-packaged",
999 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1000 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1001 kOsCrOS,
1002 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1003 },
[email protected]3e035e82012-11-27 20:54:321004 {
[email protected]8039e06c2013-01-17 23:34:501005 "disable-launcher-per-display",
1006 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1007 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351008 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501009 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351010 },
[email protected]06b146d2013-02-07 06:06:471011 {
1012 "enable-app-mode",
1013 IDS_FLAGS_ENABLE_KIOSK_APPS_NAME,
1014 IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION,
1015 kOsCrOS,
1016 SINGLE_VALUE_TYPE(switches::kEnableAppMode),
1017 },
[email protected]6ad015c2013-03-06 00:49:511018 {
1019 "force-fullscreen-app",
1020 IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME,
1021 IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION,
1022 kOsCrOS,
1023 SINGLE_VALUE_TYPE(switches::kForceFullscreenApp),
1024 },
[email protected]a78c7432013-03-13 06:22:431025 {
1026 "ash-internal-display-ui-scale",
1027 IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_NAME,
1028 IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_DESCRIPTION,
1029 kOsCrOS,
1030 MULTI_VALUE_TYPE(kAshInternalDisplayUIScaleChoices)
1031 },
[email protected]62018dc2012-12-13 00:37:351032#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391033 {
[email protected]6247aba2013-03-04 22:57:181034 "views-textfield",
1035 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1036 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391037 kOsWin,
[email protected]6247aba2013-03-04 22:57:181038 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1039 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391040 },
[email protected]bd0cd3bb2012-06-14 03:03:381041 {
[email protected]2d4817742012-12-17 20:16:181042 "enable-new-dialog-style",
1043 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1044 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321045 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181046 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321047 },
[email protected]7db8893a2012-07-26 00:49:401048 { "disable-accelerated-video-decode",
1049 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1050 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561051 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401052 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151053 },
[email protected]66ae9fc2012-06-19 21:33:521054#if defined(USE_ASH)
1055 {
1056 "ash-debug-shortcuts",
1057 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1058 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1059 kOsAll,
1060 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1061 },
1062#endif
[email protected]37fee0942012-08-07 21:07:451063 {
[email protected]ad3f6d22012-08-29 02:34:191064 "enable-contacts",
1065 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1066 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1067 kOsCrOS,
1068 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1069 },
[email protected]1d9bb9cd2012-08-28 22:02:501070#if defined(USE_ASH)
1071 { "ash-enable-advanced-gestures",
1072 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1073 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1074 kOsCrOS,
1075 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1076 },
[email protected]cfa24e62013-02-13 21:19:111077 { "ash-disable-tab-scrubbing",
1078 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1079 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161080 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111081 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161082 },
[email protected]83eef802012-12-02 07:43:521083 { "ash-enable-workspace-scrubbing",
1084 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1085 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1086 kOsCrOS,
1087 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1088 },
[email protected]8c426dc2013-03-06 01:30:121089 { "ash-disable-immersive-mode",
1090 IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_NAME,
1091 IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241092 kOsCrOS,
[email protected]8c426dc2013-03-06 01:30:121093 SINGLE_VALUE_TYPE(ash::switches::kAshDisableImmersiveMode),
[email protected]c043df272012-11-21 00:43:241094 },
[email protected]316708a2012-11-05 22:57:021095#if defined(OS_LINUX)
1096 { "ash-enable-memory-monitor",
1097 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1098 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1099 kOsCrOS,
1100 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1101 },
1102#endif
[email protected]1d9bb9cd2012-08-28 22:02:501103#endif
[email protected]9b7ab882012-09-10 23:46:361104#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091105 { "ash-disable-new-network-status-area",
1106 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1107 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461108 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091109 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461110 },
[email protected]9b7ab882012-09-10 23:46:361111 {
[email protected]205f07892012-10-16 20:26:221112 "enable-carrier-switching",
1113 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1114 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1115 kOsCrOS,
1116 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1117 },
1118 {
[email protected]9b7ab882012-09-10 23:46:361119 "enable-request-tablet-site",
1120 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1121 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1122 kOsCrOS,
1123 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1124 },
1125#endif
[email protected]dab49c0b2012-10-04 05:55:351126 {
1127 "debug-packed-apps",
1128 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1129 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561130 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351131 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1132 },
[email protected]d1459ed2012-10-10 01:29:331133 {
1134 "enable-password-generation",
1135 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1136 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561137 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331138 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1139 },
[email protected]26d045f2012-10-18 21:18:431140 {
[email protected]76f7d4882012-10-26 21:09:221141 "enable-deferred-image-decoding",
1142 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1143 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221144 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221145 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1146 },
1147 {
[email protected]075543d2012-10-24 01:29:141148 "performance-monitor-gathering",
1149 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1150 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1151 kOsAll,
1152 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1153 },
[email protected]783d5bb2012-10-24 03:47:141154 {
[email protected]b58d5a02013-03-06 04:33:531155 "enable-native-autofill-ui",
1156 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME,
1157 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561158 kOsDesktop,
[email protected]b58d5a02013-03-06 04:33:531159 SINGLE_VALUE_TYPE(switches::kEnableNativeAutofillUi)
[email protected]0572fb2e2012-11-03 00:38:591160 },
1161 {
[email protected]99002fd2012-11-06 04:35:521162 "show-app-list-shortcut",
1163 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1164 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1165 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431166 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521167 },
[email protected]a7259fb2012-11-08 06:22:231168 {
1169 "enable-experimental-form-filling",
1170 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1171 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1172 kOsWin | kOsCrOS,
1173 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1174 },
[email protected]6e6efe42013-01-30 00:04:501175 {
1176 "enable-interactive-autocomplete",
1177 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1178 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221179 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501180 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1181 },
[email protected]e42b1f82012-11-16 21:18:461182#if defined(USE_AURA)
1183 {
[email protected]b75ba132013-02-26 19:38:311184 "disable-overscroll-history-navigation",
1185 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1186 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461187 kOsAll,
[email protected]b75ba132013-02-26 19:38:311188 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461189 },
1190#endif
[email protected]edbea622012-11-28 20:39:381191 {
1192 "enable-touch-drag-drop",
1193 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1194 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1195 kOsWin | kOsCrOS,
1196 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1197 },
[email protected]0e2f43b62013-02-21 00:47:151198 {
1199 "enable-touch-editing",
1200 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1201 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1202 kOsCrOS,
1203 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1204 },
[email protected]f1c39242013-01-29 16:13:011205#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201206 {
1207 "enable-rich-notifications",
1208 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1209 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1210 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011211 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201212 },
[email protected]f1c39242013-01-29 16:13:011213#endif
[email protected]4d51c682012-12-11 11:34:551214 {
1215 "full-history-sync",
1216 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1217 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1218 kOsAll,
1219 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1220 },
[email protected]628a69a92012-12-23 04:09:341221 {
[email protected]fd030142013-02-08 02:04:381222 "enable-usermedia-screen-capture",
1223 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1224 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1225 kOsDesktop,
1226 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1227 },
[email protected]5b93e162013-02-19 06:33:091228 {
1229 "enable-apps-devtool-app",
1230 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1231 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1232 kOsDesktop,
1233 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1234 },
[email protected]9323fdd12013-02-23 00:31:361235 {
1236 "impl-side-painting",
1237 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1238 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
1239 kOsAndroid,
1240 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1241 },
[email protected]2f2f72b2013-03-08 22:37:311242 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1243#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371244 {
1245 "track-active-visit-time",
1246 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1247 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1248 kOsWin,
1249 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1250 },
[email protected]2f2f72b2013-03-08 22:37:311251#endif
[email protected]8cc71d42013-03-02 17:26:081252#if defined(OS_ANDROID)
1253 {
1254 "disable-gesture-requirement-for-media-playback",
1255 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1256 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1257 kOsAndroid,
1258 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1259 },
1260#endif
[email protected]e79f2fd52013-03-08 23:52:471261#if defined(OS_CHROMEOS)
1262 {
1263 "enable-experimental-bluetooth",
1264 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1265 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1266 kOsCrOS,
1267 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1268 },
1269#endif
[email protected]6077cab2013-03-11 19:36:141270#if defined(ENABLE_GOOGLE_NOW)
1271 {
1272 "enable-google-now",
1273 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1274 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1275 kOsWin | kOsCrOS,
1276 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1277 },
1278#endif
[email protected]a0e4b072011-08-17 01:47:071279};
[email protected]ad2a3ded2010-08-27 13:19:051280
[email protected]a314ee5a2010-10-26 21:23:281281const Experiment* experiments = kExperiments;
1282size_t num_experiments = arraysize(kExperiments);
1283
[email protected]e2ddbc92010-10-15 20:02:071284// Stores and encapsulates the little state that about:flags has.
1285class FlagsState {
1286 public:
1287 FlagsState() : needs_restart_(false) {}
1288 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1289 bool IsRestartNeededToCommitChanges();
1290 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281291 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071292 void RemoveFlagsSwitches(
1293 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001294 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071295 void reset();
1296
1297 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551298 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071299 return Singleton<FlagsState>::get();
1300 }
1301
1302 private:
1303 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531304 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071305
1306 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1307};
1308
[email protected]c7b7800a2010-10-07 18:51:351309// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491310// in a set.
[email protected]1a47d7e2010-10-15 00:37:241311void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051312 const ListValue* enabled_experiments = prefs->GetList(
1313 prefs::kEnabledLabsExperiments);
1314 if (!enabled_experiments)
1315 return;
1316
1317 for (ListValue::const_iterator it = enabled_experiments->begin();
1318 it != enabled_experiments->end();
1319 ++it) {
1320 std::string experiment_name;
1321 if (!(*it)->GetAsString(&experiment_name)) {
1322 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1323 continue;
1324 }
1325 result->insert(experiment_name);
1326 }
1327}
1328
[email protected]c6343372013-03-13 17:05:491329// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241330void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051331 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381332 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1333 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051334
1335 experiments_list->Clear();
1336 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1337 it != enabled_experiments.end();
1338 ++it) {
1339 experiments_list->Append(new StringValue(*it));
1340 }
1341}
1342
[email protected]8a6ff28d2010-12-02 16:35:191343// Adds the internal names for the specified experiment to |names|.
1344void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1345 if (e.type == Experiment::SINGLE_VALUE) {
1346 names->insert(e.internal_name);
1347 } else {
[email protected]83e9fa702013-02-25 19:30:441348 DCHECK(e.type == Experiment::MULTI_VALUE ||
1349 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191350 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441351 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191352 }
1353}
1354
[email protected]28e35af2011-02-09 12:56:221355// Confirms that an experiment is valid, used in a DCHECK in
1356// SanitizeList below.
1357bool ValidateExperiment(const Experiment& e) {
1358 switch (e.type) {
1359 case Experiment::SINGLE_VALUE:
1360 DCHECK_EQ(0, e.num_choices);
1361 DCHECK(!e.choices);
1362 break;
1363 case Experiment::MULTI_VALUE:
1364 DCHECK_GT(e.num_choices, 0);
1365 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531366 DCHECK(e.choices[0].command_line_switch);
1367 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221368 break;
[email protected]83e9fa702013-02-25 19:30:441369 case Experiment::ENABLE_DISABLE_VALUE:
1370 DCHECK_EQ(3, e.num_choices);
1371 DCHECK(!e.choices);
1372 DCHECK(e.command_line_switch);
1373 DCHECK(e.command_line_value);
1374 DCHECK(e.disable_command_line_switch);
1375 DCHECK(e.disable_command_line_value);
1376 break;
[email protected]28e35af2011-02-09 12:56:221377 default:
1378 NOTREACHED();
1379 }
1380 return true;
1381}
1382
[email protected]ad2a3ded2010-08-27 13:19:051383// Removes all experiments from prefs::kEnabledLabsExperiments that are
1384// unknown, to prevent this list to become very long as experiments are added
1385// and removed.
1386void SanitizeList(PrefService* prefs) {
1387 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221388 for (size_t i = 0; i < num_experiments; ++i) {
1389 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191390 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221391 }
[email protected]ad2a3ded2010-08-27 13:19:051392
1393 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241394 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051395
1396 std::set<std::string> new_enabled_experiments;
1397 std::set_intersection(
1398 known_experiments.begin(), known_experiments.end(),
1399 enabled_experiments.begin(), enabled_experiments.end(),
1400 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1401
[email protected]4c8853f2012-07-23 01:29:161402 if (new_enabled_experiments != enabled_experiments)
1403 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051404}
1405
[email protected]1a47d7e2010-10-15 00:37:241406void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051407 PrefService* prefs, std::set<std::string>* result) {
1408 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241409 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051410}
1411
[email protected]a314ee5a2010-10-26 21:23:281412// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1413// enabled on the current platform.
1414void GetSanitizedEnabledFlagsForCurrentPlatform(
1415 PrefService* prefs, std::set<std::string>* result) {
1416 GetSanitizedEnabledFlags(prefs, result);
1417
1418 // Filter out any experiments that aren't enabled on the current platform. We
1419 // don't remove these from prefs else syncing to a platform with a different
1420 // set of experiments would be lossy.
1421 std::set<std::string> platform_experiments;
1422 int current_platform = GetCurrentPlatform();
1423 for (size_t i = 0; i < num_experiments; ++i) {
1424 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191425 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281426 }
1427
1428 std::set<std::string> new_enabled_experiments;
1429 std::set_intersection(
1430 platform_experiments.begin(), platform_experiments.end(),
1431 result->begin(), result->end(),
1432 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1433
1434 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051435}
1436
[email protected]8a6ff28d2010-12-02 16:35:191437// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191438Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221439 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441440 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1441 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191442 ListValue* result = new ListValue;
1443 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191444 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441445 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191446 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441447 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221448 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191449 result->Append(value);
1450 }
1451 return result;
1452}
1453
[email protected]e2ddbc92010-10-15 20:02:071454} // namespace
1455
[email protected]83e9fa702013-02-25 19:30:441456std::string Experiment::NameForChoice(int index) const {
1457 DCHECK(type == Experiment::MULTI_VALUE ||
1458 type == Experiment::ENABLE_DISABLE_VALUE);
1459 DCHECK_LT(index, num_choices);
1460 return std::string(internal_name) + testing::kMultiSeparator +
1461 base::IntToString(index);
1462}
1463
1464string16 Experiment::DescriptionForChoice(int index) const {
1465 DCHECK(type == Experiment::MULTI_VALUE ||
1466 type == Experiment::ENABLE_DISABLE_VALUE);
1467 DCHECK_LT(index, num_choices);
1468 int description_id;
1469 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1470 const int kEnableDisableDescriptionIds[] = {
1471 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1472 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1473 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1474 };
1475 description_id = kEnableDisableDescriptionIds[index];
1476 } else {
1477 description_id = choices[index].description_id;
1478 }
1479 return l10n_util::GetStringUTF16(description_id);
1480}
1481
[email protected]1a47d7e2010-10-15 00:37:241482void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551483 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051484}
1485
[email protected]1a47d7e2010-10-15 00:37:241486ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051487 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241488 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051489
1490 int current_platform = GetCurrentPlatform();
1491
1492 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281493 for (size_t i = 0; i < num_experiments; ++i) {
1494 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051495
1496 DictionaryValue* data = new DictionaryValue();
1497 data->SetString("internal_name", experiment.internal_name);
1498 data->SetString("name",
1499 l10n_util::GetStringUTF16(experiment.visible_name_id));
1500 data->SetString("description",
1501 l10n_util::GetStringUTF16(
1502 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401503 bool supported = !!(experiment.supported_platforms & current_platform);
1504 data->SetBoolean("supported", supported);
1505
1506 ListValue* supported_platforms = new ListValue();
1507 AddOsStrings(experiment.supported_platforms, supported_platforms);
1508 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051509
[email protected]28e35af2011-02-09 12:56:221510 switch (experiment.type) {
1511 case Experiment::SINGLE_VALUE:
1512 data->SetBoolean(
1513 "enabled",
1514 enabled_experiments.count(experiment.internal_name) > 0);
1515 break;
1516 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441517 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221518 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1519 break;
1520 default:
1521 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191522 }
1523
[email protected]ad2a3ded2010-08-27 13:19:051524 experiments_data->Append(data);
1525 }
1526 return experiments_data;
1527}
1528
[email protected]ad2a3ded2010-08-27 13:19:051529bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551530 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051531}
1532
1533void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351534 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551535 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071536}
1537
1538void RemoveFlagsSwitches(
1539 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551540 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071541}
1542
[email protected]cb93bf52013-02-20 01:20:001543void ResetAllFlags(PrefService* prefs) {
1544 FlagsState::GetInstance()->ResetAllFlags(prefs);
1545}
1546
[email protected]a314ee5a2010-10-26 21:23:281547int GetCurrentPlatform() {
1548#if defined(OS_MACOSX)
1549 return kOsMac;
1550#elif defined(OS_WIN)
1551 return kOsWin;
1552#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1553 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211554#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281555 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401556#elif defined(OS_ANDROID)
1557 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281558#else
1559#error Unknown platform
1560#endif
1561}
1562
[email protected]4bc5050c2010-11-18 17:55:541563void RecordUMAStatistics(const PrefService* prefs) {
1564 std::set<std::string> flags;
1565 GetEnabledFlags(prefs, &flags);
1566 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1567 ++it) {
1568 std::string action("AboutFlags_");
1569 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381570 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541571 }
1572 // Since flag metrics are recorded every startup, add a tick so that the
1573 // stats can be made meaningful.
1574 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381575 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1576 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541577}
1578
[email protected]e2ddbc92010-10-15 20:02:071579//////////////////////////////////////////////////////////////////////////////
1580// FlagsState implementation.
1581
1582namespace {
1583
[email protected]83e9fa702013-02-25 19:30:441584typedef std::map<std::string, std::pair<std::string, std::string> >
1585 NameToSwitchAndValueMap;
1586
1587void SetFlagToSwitchMapping(const std::string& key,
1588 const std::string& switch_name,
1589 const std::string& switch_value,
1590 NameToSwitchAndValueMap* name_to_switch_map) {
1591 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1592 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1593}
1594
[email protected]e2ddbc92010-10-15 20:02:071595void FlagsState::ConvertFlagsToSwitches(
1596 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071597 if (command_line->HasSwitch(switches::kNoExperiments))
1598 return;
1599
1600 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001601
[email protected]a314ee5a2010-10-26 21:23:281602 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071603
[email protected]a82744532011-02-11 16:15:531604 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191605 for (size_t i = 0; i < num_experiments; ++i) {
1606 const Experiment& e = experiments[i];
1607 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441608 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1609 e.command_line_value, &name_to_switch_map);
1610 } else if (e.type == Experiment::MULTI_VALUE) {
1611 for (int j = 0; j < e.num_choices; ++j) {
1612 SetFlagToSwitchMapping(e.NameForChoice(j),
1613 e.choices[j].command_line_switch,
1614 e.choices[j].command_line_value,
1615 &name_to_switch_map);
1616 }
[email protected]8a6ff28d2010-12-02 16:35:191617 } else {
[email protected]83e9fa702013-02-25 19:30:441618 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1619 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1620 &name_to_switch_map);
1621 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1622 e.command_line_value, &name_to_switch_map);
1623 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1624 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191625 }
1626 }
[email protected]e2ddbc92010-10-15 20:02:071627
1628 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531629 flags_switches_.insert(
1630 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1631 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071632 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1633 it != enabled_experiments.end();
1634 ++it) {
1635 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531636 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191637 name_to_switch_map.find(experiment_name);
1638 if (name_to_switch_it == name_to_switch_map.end()) {
1639 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071640 continue;
[email protected]8a6ff28d2010-12-02 16:35:191641 }
[email protected]e2ddbc92010-10-15 20:02:071642
[email protected]a82744532011-02-11 16:15:531643 const std::pair<std::string, std::string>&
1644 switch_and_value_pair = name_to_switch_it->second;
1645
1646 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1647 switch_and_value_pair.second);
1648 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071649 }
1650 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531651 flags_switches_.insert(
1652 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1653 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071654}
1655
1656bool FlagsState::IsRestartNeededToCommitChanges() {
1657 return needs_restart_;
1658}
1659
1660void FlagsState::SetExperimentEnabled(
1661 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051662 needs_restart_ = true;
1663
[email protected]83e9fa702013-02-25 19:30:441664 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191665 if (at_index != std::string::npos) {
1666 DCHECK(enable);
1667 // We're being asked to enable a multi-choice experiment. Disable the
1668 // currently selected choice.
1669 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221670 const std::string experiment_name = internal_name.substr(0, at_index);
1671 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191672
[email protected]28e35af2011-02-09 12:56:221673 // And enable the new choice, if it is not the default first choice.
1674 if (internal_name != experiment_name + "@0") {
1675 std::set<std::string> enabled_experiments;
1676 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1677 enabled_experiments.insert(internal_name);
1678 SetEnabledFlags(prefs, enabled_experiments);
1679 }
[email protected]8a6ff28d2010-12-02 16:35:191680 return;
1681 }
1682
[email protected]ad2a3ded2010-08-27 13:19:051683 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241684 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051685
[email protected]8a6ff28d2010-12-02 16:35:191686 const Experiment* e = NULL;
1687 for (size_t i = 0; i < num_experiments; ++i) {
1688 if (experiments[i].internal_name == internal_name) {
1689 e = experiments + i;
1690 break;
1691 }
1692 }
1693 DCHECK(e);
1694
1695 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591696 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191697 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591698 else
[email protected]8a6ff28d2010-12-02 16:35:191699 enabled_experiments.erase(internal_name);
1700 } else {
1701 if (enable) {
1702 // Enable the first choice.
[email protected]83e9fa702013-02-25 19:30:441703 enabled_experiments.insert(e->NameForChoice(0));
[email protected]8a6ff28d2010-12-02 16:35:191704 } else {
1705 // Find the currently enabled choice and disable it.
1706 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441707 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191708 if (enabled_experiments.find(choice_name) !=
1709 enabled_experiments.end()) {
1710 enabled_experiments.erase(choice_name);
1711 // Continue on just in case there's a bug and more than one
1712 // experiment for this choice was enabled.
1713 }
1714 }
1715 }
1716 }
[email protected]ad2a3ded2010-08-27 13:19:051717
[email protected]1a47d7e2010-10-15 00:37:241718 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051719}
1720
[email protected]e2ddbc92010-10-15 20:02:071721void FlagsState::RemoveFlagsSwitches(
1722 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531723 for (std::map<std::string, std::string>::const_iterator
1724 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1725 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071726 }
1727}
1728
[email protected]cb93bf52013-02-20 01:20:001729void FlagsState::ResetAllFlags(PrefService* prefs) {
1730 needs_restart_ = true;
1731
1732 std::set<std::string> no_experiments;
1733 SetEnabledFlags(prefs, no_experiments);
1734}
1735
[email protected]e2ddbc92010-10-15 20:02:071736void FlagsState::reset() {
1737 needs_restart_ = false;
1738 flags_switches_.clear();
1739}
1740
[email protected]38e46812011-05-09 20:49:221741} // namespace
[email protected]e2ddbc92010-10-15 20:02:071742
1743namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191744
1745// WARNING: '@' is also used in the html file. If you update this constant you
1746// also need to update the html file.
1747const char kMultiSeparator[] = "@";
1748
[email protected]e2ddbc92010-10-15 20:02:071749void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551750 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071751}
[email protected]a314ee5a2010-10-26 21:23:281752
1753void SetExperiments(const Experiment* e, size_t count) {
1754 if (!e) {
1755 experiments = kExperiments;
1756 num_experiments = arraysize(kExperiments);
1757 } else {
1758 experiments = e;
1759 num_experiments = count;
1760 }
1761}
1762
[email protected]8a6ff28d2010-12-02 16:35:191763const Experiment* GetExperiments(size_t* count) {
1764 *count = num_experiments;
1765 return experiments;
1766}
1767
[email protected]e2ddbc92010-10-15 20:02:071768} // namespace testing
1769
[email protected]1a47d7e2010-10-15 00:37:241770} // namespace about_flags