blob: 153c04d042a2b180bdeebb2aaa741a50e3df7554 [file] [log] [blame]
[email protected]9c66adc2012-01-05 02:10:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
[email protected]1fd1f292013-03-23 23:08:407#include <string.h>
8
[email protected]ad2a3ded2010-08-27 13:19:059#include <algorithm>
10#include <iterator>
11#include <map>
12#include <set>
[email protected]83e9fa702013-02-25 19:30:4413#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0514
[email protected]7d1d2092013-03-04 04:12:4315#include "apps/switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0516#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1517#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5718#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4119#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0320#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0521#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5222#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3823#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0324#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0525#include "chrome/common/chrome_switches.h"
[email protected]1fd1f292013-03-23 23:08:4026#include "chrome/common/chrome_version_info.h"
[email protected]ad2a3ded2010-08-27 13:19:0527#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3828#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0229#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0530#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0231#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0232#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0333#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1734#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5935#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4836#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2737#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2438#include "ui/keyboard/keyboard_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4339#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0540
[email protected]f1c39242013-01-29 16:13:0141#if defined(ENABLE_MESSAGE_CENTER)
42#include "ui/message_center/message_center_switches.h"
43#endif
44
[email protected]dc04be7c2012-03-15 23:57:4945#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3146#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4947#endif
48
[email protected]badba1ad2012-11-16 17:21:4649#if defined(OS_CHROMEOS)
50#include "chromeos/chromeos_switches.h"
51#endif
52
[email protected]7f6f44c2011-12-14 13:23:3853using content::UserMetricsAction;
54
[email protected]1a47d7e2010-10-15 00:37:2455namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0556
[email protected]8a6ff28d2010-12-02 16:35:1957// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5358#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4459 Experiment::SINGLE_VALUE, \
60 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5361#define SINGLE_VALUE_TYPE(command_line_switch) \
62 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4463#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
64 disable_switch, disable_value) \
65 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
66 disable_switch, disable_value, NULL, 3
67#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
68 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5369#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4470 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1971
[email protected]e2ddbc92010-10-15 20:02:0772namespace {
73
[email protected]9c7453d2012-01-21 00:45:4074const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5675const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0576
[email protected]cc3e2052011-12-20 01:01:4077// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
78// whether the experiment is available on that platform.
79void AddOsStrings(unsigned bitmask, ListValue* list) {
80 struct {
81 unsigned bit;
82 const char* const name;
83 } kBitsToOs[] = {
84 {kOsMac, "Mac"},
85 {kOsWin, "Windows"},
86 {kOsLinux, "Linux"},
87 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0188 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4089 };
90 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
91 if (bitmask & kBitsToOs[i].bit)
92 list->Append(new StringValue(kBitsToOs[i].name));
93}
94
[email protected]68317802012-06-07 19:13:2395const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
98 switches::kOmniboxHistoryQuickProviderNewScoring,
99 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
100 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
101 switches::kOmniboxHistoryQuickProviderNewScoring,
102 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
103};
104
[email protected]128dc6c2012-06-22 20:30:35105const Experiment::Choice
106 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
107 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
108 "",
109 "" },
110 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
111 switches::kOmniboxHistoryQuickProviderReorderForInlining,
112 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
113 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
114 switches::kOmniboxHistoryQuickProviderReorderForInlining,
115 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
116};
117
[email protected]032d5e6c2012-02-17 17:53:55118const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
119 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
120 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
121 switches::kOmniboxInlineHistoryQuickProvider,
122 switches::kOmniboxInlineHistoryQuickProviderAllowed },
123 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
124 switches::kOmniboxInlineHistoryQuickProvider,
125 switches::kOmniboxInlineHistoryQuickProviderProhibited }
126};
127
[email protected]fb854192013-02-06 01:30:04128const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
129 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
130 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
131 switches::kEnableCompositingForFixedPosition, ""},
132 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
133 switches::kDisableCompositingForFixedPosition, ""},
134 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
135 switches::kEnableHighDpiCompositingForFixedPosition, ""}
136};
137
[email protected]8b1c3c72013-01-25 01:48:43138const Experiment::Choice kGDIPresentChoices[] = {
139 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
140 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
141 switches::kDoFirstShowPresentWithGDI, ""},
142 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
143 switches::kDoAllShowPresentWithGDI, ""}
144};
145
[email protected]d7932532012-11-21 21:10:31146const Experiment::Choice kTouchEventsChoices[] = {
147 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
148 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
149 switches::kTouchEvents,
150 switches::kTouchEventsEnabled },
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
152 switches::kTouchEvents,
153 switches::kTouchEventsDisabled }
154};
155
[email protected]347a0c72012-05-14 20:28:06156const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31157 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20158 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06159 switches::kTouchOptimizedUI,
160 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20161 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06162 switches::kTouchOptimizedUI,
163 switches::kTouchOptimizedUIDisabled }
164};
165
[email protected]66f409c2012-10-04 20:59:04166const Experiment::Choice kNaClDebugMaskChoices[] = {
167 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
168 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
169 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
170 // an option to switch off its debugging.
171 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
172 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
173 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
174 switches::kNaClDebugMask, "*://*/*debug.nmf" }
175};
176
[email protected]ea2f3342012-09-21 21:13:36177#if defined(OS_CHROMEOS)
178const Experiment::Choice kAshBootAnimationFunction[] = {
179 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
180 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
181 ash::switches::kAshBootAnimationFunction2, ""},
182 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
183 ash::switches::kAshBootAnimationFunction3, ""}
184};
[email protected]d96aef22012-10-30 11:47:02185
186const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19187 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02188 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19189 switches::kEnableChromeCaptivePortalDetector, ""},
190 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
191 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02192};
[email protected]a78c7432013-03-13 06:22:43193
[email protected]ea2f3342012-09-21 21:13:36194#endif
195
[email protected]9323fdd12013-02-23 00:31:36196const Experiment::Choice kImplSidePaintingChoices[] = {
197 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
198 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
199 cc::switches::kEnableImplSidePainting, ""},
200 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
201 cc::switches::kDisableImplSidePainting, ""}
202};
203
[email protected]a42c85f2013-04-04 18:15:12204const Experiment::Choice kMaxPrepaintTileDistanceChoices[] = {
205 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
206 { IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_SHORT,
207 cc::switches::kMaxPrepaintTileDistance, "2048"},
208 { IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_TALL,
209 cc::switches::kMaxPrepaintTileDistance, "4096"},
210 { IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_GRANDE,
211 cc::switches::kMaxPrepaintTileDistance, "8192"},
212 { IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_VENTI,
213 cc::switches::kMaxPrepaintTileDistance, "16384"}
214};
215
216const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
217 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
218 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
219 cc::switches::kMaxTilesForInterestArea, "64"},
220 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
221 cc::switches::kMaxTilesForInterestArea, "128"},
222 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
223 cc::switches::kMaxTilesForInterestArea, "256"},
224 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
225 cc::switches::kMaxTilesForInterestArea, "512"}
226};
227
[email protected]4bc5050c2010-11-18 17:55:54228// RECORDING USER METRICS FOR FLAGS:
229// -----------------------------------------------------------------------------
230// The first line of the experiment is the internal name. If you'd like to
231// gather statistics about the usage of your flag, you should append a marker
232// comment to the end of the feature name, like so:
233// "my-special-feature", // FLAGS:RECORD_UMA
234//
235// After doing that, run //chrome/tools/extract_actions.py (see instructions at
236// the top of that file for details) to update the chromeactions.txt file, which
237// will enable UMA to record your feature flag.
238//
[email protected]783d5bb2012-10-24 03:47:14239// After your feature has shipped under a flag, you can locate the metrics under
240// the action name AboutFlags_internal-action-name. Actions are recorded once
241// per startup, so you should divide this number by AboutFlags_StartupTick to
242// get a sense of usage. Note that this will not be the same as number of users
243// with a given feature enabled because users can quit and relaunch the
244// application multiple times over a given time interval. The dashboard also
245// shows you how many (metrics reporting) users have enabled the flag over the
246// last seven days. However, note that this is not the same as the number of
247// users who have the flag enabled, since enabling the flag happens once,
248// whereas running with the flag enabled happens until the user flips the flag
249// again.
[email protected]4bc5050c2010-11-18 17:55:54250
[email protected]8a6ff28d2010-12-02 16:35:19251// To add a new experiment add to the end of kExperiments. There are two
252// distinct types of experiments:
253// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
254// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22255// . MULTI_VALUE: a list of choices, the first of which should correspond to a
256// deactivated state for this lab (i.e. no command line option). To specify
257// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
258// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19259// See the documentation of Experiment for details on the fields.
260//
261// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05262const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44263#if defined(OS_ANDROID)
264 {
[email protected]199def22013-02-21 17:52:29265 "enable-spdy-proxy-auth",
266 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
267 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44268 kOsAndroid,
[email protected]199def22013-02-21 17:52:29269 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44270 },
271#endif
[email protected]ad2a3ded2010-08-27 13:19:05272 {
[email protected]aac169d2011-03-18 19:53:03273 "expose-for-tabs", // FLAGS:RECORD_UMA
274 IDS_FLAGS_TABPOSE_NAME,
275 IDS_FLAGS_TABPOSE_DESCRIPTION,
276 kOsMac,
277#if defined(OS_MACOSX)
278 // The switch exists only on OS X.
279 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
280#else
281 SINGLE_VALUE_TYPE("")
282#endif
283 },
284 {
[email protected]4bc5050c2010-11-18 17:55:54285 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05286 IDS_FLAGS_CONFLICTS_CHECK_NAME,
287 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
288 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19289 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05290 },
291 {
[email protected]4bc5050c2010-11-18 17:55:54292 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54293 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
294 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45295 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22296 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31297 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22298 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
299 // always have PDF rasterization available, so no flag needed there.
300#if !defined(GOOGLE_CHROME_BUILD)
301 kOsWin,
302#else
303 0,
[email protected]fa6d2a2f2010-11-30 21:47:19304#endif
[email protected]8a6ff28d2010-12-02 16:35:19305 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42306 },
[email protected]60d77bd2012-08-22 00:10:07307#if defined(OS_WIN)
308 {
309 "print-raster",
310 IDS_FLAGS_PRINT_RASTER_NAME,
311 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
312 kOsWin,
313 SINGLE_VALUE_TYPE(switches::kPrintRaster)
314 },
315#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05316 {
[email protected]96c6f4c2011-05-18 19:36:22317 "ignore-gpu-blacklist",
318 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
319 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
320 kOsAll,
321 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
322 },
323 {
[email protected]0110cf112011-07-02 00:39:43324 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22325 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
326 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23327 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44328 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
329 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22330 },
331 {
[email protected]72787e392012-03-23 05:55:43332 "threaded-compositing-mode",
333 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
334 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56335 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44336 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
337 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59338 },
339 {
[email protected]17e27692013-02-06 17:02:09340 "force-accelerated-composited-scrolling",
341 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
342 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
343 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44344 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
345 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09346 },
347 {
[email protected]8b1c3c72013-01-25 01:48:43348 "present-with-GDI",
349 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
350 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
351 kOsWin,
352 MULTI_VALUE_TYPE(kGDIPresentChoices)
353 },
354 {
[email protected]81c64af62012-06-06 20:15:52355 "disable-accelerated-2d-canvas",
356 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
357 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
358 kOsAll,
359 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
360 },
361 {
[email protected]efcde132012-05-30 01:05:18362 "disable-threaded-animation",
363 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
364 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59365 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37366 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59367 },
368 {
[email protected]5963b772011-02-09 22:55:38369 "composited-layer-borders",
370 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
371 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
372 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57373 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38374 },
375 {
[email protected]a8f1eaa2011-03-07 19:00:58376 "show-fps-counter",
377 IDS_FLAGS_SHOW_FPS_COUNTER,
378 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
379 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57380 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58381 },
[email protected]8ff7f342011-05-25 01:49:47382 {
[email protected]70c98a332011-12-21 20:51:52383 "accelerated-filters",
384 IDS_FLAGS_ACCELERATED_FILTERS,
385 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
386 kOsAll,
387 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
388 },
389 {
[email protected]8ff7f342011-05-25 01:49:47390 "disable-gpu-vsync",
391 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
392 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56393 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47394 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
395 },
[email protected]deaba6d52011-09-23 14:47:12396 {
[email protected]4052d832013-01-16 05:31:01397 "enable-webgl",
398 IDS_FLAGS_ENABLE_WEBGL_NAME,
399 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
400 kOsAndroid,
401#if defined(OS_ANDROID)
402 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
403#else
404 SINGLE_VALUE_TYPE("")
405#endif
406 },
407 {
[email protected]deaba6d52011-09-23 14:47:12408 "disable-webgl",
409 IDS_FLAGS_DISABLE_WEBGL_NAME,
410 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56411 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01412#if defined(OS_ANDROID)
413 SINGLE_VALUE_TYPE("")
414#else
[email protected]deaba6d52011-09-23 14:47:12415 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01416#endif
[email protected]deaba6d52011-09-23 14:47:12417 },
[email protected]09096e02012-05-24 11:12:04418 {
[email protected]ce585bf2013-03-14 16:25:16419 "disable-webrtc",
420 IDS_FLAGS_DISABLE_WEBRTC_NAME,
421 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05422 kOsAndroid,
423#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16424 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05425#else
426 SINGLE_VALUE_TYPE("")
427#endif
428 },
429 {
[email protected]96bcdc102012-05-24 23:42:10430 "fixed-position-creates-stacking-context",
431 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
432 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
433 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44434 ENABLE_DISABLE_VALUE_TYPE(
435 switches::kEnableFixedPositionCreatesStackingContext,
436 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10437 },
[email protected]fb854192013-02-06 01:30:04438 {
439 "enable-compositing-for-fixed-position",
440 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
441 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
442 kOsAll,
443 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
444 },
[email protected]a7640ef22012-10-06 00:52:08445 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53446 {
[email protected]e3791ce92011-08-09 01:03:32447 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40448 IDS_FLAGS_ENABLE_NACL_NAME,
449 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56450 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19451 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40452 },
[email protected]b39c6d92012-01-31 16:38:41453 // TODO(halyavin): When exception handling is on by default, replace this
454 // flag with disable-nacl-exception-handling.
455 {
456 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
457 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
458 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56459 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41460 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
461 },
[email protected]4ff87d202010-11-06 01:28:40462 {
[email protected]9addd1c2012-09-15 14:28:24463 "enable-nacl-debug", // FLAGS:RECORD_UMA
464 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
465 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56466 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24467 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13468 },
469 {
[email protected]66f409c2012-10-04 20:59:04470 "nacl-debug-mask", // FLAGS:RECORD_UMA
471 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
472 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56473 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04474 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
475 },
476 {
[email protected]7babd1c2012-08-08 20:35:29477 "enable-pnacl", // FLAGS:RECORD_UMA
478 IDS_FLAGS_ENABLE_PNACL_NAME,
479 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56480 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29481 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
482 },
483 {
[email protected]4bc5050c2010-11-18 17:55:54484 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32485 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
486 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56487 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19488 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32489 },
[email protected]3627b06d2010-11-12 16:36:16490 {
[email protected]ac2e2acd2013-03-21 12:57:29491 "extensions-on-chrome-urls",
492 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
493 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
494 kOsAll,
495 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
496 },
497 {
[email protected]e9cddd52013-03-23 17:37:53498 "enable-adview",
499 IDS_FLAGS_ENABLE_ADVIEW_NAME,
500 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
501 kOsDesktop,
502 SINGLE_VALUE_TYPE(switches::kEnableAdview)
503 },
504 {
505 "enable-adview-src-attribute",
506 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
507 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
508 kOsDesktop,
509 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
510 },
511 {
[email protected]544471a2012-10-13 05:27:09512 "action-box",
[email protected]cab18ef2012-04-27 07:22:03513 IDS_FLAGS_ACTION_BOX_NAME,
514 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56515 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44516 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
517 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03518 },
519 {
[email protected]3a362432012-06-18 20:39:51520 "script-badges",
521 IDS_FLAGS_SCRIPT_BADGES_NAME,
522 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56523 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09524 SINGLE_VALUE_TYPE(switches::kScriptBadges)
525 },
526 {
527 "script-bubble",
528 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
529 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56530 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44531 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
532 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51533 },
534 {
[email protected]cbe224d2011-08-04 22:12:49535 "apps-new-install-bubble",
536 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
537 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56538 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49539 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
540 },
541 {
[email protected]80bd24e2010-11-30 09:34:38542 "disable-hyperlink-auditing",
543 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
544 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
545 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19546 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51547 },
548 {
549 "experimental-location-features", // FLAGS:RECORD_UMA
550 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
551 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
552 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19553 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
554 },
555 {
[email protected]5aea1862011-03-23 23:55:39556 "tab-groups-context-menu",
557 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
558 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
559 kOsWin,
560 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
561 },
[email protected]c94cebd2012-06-21 00:55:28562 {
563 "enable-instant-extended-api",
564 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
565 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56566 kOsDesktop,
[email protected]73444382013-02-26 19:31:51567 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
568 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28569 },
[email protected]e9bf9d92011-03-31 20:57:15570 {
[email protected]354e33b2011-06-15 00:29:10571 "static-ip-config",
572 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
573 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
574 kOsCrOS,
575#if defined(OS_CHROMEOS)
576 // This switch exists only on Chrome OS.
577 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
578#else
579 SINGLE_VALUE_TYPE("")
580#endif
581 },
[email protected]3eb5728c2011-06-20 22:32:24582 {
583 "show-autofill-type-predictions",
584 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
585 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
586 kOsAll,
587 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
588 },
[email protected]bff4d3e2011-06-21 23:58:52589 {
[email protected]a5e9faa2013-03-19 09:58:38590 "enable-sync-favicons",
591 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
592 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55593 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38594 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55595 },
596 {
[email protected]5d90a0a2012-11-15 02:43:40597 "sync-keystore-encryption",
598 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
599 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
600 kOsAll,
601 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
602 },
603 {
[email protected]e755a382012-09-13 17:16:35604 "enable-gesture-tap-highlight",
605 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
606 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
607 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47608 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
609 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35610 },
611 {
[email protected]a22ebd812011-06-23 00:05:39612 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
613 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
614 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
615 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40616 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25617 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39618 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
619 },
[email protected]81a6b0b2011-06-24 17:55:40620 {
[email protected]68317802012-06-07 19:13:23621 "omnibox-history-quick-provider-new-scoring",
622 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
623 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
624 kOsAll,
625 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
626 },
627 {
[email protected]128dc6c2012-06-22 20:30:35628 "omnibox-history-quick-provider-reorder-for-inlining",
629 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
630 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
631 kOsAll,
632 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
633 },
634 {
[email protected]032d5e6c2012-02-17 17:53:55635 "omnibox-inline-history-quick-provider",
636 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
637 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
638 kOsAll,
639 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
640 },
641 {
[email protected]7e7a28092011-12-09 22:24:55642 "enable-panels",
643 IDS_FLAGS_ENABLE_PANELS_NAME,
644 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56645 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55646 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54647 },
[email protected]e3749d12011-07-25 22:22:12648 {
[email protected]27c14f02012-06-22 17:29:58649 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27650 "save-page-as-mhtml", // FLAGS:RECORD_UMA
651 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
652 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
653 kOsMac | kOsWin | kOsLinux,
654 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
655 },
656 {
[email protected]b7bb44f2011-09-01 05:17:03657 "enable-autologin",
658 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
659 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
660 kOsMac | kOsWin | kOsLinux,
661 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
662 },
[email protected]b9841172011-09-26 23:36:09663 {
[email protected]14371cb2013-03-21 07:46:12664 "enable-spdy31",
665 IDS_FLAGS_ENABLE_SPDY31_NAME,
666 IDS_FLAGS_ENABLE_SPDY31_DESCRIPTION,
[email protected]3231b612012-03-23 05:57:54667 kOsAll,
[email protected]14371cb2013-03-21 07:46:12668 SINGLE_VALUE_TYPE(switches::kEnableSpdy31)
[email protected]3231b612012-03-23 05:57:54669 },
670 {
[email protected]27b3fe92012-03-21 05:35:06671 "enable-async-dns",
672 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
673 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46674 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44675 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
676 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06677 },
678 {
[email protected]1eb93802012-09-11 18:57:56679 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11680 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
681 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32682 kOsAll,
[email protected]da43c082012-09-07 18:56:11683 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44684 },
[email protected]e4e68dbb2011-11-18 01:50:22685 {
[email protected]36d98412013-01-31 20:28:53686 "disable-encrypted-media",
687 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
688 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56689 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53690 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03691 },
[email protected]f88628792012-12-18 07:07:50692 {
693 "enable-opus-playback",
694 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
695 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56696 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50697 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
698 },
[email protected]ca6eaa5a2013-01-24 16:16:04699 {
[email protected]c54e1aa2013-01-25 09:26:17700 "enable-vp9-playback",
701 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
702 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
703 kOsDesktop,
704 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
705 },
706 {
[email protected]ca6eaa5a2013-01-24 16:16:04707 "enable-managed-users",
708 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
709 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
710 kOsAll,
711 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
712 },
[email protected]dc04be7c2012-03-15 23:57:49713#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50714 {
[email protected]cda278d2012-10-30 20:31:40715 "ash-disable-auto-window-placement",
716 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
717 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
718 kOsWin | kOsLinux | kOsCrOS,
719 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
720 },
[email protected]b4e4ec42012-11-29 21:42:40721 {
[email protected]16f55a22013-02-13 23:47:34722 "ash-disable-per-app-launcher",
723 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
724 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40725 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34726 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40727 },
[email protected]dc04be7c2012-03-15 23:57:49728#endif
[email protected]eaae8b462012-01-20 22:20:39729 {
[email protected]db543d322011-12-15 20:40:15730 "per-tile-painting",
731 IDS_FLAGS_PER_TILE_PAINTING_NAME,
732 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37733 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37734 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15735 },
[email protected]bf88c032011-12-22 19:05:47736 {
737 "enable-javascript-harmony",
738 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
739 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
740 kOsAll,
741 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
742 },
[email protected]7e7f378a2012-01-05 14:35:37743 {
[email protected]85646172012-01-09 22:45:54744 "enable-tab-browser-dragging",
745 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
746 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
747 kOsWin,
748 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
749 },
750 {
[email protected]068b7b52012-02-27 12:41:44751 "disable-restore-session-state",
752 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
753 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37754 kOsAll,
[email protected]068b7b52012-02-27 12:41:44755 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37756 },
[email protected]88864db2012-01-18 20:56:35757 {
758 "disable-software-rasterizer",
759 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
760 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
761#if defined(ENABLE_SWIFTSHADER)
762 kOsAll,
763#else
764 0,
765#endif
766 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
767 },
[email protected]15a5d722012-01-23 09:11:14768 {
[email protected]ff7b6dd2012-09-15 20:20:03769 "enable-experimental-webkit-features",
770 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
771 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16772 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03773 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49774 },
775 {
[email protected]0f95a252012-09-13 22:30:04776 "enable-css-shaders",
777 IDS_FLAGS_CSS_SHADERS_NAME,
778 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
779 kOsAll,
780 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
781 },
782 {
[email protected]9860c68b2012-02-02 01:58:09783 "enable-extension-activity-ui",
784 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
785 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56786 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09787 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00788 },
[email protected]54ae4e92012-02-16 15:19:05789 {
[email protected]3e8befc2012-03-13 01:17:03790 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16791 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
792 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56793 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03794 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16795 },
[email protected]dc04be7c2012-03-15 23:57:49796#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01797 {
[email protected]3cd198a22012-03-12 20:38:01798 "enable-ash-oak",
799 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
800 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
801 kOsAll,
802 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
803 },
[email protected]31cf1c52012-02-29 20:55:01804#endif
[email protected]184ec592012-03-01 11:54:28805 {
806 "enable-devtools-experiments",
807 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
808 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56809 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28810 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
811 },
[email protected]76d1854e2012-03-02 23:57:44812 {
[email protected]2fefdb32013-02-26 14:28:10813 "silent-debugger-extension-api",
814 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
815 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
816 kOsDesktop,
817 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
818 },
819 {
[email protected]76d1854e2012-03-02 23:57:44820 "enable-suggestions-ntp",
821 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
822 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56823 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44824 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
825 },
[email protected]a3d54252012-04-05 20:04:13826 {
[email protected]1dbaf5e2012-11-30 05:51:32827 "spellcheck-autocorrect",
828 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
829 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
830 kOsWin | kOsLinux | kOsCrOS,
831 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
832 },
833 {
[email protected]d7932532012-11-21 21:10:31834 "touch-events",
835 IDS_TOUCH_EVENTS_NAME,
836 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56837 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31838 MULTI_VALUE_TYPE(kTouchEventsChoices)
839 },
840 {
[email protected]c9c73ad42012-04-18 03:35:59841 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06842 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
843 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55844 kOsWin,
[email protected]347a0c72012-05-14 20:28:06845 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59846 },
[email protected]8a6aaa72012-04-20 20:53:58847 {
[email protected]b9c96ff2012-11-26 22:24:40848 "disable-touch-adjustment",
849 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
850 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
851 kOsWin | kOsLinux | kOsCrOS,
852 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
853 },
854 {
[email protected]0b9383a2012-10-26 00:58:16855 "enable-tab-capture",
856 IDS_ENABLE_TAB_CAPTURE_NAME,
857 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25858 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44859 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
860 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16861 },
[email protected]0b60afa2012-04-19 17:36:39862#if defined(OS_CHROMEOS)
863 {
[email protected]7c4a9bc2012-09-11 22:10:05864 "enable-background-loader",
865 IDS_ENABLE_BACKLOADER_NAME,
866 IDS_ENABLE_BACKLOADER_DESCRIPTION,
867 kOsCrOS,
868 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
869 },
870 {
[email protected]c5667b282012-08-31 00:32:50871 "enable-bezel-touch",
872 IDS_ENABLE_BEZEL_TOUCH_NAME,
873 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47874 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50875 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47876 },
877 {
[email protected]3f4181a2013-02-01 21:31:07878 "enable-screensaver-extension",
879 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
880 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
881 kOsCrOS,
882 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
883 },
884 {
[email protected]0b60afa2012-04-19 17:36:39885 "no-discard-tabs",
886 IDS_FLAGS_NO_DISCARD_TABS_NAME,
887 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
888 kOsCrOS,
889 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
890 },
891#endif
[email protected]79be6d32012-04-24 20:47:44892 {
[email protected]8d68a3e02013-01-12 15:57:10893 "enable-download-resumption",
894 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
895 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56896 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10897 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
898 },
899 {
[email protected]9a5940d2012-04-27 19:16:23900 "allow-nacl-socket-api",
901 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
902 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56903 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23904 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
905 },
[email protected]85333732012-05-01 19:02:24906 {
[email protected]60673ad72012-05-02 06:16:33907 "stacked-tab-strip",
908 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
909 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
910 kOsWin,
911 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
912 },
913 {
[email protected]4bd20202012-06-14 17:35:01914 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24915 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
916 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
917 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01918 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24919 },
[email protected]190349fd2012-05-02 00:10:47920#if defined(OS_CHROMEOS)
921 {
922 "allow-touchpad-three-finger-click",
923 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
924 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
925 kOsCrOS,
926 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
927 },
[email protected]fbc176b62012-10-27 02:19:58928 {
929 "allow-touchpad-three-finger-swipe",
930 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
931 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
932 kOsCrOS,
933 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
934 },
[email protected]190349fd2012-05-02 00:10:47935#endif
[email protected]1992a2f42012-10-23 18:32:21936 {
[email protected]a585e462013-01-26 00:37:15937 "use-client-login-signin-flow",
938 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
939 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21940 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15941 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21942 },
[email protected]8ee02242012-12-04 15:23:32943 {
944 "enable-desktop-guest-mode",
945 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
946 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
947 kOsMac | kOsWin | kOsLinux,
948 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
949 },
[email protected]53520b1b2012-05-07 21:43:37950#if defined(USE_ASH)
951 {
[email protected]8257d382013-03-26 13:08:42952 "show-launcher-alignment-menu",
953 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
954 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42955 kOsAll,
[email protected]8257d382013-03-26 13:08:42956 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42957 },
958 {
[email protected]73074742012-05-17 01:44:41959 "show-touch-hud",
960 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
961 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
962 kOsAll,
963 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
964 },
965 {
[email protected]9f0940b62012-05-23 22:56:35966 "enable-pinch",
967 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
968 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06969 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38970 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
971 },
972 {
973 "pinch-zoom-scrollbars",
974 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_NAME,
975 IDS_FLAGS_PINCH_ZOOM_SCROLLBARS_DESCRIPTION,
976 kOsCrOS,
977 ENABLE_DISABLE_VALUE_TYPE(cc::switches::kEnablePinchZoomScrollbars,
978 cc::switches::kDisablePinchZoomScrollbars)
[email protected]9f0940b62012-05-23 22:56:35979 },
[email protected]a8379312012-06-15 00:20:43980 {
981 "app-list-show-apps-only",
982 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
983 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
984 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03985 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43986 },
[email protected]73074742012-05-17 01:44:41987#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28988#if defined(OS_CHROMEOS)
989 {
[email protected]8b04a1652012-08-04 02:59:49990 "disable-boot-animation",
991 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
992 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
993 kOsCrOS,
994 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
995 },
[email protected]95058572012-08-20 14:57:29996 {
[email protected]b4557192012-09-19 11:29:58997 "disable-boot-animation2",
998 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
999 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
1000 kOsCrOS,
1001 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
1002 },
1003 {
[email protected]ea2f3342012-09-21 21:13:361004 "boot-animation-fucntion",
1005 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
1006 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
1007 kOsCrOS,
1008 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
1009 },
[email protected]839667d62012-10-23 19:38:571010 {
[email protected]d96aef22012-10-30 11:47:021011 "captive-portal-detector",
1012 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
1013 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
1014 kOsCrOS,
1015 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
1016 },
1017 {
[email protected]c11aa8f12012-12-18 18:43:141018 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571019 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1020 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1021 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141022 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571023 },
[email protected]f0280952012-11-06 20:30:501024 {
[email protected]0fb5c4852012-11-08 20:33:231025 "file-manager-packaged",
1026 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1027 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1028 kOsCrOS,
1029 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1030 },
[email protected]3e035e82012-11-27 20:54:321031 {
[email protected]8039e06c2013-01-17 23:34:501032 "disable-launcher-per-display",
1033 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1034 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351035 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501036 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351037 },
[email protected]06b146d2013-02-07 06:06:471038 {
[email protected]c64d7732013-03-25 18:09:501039 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521040 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1041 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]06b146d2013-02-07 06:06:471042 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521043 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471044 },
[email protected]6ad015c2013-03-06 00:49:511045 {
[email protected]c64d7732013-03-25 18:09:501046 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521047 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1048 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511049 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521050 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511051 },
[email protected]62018dc2012-12-13 00:37:351052#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391053 {
[email protected]6247aba2013-03-04 22:57:181054 "views-textfield",
1055 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1056 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391057 kOsWin,
[email protected]6247aba2013-03-04 22:57:181058 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1059 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391060 },
[email protected]bd0cd3bb2012-06-14 03:03:381061 {
[email protected]2d4817742012-12-17 20:16:181062 "enable-new-dialog-style",
1063 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1064 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321065 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181066 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321067 },
[email protected]7db8893a2012-07-26 00:49:401068 { "disable-accelerated-video-decode",
1069 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1070 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561071 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401072 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151073 },
[email protected]66ae9fc2012-06-19 21:33:521074#if defined(USE_ASH)
1075 {
1076 "ash-debug-shortcuts",
1077 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1078 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1079 kOsAll,
1080 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1081 },
1082#endif
[email protected]37fee0942012-08-07 21:07:451083 {
[email protected]ad3f6d22012-08-29 02:34:191084 "enable-contacts",
1085 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1086 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1087 kOsCrOS,
1088 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1089 },
[email protected]1d9bb9cd2012-08-28 22:02:501090#if defined(USE_ASH)
1091 { "ash-enable-advanced-gestures",
1092 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1093 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1094 kOsCrOS,
1095 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1096 },
[email protected]cfa24e62013-02-13 21:19:111097 { "ash-disable-tab-scrubbing",
1098 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1099 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161100 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111101 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161102 },
[email protected]83eef802012-12-02 07:43:521103 { "ash-enable-workspace-scrubbing",
1104 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1105 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1106 kOsCrOS,
1107 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1108 },
[email protected]819e58d22013-03-20 00:16:111109 { "ash-immersive-fullscreen",
1110 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1111 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241112 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111113 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241114 },
[email protected]316708a2012-11-05 22:57:021115#if defined(OS_LINUX)
1116 { "ash-enable-memory-monitor",
1117 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1118 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1119 kOsCrOS,
1120 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1121 },
1122#endif
[email protected]1d9bb9cd2012-08-28 22:02:501123#endif
[email protected]9b7ab882012-09-10 23:46:361124#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091125 { "ash-disable-new-network-status-area",
1126 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1127 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461128 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091129 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461130 },
[email protected]9b7ab882012-09-10 23:46:361131 {
[email protected]205f07892012-10-16 20:26:221132 "enable-carrier-switching",
1133 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1134 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1135 kOsCrOS,
1136 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1137 },
1138 {
[email protected]9b7ab882012-09-10 23:46:361139 "enable-request-tablet-site",
1140 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1141 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1142 kOsCrOS,
1143 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1144 },
1145#endif
[email protected]dab49c0b2012-10-04 05:55:351146 {
1147 "debug-packed-apps",
1148 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1149 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561150 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351151 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1152 },
[email protected]d1459ed2012-10-10 01:29:331153 {
1154 "enable-password-generation",
1155 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1156 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561157 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331158 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1159 },
[email protected]26d045f2012-10-18 21:18:431160 {
[email protected]76f7d4882012-10-26 21:09:221161 "enable-deferred-image-decoding",
1162 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1163 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221164 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221165 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1166 },
1167 {
[email protected]075543d2012-10-24 01:29:141168 "performance-monitor-gathering",
1169 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1170 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1171 kOsAll,
1172 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1173 },
[email protected]783d5bb2012-10-24 03:47:141174 {
[email protected]90b482d2013-04-04 10:45:581175 "disable-native-autofill-ui",
1176 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_NAME,
1177 IDS_FLAGS_DISABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]1fdeac72013-03-19 17:28:431178 kOsDesktop,
[email protected]90b482d2013-04-04 10:45:581179 SINGLE_VALUE_TYPE(switches::kDisableNativeAutofillUi)
[email protected]1fdeac72013-03-19 17:28:431180 },
1181 {
[email protected]99002fd2012-11-06 04:35:521182 "show-app-list-shortcut",
1183 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1184 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1185 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431186 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521187 },
[email protected]a7259fb2012-11-08 06:22:231188 {
1189 "enable-experimental-form-filling",
1190 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1191 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1192 kOsWin | kOsCrOS,
1193 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1194 },
[email protected]6e6efe42013-01-30 00:04:501195 {
[email protected]db3178c2013-03-21 14:54:541196 "wallet-service-use-prod",
1197 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1198 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1199 kOsCrOS | kOsWin,
1200 SINGLE_VALUE_TYPE(switches::kWalletServiceUseProd)
1201 },
1202 {
[email protected]6e6efe42013-01-30 00:04:501203 "enable-interactive-autocomplete",
1204 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1205 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221206 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501207 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1208 },
[email protected]edbea622012-11-28 20:39:381209 {
1210 "enable-touch-drag-drop",
1211 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1212 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1213 kOsWin | kOsCrOS,
1214 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1215 },
[email protected]0e2f43b62013-02-21 00:47:151216 {
1217 "enable-touch-editing",
1218 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1219 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1220 kOsCrOS,
1221 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1222 },
[email protected]f1c39242013-01-29 16:13:011223#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201224 {
1225 "enable-rich-notifications",
1226 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1227 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1228 kOsWin | kOsCrOS,
[email protected]aee412aa2013-04-02 20:01:231229 ENABLE_DISABLE_VALUE_TYPE(
1230 message_center::switches::kEnableRichNotifications,
1231 message_center::switches::kDisableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201232 },
[email protected]f1c39242013-01-29 16:13:011233#endif
[email protected]4d51c682012-12-11 11:34:551234 {
1235 "full-history-sync",
1236 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1237 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1238 kOsAll,
1239 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1240 },
[email protected]628a69a92012-12-23 04:09:341241 {
[email protected]fd030142013-02-08 02:04:381242 "enable-usermedia-screen-capture",
1243 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1244 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1245 kOsDesktop,
1246 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1247 },
[email protected]5b93e162013-02-19 06:33:091248 {
1249 "enable-apps-devtool-app",
1250 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1251 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1252 kOsDesktop,
1253 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1254 },
[email protected]9323fdd12013-02-23 00:31:361255 {
1256 "impl-side-painting",
1257 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1258 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041259 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361260 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1261 },
[email protected]a42c85f2013-04-04 18:15:121262 {
1263 "max-prepaint-tile-distance",
1264 IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_NAME,
1265 IDS_FLAGS_MAX_PREPAINT_TILE_DISTANCE_DESCRIPTION,
1266 kOsAndroid | kOsLinux | kOsCrOS,
1267 MULTI_VALUE_TYPE(kMaxPrepaintTileDistanceChoices)
1268 },
1269 {
1270 "max-tiles-for-interest-area",
1271 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1272 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
1273 kOsAndroid | kOsLinux | kOsCrOS,
1274 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1275 },
[email protected]2f2f72b2013-03-08 22:37:311276 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1277#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371278 {
1279 "track-active-visit-time",
1280 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1281 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1282 kOsWin,
1283 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1284 },
[email protected]2f2f72b2013-03-08 22:37:311285#endif
[email protected]8cc71d42013-03-02 17:26:081286#if defined(OS_ANDROID)
1287 {
1288 "disable-gesture-requirement-for-media-playback",
1289 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1290 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1291 kOsAndroid,
1292 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1293 },
1294#endif
[email protected]e79f2fd52013-03-08 23:52:471295#if defined(OS_CHROMEOS)
1296 {
1297 "enable-experimental-bluetooth",
1298 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1299 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1300 kOsCrOS,
1301 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1302 },
1303#endif
[email protected]6077cab2013-03-11 19:36:141304#if defined(ENABLE_GOOGLE_NOW)
1305 {
1306 "enable-google-now",
1307 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1308 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1309 kOsWin | kOsCrOS,
1310 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1311 },
1312#endif
[email protected]4a9e2e02013-04-08 16:19:491313 {
1314 "enable-translate-alpha-languages",
1315 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_NAME,
1316 IDS_FLAGS_ENABLE_TRANSLATE_ALPHA_LANGUAGES_DESCRIPTION,
1317 kOsAll,
1318 SINGLE_VALUE_TYPE(switches::kEnableTranslateAlphaLanguages)
1319 },
[email protected]86459e2c2013-04-10 13:39:241320#if defined(OS_CHROMEOS)
1321 {
1322 "enable-virtual-keyboard",
1323 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1324 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1325 kOsCrOS,
1326 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1327 },
1328#endif
[email protected]a0e4b072011-08-17 01:47:071329};
[email protected]ad2a3ded2010-08-27 13:19:051330
[email protected]a314ee5a2010-10-26 21:23:281331const Experiment* experiments = kExperiments;
1332size_t num_experiments = arraysize(kExperiments);
1333
[email protected]e2ddbc92010-10-15 20:02:071334// Stores and encapsulates the little state that about:flags has.
1335class FlagsState {
1336 public:
1337 FlagsState() : needs_restart_(false) {}
1338 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1339 bool IsRestartNeededToCommitChanges();
1340 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281341 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071342 void RemoveFlagsSwitches(
1343 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001344 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071345 void reset();
1346
1347 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551348 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071349 return Singleton<FlagsState>::get();
1350 }
1351
1352 private:
1353 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531354 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071355
1356 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1357};
1358
[email protected]c7b7800a2010-10-07 18:51:351359// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491360// in a set.
[email protected]1a47d7e2010-10-15 00:37:241361void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051362 const ListValue* enabled_experiments = prefs->GetList(
1363 prefs::kEnabledLabsExperiments);
1364 if (!enabled_experiments)
1365 return;
1366
1367 for (ListValue::const_iterator it = enabled_experiments->begin();
1368 it != enabled_experiments->end();
1369 ++it) {
1370 std::string experiment_name;
1371 if (!(*it)->GetAsString(&experiment_name)) {
1372 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1373 continue;
1374 }
1375 result->insert(experiment_name);
1376 }
1377}
1378
[email protected]c6343372013-03-13 17:05:491379// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241380void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051381 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381382 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1383 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051384
1385 experiments_list->Clear();
1386 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1387 it != enabled_experiments.end();
1388 ++it) {
1389 experiments_list->Append(new StringValue(*it));
1390 }
1391}
1392
[email protected]8a6ff28d2010-12-02 16:35:191393// Adds the internal names for the specified experiment to |names|.
1394void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1395 if (e.type == Experiment::SINGLE_VALUE) {
1396 names->insert(e.internal_name);
1397 } else {
[email protected]83e9fa702013-02-25 19:30:441398 DCHECK(e.type == Experiment::MULTI_VALUE ||
1399 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191400 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441401 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191402 }
1403}
1404
[email protected]28e35af2011-02-09 12:56:221405// Confirms that an experiment is valid, used in a DCHECK in
1406// SanitizeList below.
1407bool ValidateExperiment(const Experiment& e) {
1408 switch (e.type) {
1409 case Experiment::SINGLE_VALUE:
1410 DCHECK_EQ(0, e.num_choices);
1411 DCHECK(!e.choices);
1412 break;
1413 case Experiment::MULTI_VALUE:
1414 DCHECK_GT(e.num_choices, 0);
1415 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531416 DCHECK(e.choices[0].command_line_switch);
1417 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221418 break;
[email protected]83e9fa702013-02-25 19:30:441419 case Experiment::ENABLE_DISABLE_VALUE:
1420 DCHECK_EQ(3, e.num_choices);
1421 DCHECK(!e.choices);
1422 DCHECK(e.command_line_switch);
1423 DCHECK(e.command_line_value);
1424 DCHECK(e.disable_command_line_switch);
1425 DCHECK(e.disable_command_line_value);
1426 break;
[email protected]28e35af2011-02-09 12:56:221427 default:
1428 NOTREACHED();
1429 }
1430 return true;
1431}
1432
[email protected]ad2a3ded2010-08-27 13:19:051433// Removes all experiments from prefs::kEnabledLabsExperiments that are
1434// unknown, to prevent this list to become very long as experiments are added
1435// and removed.
1436void SanitizeList(PrefService* prefs) {
1437 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221438 for (size_t i = 0; i < num_experiments; ++i) {
1439 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191440 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221441 }
[email protected]ad2a3ded2010-08-27 13:19:051442
1443 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241444 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051445
1446 std::set<std::string> new_enabled_experiments;
1447 std::set_intersection(
1448 known_experiments.begin(), known_experiments.end(),
1449 enabled_experiments.begin(), enabled_experiments.end(),
1450 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1451
[email protected]4c8853f2012-07-23 01:29:161452 if (new_enabled_experiments != enabled_experiments)
1453 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051454}
1455
[email protected]1a47d7e2010-10-15 00:37:241456void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051457 PrefService* prefs, std::set<std::string>* result) {
1458 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241459 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051460}
1461
[email protected]a314ee5a2010-10-26 21:23:281462// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1463// enabled on the current platform.
1464void GetSanitizedEnabledFlagsForCurrentPlatform(
1465 PrefService* prefs, std::set<std::string>* result) {
1466 GetSanitizedEnabledFlags(prefs, result);
1467
1468 // Filter out any experiments that aren't enabled on the current platform. We
1469 // don't remove these from prefs else syncing to a platform with a different
1470 // set of experiments would be lossy.
1471 std::set<std::string> platform_experiments;
1472 int current_platform = GetCurrentPlatform();
1473 for (size_t i = 0; i < num_experiments; ++i) {
1474 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191475 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281476 }
1477
1478 std::set<std::string> new_enabled_experiments;
1479 std::set_intersection(
1480 platform_experiments.begin(), platform_experiments.end(),
1481 result->begin(), result->end(),
1482 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1483
1484 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051485}
1486
[email protected]8a6ff28d2010-12-02 16:35:191487// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191488Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221489 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441490 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1491 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191492 ListValue* result = new ListValue;
1493 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191494 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441495 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191496 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441497 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221498 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191499 result->Append(value);
1500 }
1501 return result;
1502}
1503
[email protected]e2ddbc92010-10-15 20:02:071504} // namespace
1505
[email protected]83e9fa702013-02-25 19:30:441506std::string Experiment::NameForChoice(int index) const {
1507 DCHECK(type == Experiment::MULTI_VALUE ||
1508 type == Experiment::ENABLE_DISABLE_VALUE);
1509 DCHECK_LT(index, num_choices);
1510 return std::string(internal_name) + testing::kMultiSeparator +
1511 base::IntToString(index);
1512}
1513
1514string16 Experiment::DescriptionForChoice(int index) const {
1515 DCHECK(type == Experiment::MULTI_VALUE ||
1516 type == Experiment::ENABLE_DISABLE_VALUE);
1517 DCHECK_LT(index, num_choices);
1518 int description_id;
1519 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1520 const int kEnableDisableDescriptionIds[] = {
1521 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1522 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1523 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1524 };
1525 description_id = kEnableDisableDescriptionIds[index];
1526 } else {
1527 description_id = choices[index].description_id;
1528 }
1529 return l10n_util::GetStringUTF16(description_id);
1530}
1531
[email protected]1a47d7e2010-10-15 00:37:241532void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551533 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051534}
1535
[email protected]1a47d7e2010-10-15 00:37:241536ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051537 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241538 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051539
1540 int current_platform = GetCurrentPlatform();
1541
1542 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281543 for (size_t i = 0; i < num_experiments; ++i) {
1544 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051545
[email protected]1fd1f292013-03-23 23:08:401546#if defined(OS_ANDROID)
1547 // Special case enable-spdy-proxy-auth, because it should only
1548 // be available on Dev and Beta channels.
1549 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1550 chrome::VersionInfo::GetChannel() ==
1551 chrome::VersionInfo::CHANNEL_STABLE)
1552 continue;
1553#endif
1554
[email protected]ad2a3ded2010-08-27 13:19:051555 DictionaryValue* data = new DictionaryValue();
1556 data->SetString("internal_name", experiment.internal_name);
1557 data->SetString("name",
1558 l10n_util::GetStringUTF16(experiment.visible_name_id));
1559 data->SetString("description",
1560 l10n_util::GetStringUTF16(
1561 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401562 bool supported = !!(experiment.supported_platforms & current_platform);
1563 data->SetBoolean("supported", supported);
1564
1565 ListValue* supported_platforms = new ListValue();
1566 AddOsStrings(experiment.supported_platforms, supported_platforms);
1567 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051568
[email protected]28e35af2011-02-09 12:56:221569 switch (experiment.type) {
1570 case Experiment::SINGLE_VALUE:
1571 data->SetBoolean(
1572 "enabled",
1573 enabled_experiments.count(experiment.internal_name) > 0);
1574 break;
1575 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441576 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221577 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1578 break;
1579 default:
1580 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191581 }
1582
[email protected]ad2a3ded2010-08-27 13:19:051583 experiments_data->Append(data);
1584 }
1585 return experiments_data;
1586}
1587
[email protected]ad2a3ded2010-08-27 13:19:051588bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551589 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051590}
1591
1592void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351593 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551594 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071595}
1596
1597void RemoveFlagsSwitches(
1598 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551599 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071600}
1601
[email protected]cb93bf52013-02-20 01:20:001602void ResetAllFlags(PrefService* prefs) {
1603 FlagsState::GetInstance()->ResetAllFlags(prefs);
1604}
1605
[email protected]a314ee5a2010-10-26 21:23:281606int GetCurrentPlatform() {
1607#if defined(OS_MACOSX)
1608 return kOsMac;
1609#elif defined(OS_WIN)
1610 return kOsWin;
1611#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1612 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211613#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281614 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401615#elif defined(OS_ANDROID)
1616 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281617#else
1618#error Unknown platform
1619#endif
1620}
1621
[email protected]4bc5050c2010-11-18 17:55:541622void RecordUMAStatistics(const PrefService* prefs) {
1623 std::set<std::string> flags;
1624 GetEnabledFlags(prefs, &flags);
1625 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1626 ++it) {
1627 std::string action("AboutFlags_");
1628 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381629 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541630 }
1631 // Since flag metrics are recorded every startup, add a tick so that the
1632 // stats can be made meaningful.
1633 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381634 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1635 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541636}
1637
[email protected]e2ddbc92010-10-15 20:02:071638//////////////////////////////////////////////////////////////////////////////
1639// FlagsState implementation.
1640
1641namespace {
1642
[email protected]83e9fa702013-02-25 19:30:441643typedef std::map<std::string, std::pair<std::string, std::string> >
1644 NameToSwitchAndValueMap;
1645
1646void SetFlagToSwitchMapping(const std::string& key,
1647 const std::string& switch_name,
1648 const std::string& switch_value,
1649 NameToSwitchAndValueMap* name_to_switch_map) {
1650 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1651 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1652}
1653
[email protected]e2ddbc92010-10-15 20:02:071654void FlagsState::ConvertFlagsToSwitches(
1655 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071656 if (command_line->HasSwitch(switches::kNoExperiments))
1657 return;
1658
1659 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001660
[email protected]a314ee5a2010-10-26 21:23:281661 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071662
[email protected]a82744532011-02-11 16:15:531663 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191664 for (size_t i = 0; i < num_experiments; ++i) {
1665 const Experiment& e = experiments[i];
1666 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441667 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1668 e.command_line_value, &name_to_switch_map);
1669 } else if (e.type == Experiment::MULTI_VALUE) {
1670 for (int j = 0; j < e.num_choices; ++j) {
1671 SetFlagToSwitchMapping(e.NameForChoice(j),
1672 e.choices[j].command_line_switch,
1673 e.choices[j].command_line_value,
1674 &name_to_switch_map);
1675 }
[email protected]8a6ff28d2010-12-02 16:35:191676 } else {
[email protected]83e9fa702013-02-25 19:30:441677 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1678 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1679 &name_to_switch_map);
1680 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1681 e.command_line_value, &name_to_switch_map);
1682 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1683 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191684 }
1685 }
[email protected]e2ddbc92010-10-15 20:02:071686
1687 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531688 flags_switches_.insert(
1689 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1690 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071691 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1692 it != enabled_experiments.end();
1693 ++it) {
1694 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531695 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191696 name_to_switch_map.find(experiment_name);
1697 if (name_to_switch_it == name_to_switch_map.end()) {
1698 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071699 continue;
[email protected]8a6ff28d2010-12-02 16:35:191700 }
[email protected]e2ddbc92010-10-15 20:02:071701
[email protected]a82744532011-02-11 16:15:531702 const std::pair<std::string, std::string>&
1703 switch_and_value_pair = name_to_switch_it->second;
1704
1705 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1706 switch_and_value_pair.second);
1707 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071708 }
1709 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531710 flags_switches_.insert(
1711 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1712 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071713}
1714
1715bool FlagsState::IsRestartNeededToCommitChanges() {
1716 return needs_restart_;
1717}
1718
1719void FlagsState::SetExperimentEnabled(
1720 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441721 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191722 if (at_index != std::string::npos) {
1723 DCHECK(enable);
1724 // We're being asked to enable a multi-choice experiment. Disable the
1725 // currently selected choice.
1726 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221727 const std::string experiment_name = internal_name.substr(0, at_index);
1728 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191729
[email protected]28e35af2011-02-09 12:56:221730 // And enable the new choice, if it is not the default first choice.
1731 if (internal_name != experiment_name + "@0") {
1732 std::set<std::string> enabled_experiments;
1733 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081734 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221735 SetEnabledFlags(prefs, enabled_experiments);
1736 }
[email protected]8a6ff28d2010-12-02 16:35:191737 return;
1738 }
1739
[email protected]ad2a3ded2010-08-27 13:19:051740 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241741 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051742
[email protected]8a6ff28d2010-12-02 16:35:191743 const Experiment* e = NULL;
1744 for (size_t i = 0; i < num_experiments; ++i) {
1745 if (experiments[i].internal_name == internal_name) {
1746 e = experiments + i;
1747 break;
1748 }
1749 }
1750 DCHECK(e);
1751
1752 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591753 if (enable)
[email protected]147492b2013-03-19 23:52:081754 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591755 else
[email protected]147492b2013-03-19 23:52:081756 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191757 } else {
1758 if (enable) {
1759 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081760 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191761 } else {
1762 // Find the currently enabled choice and disable it.
1763 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441764 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191765 if (enabled_experiments.find(choice_name) !=
1766 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081767 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191768 enabled_experiments.erase(choice_name);
1769 // Continue on just in case there's a bug and more than one
1770 // experiment for this choice was enabled.
1771 }
1772 }
1773 }
1774 }
[email protected]ad2a3ded2010-08-27 13:19:051775
[email protected]1a47d7e2010-10-15 00:37:241776 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051777}
1778
[email protected]e2ddbc92010-10-15 20:02:071779void FlagsState::RemoveFlagsSwitches(
1780 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531781 for (std::map<std::string, std::string>::const_iterator
1782 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1783 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071784 }
1785}
1786
[email protected]cb93bf52013-02-20 01:20:001787void FlagsState::ResetAllFlags(PrefService* prefs) {
1788 needs_restart_ = true;
1789
1790 std::set<std::string> no_experiments;
1791 SetEnabledFlags(prefs, no_experiments);
1792}
1793
[email protected]e2ddbc92010-10-15 20:02:071794void FlagsState::reset() {
1795 needs_restart_ = false;
1796 flags_switches_.clear();
1797}
1798
[email protected]38e46812011-05-09 20:49:221799} // namespace
[email protected]e2ddbc92010-10-15 20:02:071800
1801namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191802
1803// WARNING: '@' is also used in the html file. If you update this constant you
1804// also need to update the html file.
1805const char kMultiSeparator[] = "@";
1806
[email protected]e2ddbc92010-10-15 20:02:071807void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551808 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071809}
[email protected]a314ee5a2010-10-26 21:23:281810
1811void SetExperiments(const Experiment* e, size_t count) {
1812 if (!e) {
1813 experiments = kExperiments;
1814 num_experiments = arraysize(kExperiments);
1815 } else {
1816 experiments = e;
1817 num_experiments = count;
1818 }
1819}
1820
[email protected]8a6ff28d2010-12-02 16:35:191821const Experiment* GetExperiments(size_t* count) {
1822 *count = num_experiments;
1823 return experiments;
1824}
1825
[email protected]e2ddbc92010-10-15 20:02:071826} // namespace testing
1827
[email protected]1a47d7e2010-10-15 00:37:241828} // namespace about_flags