blob: 3b9fb06ed766c3577503d5ae159cd4eb5f0220d1 [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]8b1c3c72013-01-25 01:48:4338#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0539
[email protected]f1c39242013-01-29 16:13:0140#if defined(ENABLE_MESSAGE_CENTER)
41#include "ui/message_center/message_center_switches.h"
42#endif
43
[email protected]dc04be7c2012-03-15 23:57:4944#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3145#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4946#endif
47
[email protected]badba1ad2012-11-16 17:21:4648#if defined(OS_CHROMEOS)
49#include "chromeos/chromeos_switches.h"
50#endif
51
[email protected]7f6f44c2011-12-14 13:23:3852using content::UserMetricsAction;
53
[email protected]1a47d7e2010-10-15 00:37:2454namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0555
[email protected]8a6ff28d2010-12-02 16:35:1956// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5357#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4458 Experiment::SINGLE_VALUE, \
59 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5360#define SINGLE_VALUE_TYPE(command_line_switch) \
61 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4462#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
63 disable_switch, disable_value) \
64 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
65 disable_switch, disable_value, NULL, 3
66#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
67 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5368#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4469 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1970
[email protected]e2ddbc92010-10-15 20:02:0771namespace {
72
[email protected]9c7453d2012-01-21 00:45:4073const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5674const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0575
[email protected]cc3e2052011-12-20 01:01:4076// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
77// whether the experiment is available on that platform.
78void AddOsStrings(unsigned bitmask, ListValue* list) {
79 struct {
80 unsigned bit;
81 const char* const name;
82 } kBitsToOs[] = {
83 {kOsMac, "Mac"},
84 {kOsWin, "Windows"},
85 {kOsLinux, "Linux"},
86 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0187 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4088 };
89 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
90 if (bitmask & kBitsToOs[i].bit)
91 list->Append(new StringValue(kBitsToOs[i].name));
92}
93
[email protected]68317802012-06-07 19:13:2394const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
95 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
97 switches::kOmniboxHistoryQuickProviderNewScoring,
98 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
99 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
100 switches::kOmniboxHistoryQuickProviderNewScoring,
101 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
102};
103
[email protected]128dc6c2012-06-22 20:30:35104const Experiment::Choice
105 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
106 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
107 "",
108 "" },
109 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
110 switches::kOmniboxHistoryQuickProviderReorderForInlining,
111 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
112 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
113 switches::kOmniboxHistoryQuickProviderReorderForInlining,
114 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
115};
116
[email protected]032d5e6c2012-02-17 17:53:55117const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
118 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
119 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
120 switches::kOmniboxInlineHistoryQuickProvider,
121 switches::kOmniboxInlineHistoryQuickProviderAllowed },
122 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
123 switches::kOmniboxInlineHistoryQuickProvider,
124 switches::kOmniboxInlineHistoryQuickProviderProhibited }
125};
126
[email protected]fb854192013-02-06 01:30:04127const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
128 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
129 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
130 switches::kEnableCompositingForFixedPosition, ""},
131 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
132 switches::kDisableCompositingForFixedPosition, ""},
133 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
134 switches::kEnableHighDpiCompositingForFixedPosition, ""}
135};
136
[email protected]8b1c3c72013-01-25 01:48:43137const Experiment::Choice kGDIPresentChoices[] = {
138 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
139 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
140 switches::kDoFirstShowPresentWithGDI, ""},
141 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
142 switches::kDoAllShowPresentWithGDI, ""}
143};
144
[email protected]d7932532012-11-21 21:10:31145const Experiment::Choice kTouchEventsChoices[] = {
146 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
147 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
148 switches::kTouchEvents,
149 switches::kTouchEventsEnabled },
150 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
151 switches::kTouchEvents,
152 switches::kTouchEventsDisabled }
153};
154
[email protected]347a0c72012-05-14 20:28:06155const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31156 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20157 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06158 switches::kTouchOptimizedUI,
159 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20160 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06161 switches::kTouchOptimizedUI,
162 switches::kTouchOptimizedUIDisabled }
163};
164
[email protected]66f409c2012-10-04 20:59:04165const Experiment::Choice kNaClDebugMaskChoices[] = {
166 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
167 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
168 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
169 // an option to switch off its debugging.
170 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
171 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
172 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
173 switches::kNaClDebugMask, "*://*/*debug.nmf" }
174};
175
[email protected]ea2f3342012-09-21 21:13:36176#if defined(OS_CHROMEOS)
177const Experiment::Choice kAshBootAnimationFunction[] = {
178 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
179 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
180 ash::switches::kAshBootAnimationFunction2, ""},
181 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
182 ash::switches::kAshBootAnimationFunction3, ""}
183};
[email protected]d96aef22012-10-30 11:47:02184
185const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19186 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02187 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19188 switches::kEnableChromeCaptivePortalDetector, ""},
189 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
190 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02191};
[email protected]a78c7432013-03-13 06:22:43192
[email protected]ea2f3342012-09-21 21:13:36193#endif
194
[email protected]9323fdd12013-02-23 00:31:36195const Experiment::Choice kImplSidePaintingChoices[] = {
196 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
197 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
198 cc::switches::kEnableImplSidePainting, ""},
199 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
200 cc::switches::kDisableImplSidePainting, ""}
201};
202
[email protected]4bc5050c2010-11-18 17:55:54203// RECORDING USER METRICS FOR FLAGS:
204// -----------------------------------------------------------------------------
205// The first line of the experiment is the internal name. If you'd like to
206// gather statistics about the usage of your flag, you should append a marker
207// comment to the end of the feature name, like so:
208// "my-special-feature", // FLAGS:RECORD_UMA
209//
210// After doing that, run //chrome/tools/extract_actions.py (see instructions at
211// the top of that file for details) to update the chromeactions.txt file, which
212// will enable UMA to record your feature flag.
213//
[email protected]783d5bb2012-10-24 03:47:14214// After your feature has shipped under a flag, you can locate the metrics under
215// the action name AboutFlags_internal-action-name. Actions are recorded once
216// per startup, so you should divide this number by AboutFlags_StartupTick to
217// get a sense of usage. Note that this will not be the same as number of users
218// with a given feature enabled because users can quit and relaunch the
219// application multiple times over a given time interval. The dashboard also
220// shows you how many (metrics reporting) users have enabled the flag over the
221// last seven days. However, note that this is not the same as the number of
222// users who have the flag enabled, since enabling the flag happens once,
223// whereas running with the flag enabled happens until the user flips the flag
224// again.
[email protected]4bc5050c2010-11-18 17:55:54225
[email protected]8a6ff28d2010-12-02 16:35:19226// To add a new experiment add to the end of kExperiments. There are two
227// distinct types of experiments:
228// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
229// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22230// . MULTI_VALUE: a list of choices, the first of which should correspond to a
231// deactivated state for this lab (i.e. no command line option). To specify
232// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
233// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19234// See the documentation of Experiment for details on the fields.
235//
236// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05237const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44238#if defined(OS_ANDROID)
239 {
[email protected]199def22013-02-21 17:52:29240 "enable-spdy-proxy-auth",
241 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
242 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44243 kOsAndroid,
[email protected]199def22013-02-21 17:52:29244 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44245 },
246#endif
[email protected]ad2a3ded2010-08-27 13:19:05247 {
[email protected]aac169d2011-03-18 19:53:03248 "expose-for-tabs", // FLAGS:RECORD_UMA
249 IDS_FLAGS_TABPOSE_NAME,
250 IDS_FLAGS_TABPOSE_DESCRIPTION,
251 kOsMac,
252#if defined(OS_MACOSX)
253 // The switch exists only on OS X.
254 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
255#else
256 SINGLE_VALUE_TYPE("")
257#endif
258 },
259 {
[email protected]4bc5050c2010-11-18 17:55:54260 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05261 IDS_FLAGS_CONFLICTS_CHECK_NAME,
262 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
263 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19264 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05265 },
266 {
[email protected]4bc5050c2010-11-18 17:55:54267 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54268 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
269 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45270 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22271 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31272 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22273 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
274 // always have PDF rasterization available, so no flag needed there.
275#if !defined(GOOGLE_CHROME_BUILD)
276 kOsWin,
277#else
278 0,
[email protected]fa6d2a2f2010-11-30 21:47:19279#endif
[email protected]8a6ff28d2010-12-02 16:35:19280 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42281 },
[email protected]60d77bd2012-08-22 00:10:07282#if defined(OS_WIN)
283 {
284 "print-raster",
285 IDS_FLAGS_PRINT_RASTER_NAME,
286 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
287 kOsWin,
288 SINGLE_VALUE_TYPE(switches::kPrintRaster)
289 },
290#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05291 {
[email protected]96c6f4c2011-05-18 19:36:22292 "ignore-gpu-blacklist",
293 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
294 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
295 kOsAll,
296 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
297 },
298 {
[email protected]0110cf112011-07-02 00:39:43299 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22300 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
301 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23302 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44303 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
304 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22305 },
306 {
[email protected]72787e392012-03-23 05:55:43307 "threaded-compositing-mode",
308 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
309 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56310 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44311 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
312 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59313 },
314 {
[email protected]17e27692013-02-06 17:02:09315 "force-accelerated-composited-scrolling",
316 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
317 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
318 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44319 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
320 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09321 },
322 {
[email protected]8b1c3c72013-01-25 01:48:43323 "present-with-GDI",
324 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
325 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
326 kOsWin,
327 MULTI_VALUE_TYPE(kGDIPresentChoices)
328 },
329 {
[email protected]81c64af62012-06-06 20:15:52330 "disable-accelerated-2d-canvas",
331 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
332 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
333 kOsAll,
334 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
335 },
336 {
[email protected]efcde132012-05-30 01:05:18337 "disable-threaded-animation",
338 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
339 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59340 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37341 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59342 },
343 {
[email protected]5963b772011-02-09 22:55:38344 "composited-layer-borders",
345 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
346 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
347 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57348 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38349 },
350 {
[email protected]a8f1eaa2011-03-07 19:00:58351 "show-fps-counter",
352 IDS_FLAGS_SHOW_FPS_COUNTER,
353 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
354 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57355 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58356 },
[email protected]8ff7f342011-05-25 01:49:47357 {
[email protected]70c98a332011-12-21 20:51:52358 "accelerated-filters",
359 IDS_FLAGS_ACCELERATED_FILTERS,
360 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
361 kOsAll,
362 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
363 },
364 {
[email protected]8ff7f342011-05-25 01:49:47365 "disable-gpu-vsync",
366 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
367 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56368 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47369 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
370 },
[email protected]deaba6d52011-09-23 14:47:12371 {
[email protected]4052d832013-01-16 05:31:01372 "enable-webgl",
373 IDS_FLAGS_ENABLE_WEBGL_NAME,
374 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
375 kOsAndroid,
376#if defined(OS_ANDROID)
377 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
378#else
379 SINGLE_VALUE_TYPE("")
380#endif
381 },
382 {
[email protected]deaba6d52011-09-23 14:47:12383 "disable-webgl",
384 IDS_FLAGS_DISABLE_WEBGL_NAME,
385 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56386 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01387#if defined(OS_ANDROID)
388 SINGLE_VALUE_TYPE("")
389#else
[email protected]deaba6d52011-09-23 14:47:12390 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01391#endif
[email protected]deaba6d52011-09-23 14:47:12392 },
[email protected]09096e02012-05-24 11:12:04393 {
[email protected]ce585bf2013-03-14 16:25:16394 "disable-webrtc",
395 IDS_FLAGS_DISABLE_WEBRTC_NAME,
396 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05397 kOsAndroid,
398#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16399 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05400#else
401 SINGLE_VALUE_TYPE("")
402#endif
403 },
404 {
[email protected]96bcdc102012-05-24 23:42:10405 "fixed-position-creates-stacking-context",
406 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
407 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
408 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44409 ENABLE_DISABLE_VALUE_TYPE(
410 switches::kEnableFixedPositionCreatesStackingContext,
411 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10412 },
[email protected]fb854192013-02-06 01:30:04413 {
414 "enable-compositing-for-fixed-position",
415 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
416 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
417 kOsAll,
418 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
419 },
[email protected]a7640ef22012-10-06 00:52:08420 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53421 {
[email protected]e3791ce92011-08-09 01:03:32422 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40423 IDS_FLAGS_ENABLE_NACL_NAME,
424 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56425 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19426 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40427 },
[email protected]b39c6d92012-01-31 16:38:41428 // TODO(halyavin): When exception handling is on by default, replace this
429 // flag with disable-nacl-exception-handling.
430 {
431 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
432 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
433 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56434 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41435 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
436 },
[email protected]4ff87d202010-11-06 01:28:40437 {
[email protected]9addd1c2012-09-15 14:28:24438 "enable-nacl-debug", // FLAGS:RECORD_UMA
439 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
440 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56441 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24442 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13443 },
444 {
[email protected]66f409c2012-10-04 20:59:04445 "nacl-debug-mask", // FLAGS:RECORD_UMA
446 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
447 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56448 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04449 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
450 },
451 {
[email protected]7babd1c2012-08-08 20:35:29452 "enable-pnacl", // FLAGS:RECORD_UMA
453 IDS_FLAGS_ENABLE_PNACL_NAME,
454 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56455 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29456 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
457 },
458 {
[email protected]4bc5050c2010-11-18 17:55:54459 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32460 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
461 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56462 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19463 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32464 },
[email protected]3627b06d2010-11-12 16:36:16465 {
[email protected]ac2e2acd2013-03-21 12:57:29466 "extensions-on-chrome-urls",
467 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
468 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
469 kOsAll,
470 SINGLE_VALUE_TYPE(switches::kExtensionsOnChromeURLs)
471 },
472 {
[email protected]e9cddd52013-03-23 17:37:53473 "enable-adview",
474 IDS_FLAGS_ENABLE_ADVIEW_NAME,
475 IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION,
476 kOsDesktop,
477 SINGLE_VALUE_TYPE(switches::kEnableAdview)
478 },
479 {
480 "enable-adview-src-attribute",
481 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME,
482 IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION,
483 kOsDesktop,
484 SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute)
485 },
486 {
[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]a5e9faa2013-03-19 09:58:38565 "enable-sync-favicons",
566 IDS_FLAGS_ENABLE_SYNC_FAVICONS_NAME,
567 IDS_FLAGS_ENABLE_SYNC_FAVICONS_DESCRIPTION,
[email protected]fdf4e252012-04-27 00:26:55568 kOsAll,
[email protected]a5e9faa2013-03-19 09:58:38569 SINGLE_VALUE_TYPE(switches::kEnableSyncFavicons)
[email protected]fdf4e252012-04-27 00:26:55570 },
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,
[email protected]06ca05d2013-03-13 19:12:47583 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
584 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35585 },
586 {
[email protected]a22ebd812011-06-23 00:05:39587 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
588 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
589 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
590 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40591 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25592 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39593 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
594 },
[email protected]81a6b0b2011-06-24 17:55:40595 {
[email protected]68317802012-06-07 19:13:23596 "omnibox-history-quick-provider-new-scoring",
597 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
598 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
599 kOsAll,
600 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
601 },
602 {
[email protected]128dc6c2012-06-22 20:30:35603 "omnibox-history-quick-provider-reorder-for-inlining",
604 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
605 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
606 kOsAll,
607 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
608 },
609 {
[email protected]032d5e6c2012-02-17 17:53:55610 "omnibox-inline-history-quick-provider",
611 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
612 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
613 kOsAll,
614 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
615 },
616 {
[email protected]7e7a28092011-12-09 22:24:55617 "enable-panels",
618 IDS_FLAGS_ENABLE_PANELS_NAME,
619 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56620 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55621 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54622 },
[email protected]e3749d12011-07-25 22:22:12623 {
[email protected]27c14f02012-06-22 17:29:58624 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27625 "save-page-as-mhtml", // FLAGS:RECORD_UMA
626 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
627 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
628 kOsMac | kOsWin | kOsLinux,
629 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
630 },
631 {
[email protected]b7bb44f2011-09-01 05:17:03632 "enable-autologin",
633 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
634 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
635 kOsMac | kOsWin | kOsLinux,
636 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
637 },
[email protected]b9841172011-09-26 23:36:09638 {
[email protected]14371cb2013-03-21 07:46:12639 "enable-spdy31",
640 IDS_FLAGS_ENABLE_SPDY31_NAME,
641 IDS_FLAGS_ENABLE_SPDY31_DESCRIPTION,
[email protected]3231b612012-03-23 05:57:54642 kOsAll,
[email protected]14371cb2013-03-21 07:46:12643 SINGLE_VALUE_TYPE(switches::kEnableSpdy31)
[email protected]3231b612012-03-23 05:57:54644 },
645 {
[email protected]27b3fe92012-03-21 05:35:06646 "enable-async-dns",
647 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
648 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46649 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44650 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
651 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06652 },
653 {
[email protected]1eb93802012-09-11 18:57:56654 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11655 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
656 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32657 kOsAll,
[email protected]da43c082012-09-07 18:56:11658 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44659 },
[email protected]e4e68dbb2011-11-18 01:50:22660 {
[email protected]36d98412013-01-31 20:28:53661 "disable-encrypted-media",
662 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
663 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56664 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53665 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03666 },
[email protected]f88628792012-12-18 07:07:50667 {
668 "enable-opus-playback",
669 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
670 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56671 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50672 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
673 },
[email protected]ca6eaa5a2013-01-24 16:16:04674 {
[email protected]c54e1aa2013-01-25 09:26:17675 "enable-vp9-playback",
676 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
677 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
678 kOsDesktop,
679 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
680 },
681 {
[email protected]ca6eaa5a2013-01-24 16:16:04682 "enable-managed-users",
683 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
684 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
685 kOsAll,
686 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
687 },
[email protected]dc04be7c2012-03-15 23:57:49688#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50689 {
[email protected]cda278d2012-10-30 20:31:40690 "ash-disable-auto-window-placement",
691 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
692 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
693 kOsWin | kOsLinux | kOsCrOS,
694 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
695 },
[email protected]b4e4ec42012-11-29 21:42:40696 {
[email protected]16f55a22013-02-13 23:47:34697 "ash-disable-per-app-launcher",
698 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
699 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40700 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34701 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40702 },
[email protected]dc04be7c2012-03-15 23:57:49703#endif
[email protected]eaae8b462012-01-20 22:20:39704 {
[email protected]db543d322011-12-15 20:40:15705 "per-tile-painting",
706 IDS_FLAGS_PER_TILE_PAINTING_NAME,
707 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37708 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37709 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15710 },
[email protected]bf88c032011-12-22 19:05:47711 {
712 "enable-javascript-harmony",
713 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
714 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
715 kOsAll,
716 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
717 },
[email protected]7e7f378a2012-01-05 14:35:37718 {
[email protected]85646172012-01-09 22:45:54719 "enable-tab-browser-dragging",
720 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
721 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
722 kOsWin,
723 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
724 },
725 {
[email protected]068b7b52012-02-27 12:41:44726 "disable-restore-session-state",
727 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
728 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37729 kOsAll,
[email protected]068b7b52012-02-27 12:41:44730 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37731 },
[email protected]88864db2012-01-18 20:56:35732 {
733 "disable-software-rasterizer",
734 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
735 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
736#if defined(ENABLE_SWIFTSHADER)
737 kOsAll,
738#else
739 0,
740#endif
741 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
742 },
[email protected]15a5d722012-01-23 09:11:14743 {
[email protected]ff7b6dd2012-09-15 20:20:03744 "enable-experimental-webkit-features",
745 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
746 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16747 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03748 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49749 },
750 {
[email protected]0f95a252012-09-13 22:30:04751 "enable-css-shaders",
752 IDS_FLAGS_CSS_SHADERS_NAME,
753 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
754 kOsAll,
755 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
756 },
757 {
[email protected]9860c68b2012-02-02 01:58:09758 "enable-extension-activity-ui",
759 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
760 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56761 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09762 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00763 },
[email protected]54ae4e92012-02-16 15:19:05764 {
[email protected]3e8befc2012-03-13 01:17:03765 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16766 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
767 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56768 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03769 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16770 },
[email protected]dc04be7c2012-03-15 23:57:49771#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01772 {
[email protected]3cd198a22012-03-12 20:38:01773 "enable-ash-oak",
774 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
775 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
776 kOsAll,
777 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
778 },
[email protected]31cf1c52012-02-29 20:55:01779#endif
[email protected]184ec592012-03-01 11:54:28780 {
781 "enable-devtools-experiments",
782 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
783 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56784 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28785 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
786 },
[email protected]76d1854e2012-03-02 23:57:44787 {
[email protected]2fefdb32013-02-26 14:28:10788 "silent-debugger-extension-api",
789 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
790 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
791 kOsDesktop,
792 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
793 },
794 {
[email protected]76d1854e2012-03-02 23:57:44795 "enable-suggestions-ntp",
796 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
797 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56798 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44799 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
800 },
[email protected]a3d54252012-04-05 20:04:13801 {
[email protected]1dbaf5e2012-11-30 05:51:32802 "spellcheck-autocorrect",
803 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
804 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
805 kOsWin | kOsLinux | kOsCrOS,
806 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
807 },
808 {
[email protected]d7932532012-11-21 21:10:31809 "touch-events",
810 IDS_TOUCH_EVENTS_NAME,
811 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56812 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31813 MULTI_VALUE_TYPE(kTouchEventsChoices)
814 },
815 {
[email protected]c9c73ad42012-04-18 03:35:59816 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06817 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
818 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55819 kOsWin,
[email protected]347a0c72012-05-14 20:28:06820 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59821 },
[email protected]8a6aaa72012-04-20 20:53:58822 {
[email protected]b9c96ff2012-11-26 22:24:40823 "disable-touch-adjustment",
824 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
825 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
826 kOsWin | kOsLinux | kOsCrOS,
827 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
828 },
829 {
[email protected]0b9383a2012-10-26 00:58:16830 "enable-tab-capture",
831 IDS_ENABLE_TAB_CAPTURE_NAME,
832 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25833 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44834 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
835 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16836 },
[email protected]0b60afa2012-04-19 17:36:39837#if defined(OS_CHROMEOS)
838 {
[email protected]7c4a9bc2012-09-11 22:10:05839 "enable-background-loader",
840 IDS_ENABLE_BACKLOADER_NAME,
841 IDS_ENABLE_BACKLOADER_DESCRIPTION,
842 kOsCrOS,
843 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
844 },
845 {
[email protected]c5667b282012-08-31 00:32:50846 "enable-bezel-touch",
847 IDS_ENABLE_BEZEL_TOUCH_NAME,
848 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47849 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50850 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47851 },
852 {
[email protected]3f4181a2013-02-01 21:31:07853 "enable-screensaver-extension",
854 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
855 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
856 kOsCrOS,
857 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
858 },
859 {
[email protected]0b60afa2012-04-19 17:36:39860 "no-discard-tabs",
861 IDS_FLAGS_NO_DISCARD_TABS_NAME,
862 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
863 kOsCrOS,
864 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
865 },
866#endif
[email protected]79be6d32012-04-24 20:47:44867 {
[email protected]8d68a3e02013-01-12 15:57:10868 "enable-download-resumption",
869 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
870 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56871 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10872 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
873 },
874 {
[email protected]9a5940d2012-04-27 19:16:23875 "allow-nacl-socket-api",
876 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
877 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56878 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23879 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
880 },
[email protected]85333732012-05-01 19:02:24881 {
[email protected]60673ad72012-05-02 06:16:33882 "stacked-tab-strip",
883 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
884 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
885 kOsWin,
886 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
887 },
888 {
[email protected]4bd20202012-06-14 17:35:01889 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24890 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
891 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
892 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01893 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24894 },
[email protected]190349fd2012-05-02 00:10:47895#if defined(OS_CHROMEOS)
896 {
897 "allow-touchpad-three-finger-click",
898 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
899 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
900 kOsCrOS,
901 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
902 },
[email protected]fbc176b62012-10-27 02:19:58903 {
904 "allow-touchpad-three-finger-swipe",
905 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
906 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
907 kOsCrOS,
908 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
909 },
[email protected]190349fd2012-05-02 00:10:47910#endif
[email protected]1992a2f42012-10-23 18:32:21911 {
[email protected]a585e462013-01-26 00:37:15912 "use-client-login-signin-flow",
913 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
914 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21915 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15916 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21917 },
[email protected]8ee02242012-12-04 15:23:32918 {
919 "enable-desktop-guest-mode",
920 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
921 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
922 kOsMac | kOsWin | kOsLinux,
923 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
924 },
[email protected]53520b1b2012-05-07 21:43:37925#if defined(USE_ASH)
926 {
[email protected]8257d382013-03-26 13:08:42927 "show-launcher-alignment-menu",
928 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
929 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42930 kOsAll,
[email protected]8257d382013-03-26 13:08:42931 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42932 },
933 {
[email protected]73074742012-05-17 01:44:41934 "show-touch-hud",
935 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
936 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
937 kOsAll,
938 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
939 },
940 {
[email protected]9f0940b62012-05-23 22:56:35941 "enable-pinch",
942 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
943 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06944 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35945 SINGLE_VALUE_TYPE(switches::kEnablePinch),
946 },
[email protected]a8379312012-06-15 00:20:43947 {
948 "app-list-show-apps-only",
949 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
950 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
951 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03952 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43953 },
[email protected]73074742012-05-17 01:44:41954#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28955#if defined(OS_CHROMEOS)
956 {
[email protected]8b04a1652012-08-04 02:59:49957 "disable-boot-animation",
958 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
959 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
960 kOsCrOS,
961 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
962 },
[email protected]95058572012-08-20 14:57:29963 {
[email protected]b4557192012-09-19 11:29:58964 "disable-boot-animation2",
965 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
966 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
967 kOsCrOS,
968 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
969 },
970 {
[email protected]ea2f3342012-09-21 21:13:36971 "boot-animation-fucntion",
972 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
973 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
974 kOsCrOS,
975 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
976 },
[email protected]839667d62012-10-23 19:38:57977 {
[email protected]d96aef22012-10-30 11:47:02978 "captive-portal-detector",
979 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
980 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
981 kOsCrOS,
982 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
983 },
984 {
[email protected]c11aa8f12012-12-18 18:43:14985 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57986 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
987 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
988 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14989 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57990 },
[email protected]f0280952012-11-06 20:30:50991 {
[email protected]0fb5c4852012-11-08 20:33:23992 "file-manager-packaged",
993 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
994 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
995 kOsCrOS,
996 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
997 },
[email protected]3e035e82012-11-27 20:54:32998 {
[email protected]8039e06c2013-01-17 23:34:50999 "disable-launcher-per-display",
1000 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1001 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351002 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501003 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351004 },
[email protected]06b146d2013-02-07 06:06:471005 {
[email protected]c64d7732013-03-25 18:09:501006 "disable-app-mode",
[email protected]640aa2b2013-03-22 16:00:521007 IDS_FLAGS_DISABLE_KIOSK_APPS_NAME,
1008 IDS_FLAGS_DISABLE_KIOSK_APPS_DESCRIPTION,
[email protected]06b146d2013-02-07 06:06:471009 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521010 SINGLE_VALUE_TYPE(switches::kDisableAppMode),
[email protected]06b146d2013-02-07 06:06:471011 },
[email protected]6ad015c2013-03-06 00:49:511012 {
[email protected]c64d7732013-03-25 18:09:501013 "disable-force-fullscreen-app",
[email protected]640aa2b2013-03-22 16:00:521014 IDS_FLAGS_DISABLE_FULLSCREEN_APP_NAME,
1015 IDS_FLAGS_DISABLE_FULLSCREEN_APP_DESCRIPTION,
[email protected]6ad015c2013-03-06 00:49:511016 kOsCrOS,
[email protected]640aa2b2013-03-22 16:00:521017 SINGLE_VALUE_TYPE(switches::kDisableFullscreenApp),
[email protected]6ad015c2013-03-06 00:49:511018 },
[email protected]62018dc2012-12-13 00:37:351019#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391020 {
[email protected]6247aba2013-03-04 22:57:181021 "views-textfield",
1022 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1023 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391024 kOsWin,
[email protected]6247aba2013-03-04 22:57:181025 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1026 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391027 },
[email protected]bd0cd3bb2012-06-14 03:03:381028 {
[email protected]2d4817742012-12-17 20:16:181029 "enable-new-dialog-style",
1030 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1031 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321032 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181033 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321034 },
[email protected]7db8893a2012-07-26 00:49:401035 { "disable-accelerated-video-decode",
1036 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1037 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561038 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401039 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151040 },
[email protected]66ae9fc2012-06-19 21:33:521041#if defined(USE_ASH)
1042 {
1043 "ash-debug-shortcuts",
1044 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1045 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1046 kOsAll,
1047 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1048 },
1049#endif
[email protected]37fee0942012-08-07 21:07:451050 {
[email protected]ad3f6d22012-08-29 02:34:191051 "enable-contacts",
1052 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1053 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1054 kOsCrOS,
1055 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1056 },
[email protected]1d9bb9cd2012-08-28 22:02:501057#if defined(USE_ASH)
1058 { "ash-enable-advanced-gestures",
1059 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1060 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1061 kOsCrOS,
1062 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1063 },
[email protected]cfa24e62013-02-13 21:19:111064 { "ash-disable-tab-scrubbing",
1065 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1066 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161067 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111068 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161069 },
[email protected]83eef802012-12-02 07:43:521070 { "ash-enable-workspace-scrubbing",
1071 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1072 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1073 kOsCrOS,
1074 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1075 },
[email protected]819e58d22013-03-20 00:16:111076 { "ash-immersive-fullscreen",
1077 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME,
1078 IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241079 kOsCrOS,
[email protected]819e58d22013-03-20 00:16:111080 SINGLE_VALUE_TYPE(ash::switches::kAshImmersiveFullscreen),
[email protected]c043df272012-11-21 00:43:241081 },
[email protected]316708a2012-11-05 22:57:021082#if defined(OS_LINUX)
1083 { "ash-enable-memory-monitor",
1084 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1085 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1086 kOsCrOS,
1087 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1088 },
1089#endif
[email protected]1d9bb9cd2012-08-28 22:02:501090#endif
[email protected]9b7ab882012-09-10 23:46:361091#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091092 { "ash-disable-new-network-status-area",
1093 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1094 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461095 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091096 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461097 },
[email protected]9b7ab882012-09-10 23:46:361098 {
[email protected]205f07892012-10-16 20:26:221099 "enable-carrier-switching",
1100 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1101 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1102 kOsCrOS,
1103 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1104 },
1105 {
[email protected]9b7ab882012-09-10 23:46:361106 "enable-request-tablet-site",
1107 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1108 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1109 kOsCrOS,
1110 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1111 },
1112#endif
[email protected]dab49c0b2012-10-04 05:55:351113 {
1114 "debug-packed-apps",
1115 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1116 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561117 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351118 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1119 },
[email protected]d1459ed2012-10-10 01:29:331120 {
1121 "enable-password-generation",
1122 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1123 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561124 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331125 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1126 },
[email protected]26d045f2012-10-18 21:18:431127 {
[email protected]76f7d4882012-10-26 21:09:221128 "enable-deferred-image-decoding",
1129 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1130 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221131 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221132 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1133 },
1134 {
[email protected]075543d2012-10-24 01:29:141135 "performance-monitor-gathering",
1136 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1137 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1138 kOsAll,
1139 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1140 },
[email protected]783d5bb2012-10-24 03:47:141141 {
[email protected]1fdeac72013-03-19 17:28:431142 "enable-native-autofill-ui",
1143 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME,
1144 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
1145 kOsDesktop,
1146 SINGLE_VALUE_TYPE(switches::kEnableNativeAutofillUi)
1147 },
1148 {
[email protected]99002fd2012-11-06 04:35:521149 "show-app-list-shortcut",
1150 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1151 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1152 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431153 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521154 },
[email protected]a7259fb2012-11-08 06:22:231155 {
1156 "enable-experimental-form-filling",
1157 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1158 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1159 kOsWin | kOsCrOS,
1160 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1161 },
[email protected]6e6efe42013-01-30 00:04:501162 {
[email protected]db3178c2013-03-21 14:54:541163 "wallet-service-use-prod",
1164 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME,
1165 IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION,
1166 kOsCrOS | kOsWin,
1167 SINGLE_VALUE_TYPE(switches::kWalletServiceUseProd)
1168 },
1169 {
[email protected]6e6efe42013-01-30 00:04:501170 "enable-interactive-autocomplete",
1171 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1172 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221173 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501174 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1175 },
[email protected]e42b1f82012-11-16 21:18:461176#if defined(USE_AURA)
1177 {
[email protected]b75ba132013-02-26 19:38:311178 "disable-overscroll-history-navigation",
1179 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1180 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461181 kOsAll,
[email protected]b75ba132013-02-26 19:38:311182 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461183 },
1184#endif
[email protected]edbea622012-11-28 20:39:381185 {
1186 "enable-touch-drag-drop",
1187 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1188 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1189 kOsWin | kOsCrOS,
1190 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1191 },
[email protected]0e2f43b62013-02-21 00:47:151192 {
1193 "enable-touch-editing",
1194 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1195 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1196 kOsCrOS,
1197 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1198 },
[email protected]f1c39242013-01-29 16:13:011199#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201200 {
1201 "enable-rich-notifications",
1202 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1203 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1204 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011205 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201206 },
[email protected]f1c39242013-01-29 16:13:011207#endif
[email protected]4d51c682012-12-11 11:34:551208 {
1209 "full-history-sync",
1210 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1211 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1212 kOsAll,
1213 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1214 },
[email protected]628a69a92012-12-23 04:09:341215 {
[email protected]fd030142013-02-08 02:04:381216 "enable-usermedia-screen-capture",
1217 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1218 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1219 kOsDesktop,
1220 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1221 },
[email protected]5b93e162013-02-19 06:33:091222 {
1223 "enable-apps-devtool-app",
1224 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1225 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1226 kOsDesktop,
1227 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1228 },
[email protected]9323fdd12013-02-23 00:31:361229 {
1230 "impl-side-painting",
1231 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1232 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]532fe2e2013-03-18 17:00:041233 kOsAndroid | kOsLinux | kOsCrOS,
[email protected]9323fdd12013-02-23 00:31:361234 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1235 },
[email protected]2f2f72b2013-03-08 22:37:311236 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1237#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371238 {
1239 "track-active-visit-time",
1240 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1241 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1242 kOsWin,
1243 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1244 },
[email protected]2f2f72b2013-03-08 22:37:311245#endif
[email protected]8cc71d42013-03-02 17:26:081246#if defined(OS_ANDROID)
1247 {
1248 "disable-gesture-requirement-for-media-playback",
1249 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1250 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1251 kOsAndroid,
1252 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1253 },
1254#endif
[email protected]e79f2fd52013-03-08 23:52:471255#if defined(OS_CHROMEOS)
1256 {
1257 "enable-experimental-bluetooth",
1258 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1259 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1260 kOsCrOS,
1261 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1262 },
1263#endif
[email protected]6077cab2013-03-11 19:36:141264#if defined(ENABLE_GOOGLE_NOW)
1265 {
1266 "enable-google-now",
1267 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1268 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1269 kOsWin | kOsCrOS,
1270 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1271 },
1272#endif
[email protected]a0e4b072011-08-17 01:47:071273};
[email protected]ad2a3ded2010-08-27 13:19:051274
[email protected]a314ee5a2010-10-26 21:23:281275const Experiment* experiments = kExperiments;
1276size_t num_experiments = arraysize(kExperiments);
1277
[email protected]e2ddbc92010-10-15 20:02:071278// Stores and encapsulates the little state that about:flags has.
1279class FlagsState {
1280 public:
1281 FlagsState() : needs_restart_(false) {}
1282 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1283 bool IsRestartNeededToCommitChanges();
1284 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281285 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071286 void RemoveFlagsSwitches(
1287 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001288 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071289 void reset();
1290
1291 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551292 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071293 return Singleton<FlagsState>::get();
1294 }
1295
1296 private:
1297 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531298 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071299
1300 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1301};
1302
[email protected]c7b7800a2010-10-07 18:51:351303// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491304// in a set.
[email protected]1a47d7e2010-10-15 00:37:241305void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051306 const ListValue* enabled_experiments = prefs->GetList(
1307 prefs::kEnabledLabsExperiments);
1308 if (!enabled_experiments)
1309 return;
1310
1311 for (ListValue::const_iterator it = enabled_experiments->begin();
1312 it != enabled_experiments->end();
1313 ++it) {
1314 std::string experiment_name;
1315 if (!(*it)->GetAsString(&experiment_name)) {
1316 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1317 continue;
1318 }
1319 result->insert(experiment_name);
1320 }
1321}
1322
[email protected]c6343372013-03-13 17:05:491323// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241324void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051325 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381326 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1327 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051328
1329 experiments_list->Clear();
1330 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1331 it != enabled_experiments.end();
1332 ++it) {
1333 experiments_list->Append(new StringValue(*it));
1334 }
1335}
1336
[email protected]8a6ff28d2010-12-02 16:35:191337// Adds the internal names for the specified experiment to |names|.
1338void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1339 if (e.type == Experiment::SINGLE_VALUE) {
1340 names->insert(e.internal_name);
1341 } else {
[email protected]83e9fa702013-02-25 19:30:441342 DCHECK(e.type == Experiment::MULTI_VALUE ||
1343 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191344 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441345 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191346 }
1347}
1348
[email protected]28e35af2011-02-09 12:56:221349// Confirms that an experiment is valid, used in a DCHECK in
1350// SanitizeList below.
1351bool ValidateExperiment(const Experiment& e) {
1352 switch (e.type) {
1353 case Experiment::SINGLE_VALUE:
1354 DCHECK_EQ(0, e.num_choices);
1355 DCHECK(!e.choices);
1356 break;
1357 case Experiment::MULTI_VALUE:
1358 DCHECK_GT(e.num_choices, 0);
1359 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531360 DCHECK(e.choices[0].command_line_switch);
1361 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221362 break;
[email protected]83e9fa702013-02-25 19:30:441363 case Experiment::ENABLE_DISABLE_VALUE:
1364 DCHECK_EQ(3, e.num_choices);
1365 DCHECK(!e.choices);
1366 DCHECK(e.command_line_switch);
1367 DCHECK(e.command_line_value);
1368 DCHECK(e.disable_command_line_switch);
1369 DCHECK(e.disable_command_line_value);
1370 break;
[email protected]28e35af2011-02-09 12:56:221371 default:
1372 NOTREACHED();
1373 }
1374 return true;
1375}
1376
[email protected]ad2a3ded2010-08-27 13:19:051377// Removes all experiments from prefs::kEnabledLabsExperiments that are
1378// unknown, to prevent this list to become very long as experiments are added
1379// and removed.
1380void SanitizeList(PrefService* prefs) {
1381 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221382 for (size_t i = 0; i < num_experiments; ++i) {
1383 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191384 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221385 }
[email protected]ad2a3ded2010-08-27 13:19:051386
1387 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241388 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051389
1390 std::set<std::string> new_enabled_experiments;
1391 std::set_intersection(
1392 known_experiments.begin(), known_experiments.end(),
1393 enabled_experiments.begin(), enabled_experiments.end(),
1394 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1395
[email protected]4c8853f2012-07-23 01:29:161396 if (new_enabled_experiments != enabled_experiments)
1397 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051398}
1399
[email protected]1a47d7e2010-10-15 00:37:241400void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051401 PrefService* prefs, std::set<std::string>* result) {
1402 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241403 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051404}
1405
[email protected]a314ee5a2010-10-26 21:23:281406// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1407// enabled on the current platform.
1408void GetSanitizedEnabledFlagsForCurrentPlatform(
1409 PrefService* prefs, std::set<std::string>* result) {
1410 GetSanitizedEnabledFlags(prefs, result);
1411
1412 // Filter out any experiments that aren't enabled on the current platform. We
1413 // don't remove these from prefs else syncing to a platform with a different
1414 // set of experiments would be lossy.
1415 std::set<std::string> platform_experiments;
1416 int current_platform = GetCurrentPlatform();
1417 for (size_t i = 0; i < num_experiments; ++i) {
1418 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191419 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281420 }
1421
1422 std::set<std::string> new_enabled_experiments;
1423 std::set_intersection(
1424 platform_experiments.begin(), platform_experiments.end(),
1425 result->begin(), result->end(),
1426 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1427
1428 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051429}
1430
[email protected]8a6ff28d2010-12-02 16:35:191431// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191432Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221433 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441434 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1435 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191436 ListValue* result = new ListValue;
1437 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191438 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441439 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191440 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441441 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221442 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191443 result->Append(value);
1444 }
1445 return result;
1446}
1447
[email protected]e2ddbc92010-10-15 20:02:071448} // namespace
1449
[email protected]83e9fa702013-02-25 19:30:441450std::string Experiment::NameForChoice(int index) const {
1451 DCHECK(type == Experiment::MULTI_VALUE ||
1452 type == Experiment::ENABLE_DISABLE_VALUE);
1453 DCHECK_LT(index, num_choices);
1454 return std::string(internal_name) + testing::kMultiSeparator +
1455 base::IntToString(index);
1456}
1457
1458string16 Experiment::DescriptionForChoice(int index) const {
1459 DCHECK(type == Experiment::MULTI_VALUE ||
1460 type == Experiment::ENABLE_DISABLE_VALUE);
1461 DCHECK_LT(index, num_choices);
1462 int description_id;
1463 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1464 const int kEnableDisableDescriptionIds[] = {
1465 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1466 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1467 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1468 };
1469 description_id = kEnableDisableDescriptionIds[index];
1470 } else {
1471 description_id = choices[index].description_id;
1472 }
1473 return l10n_util::GetStringUTF16(description_id);
1474}
1475
[email protected]1a47d7e2010-10-15 00:37:241476void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551477 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051478}
1479
[email protected]1a47d7e2010-10-15 00:37:241480ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051481 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241482 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051483
1484 int current_platform = GetCurrentPlatform();
1485
1486 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281487 for (size_t i = 0; i < num_experiments; ++i) {
1488 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051489
[email protected]1fd1f292013-03-23 23:08:401490#if defined(OS_ANDROID)
1491 // Special case enable-spdy-proxy-auth, because it should only
1492 // be available on Dev and Beta channels.
1493 if (!strcmp("enable-spdy-proxy-auth", experiment.internal_name) &&
1494 chrome::VersionInfo::GetChannel() ==
1495 chrome::VersionInfo::CHANNEL_STABLE)
1496 continue;
1497#endif
1498
[email protected]ad2a3ded2010-08-27 13:19:051499 DictionaryValue* data = new DictionaryValue();
1500 data->SetString("internal_name", experiment.internal_name);
1501 data->SetString("name",
1502 l10n_util::GetStringUTF16(experiment.visible_name_id));
1503 data->SetString("description",
1504 l10n_util::GetStringUTF16(
1505 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401506 bool supported = !!(experiment.supported_platforms & current_platform);
1507 data->SetBoolean("supported", supported);
1508
1509 ListValue* supported_platforms = new ListValue();
1510 AddOsStrings(experiment.supported_platforms, supported_platforms);
1511 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051512
[email protected]28e35af2011-02-09 12:56:221513 switch (experiment.type) {
1514 case Experiment::SINGLE_VALUE:
1515 data->SetBoolean(
1516 "enabled",
1517 enabled_experiments.count(experiment.internal_name) > 0);
1518 break;
1519 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441520 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221521 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1522 break;
1523 default:
1524 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191525 }
1526
[email protected]ad2a3ded2010-08-27 13:19:051527 experiments_data->Append(data);
1528 }
1529 return experiments_data;
1530}
1531
[email protected]ad2a3ded2010-08-27 13:19:051532bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551533 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051534}
1535
1536void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351537 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551538 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071539}
1540
1541void RemoveFlagsSwitches(
1542 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551543 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071544}
1545
[email protected]cb93bf52013-02-20 01:20:001546void ResetAllFlags(PrefService* prefs) {
1547 FlagsState::GetInstance()->ResetAllFlags(prefs);
1548}
1549
[email protected]a314ee5a2010-10-26 21:23:281550int GetCurrentPlatform() {
1551#if defined(OS_MACOSX)
1552 return kOsMac;
1553#elif defined(OS_WIN)
1554 return kOsWin;
1555#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1556 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211557#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281558 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401559#elif defined(OS_ANDROID)
1560 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281561#else
1562#error Unknown platform
1563#endif
1564}
1565
[email protected]4bc5050c2010-11-18 17:55:541566void RecordUMAStatistics(const PrefService* prefs) {
1567 std::set<std::string> flags;
1568 GetEnabledFlags(prefs, &flags);
1569 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1570 ++it) {
1571 std::string action("AboutFlags_");
1572 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381573 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541574 }
1575 // Since flag metrics are recorded every startup, add a tick so that the
1576 // stats can be made meaningful.
1577 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381578 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1579 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541580}
1581
[email protected]e2ddbc92010-10-15 20:02:071582//////////////////////////////////////////////////////////////////////////////
1583// FlagsState implementation.
1584
1585namespace {
1586
[email protected]83e9fa702013-02-25 19:30:441587typedef std::map<std::string, std::pair<std::string, std::string> >
1588 NameToSwitchAndValueMap;
1589
1590void SetFlagToSwitchMapping(const std::string& key,
1591 const std::string& switch_name,
1592 const std::string& switch_value,
1593 NameToSwitchAndValueMap* name_to_switch_map) {
1594 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1595 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1596}
1597
[email protected]e2ddbc92010-10-15 20:02:071598void FlagsState::ConvertFlagsToSwitches(
1599 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071600 if (command_line->HasSwitch(switches::kNoExperiments))
1601 return;
1602
1603 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001604
[email protected]a314ee5a2010-10-26 21:23:281605 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071606
[email protected]a82744532011-02-11 16:15:531607 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191608 for (size_t i = 0; i < num_experiments; ++i) {
1609 const Experiment& e = experiments[i];
1610 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441611 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1612 e.command_line_value, &name_to_switch_map);
1613 } else if (e.type == Experiment::MULTI_VALUE) {
1614 for (int j = 0; j < e.num_choices; ++j) {
1615 SetFlagToSwitchMapping(e.NameForChoice(j),
1616 e.choices[j].command_line_switch,
1617 e.choices[j].command_line_value,
1618 &name_to_switch_map);
1619 }
[email protected]8a6ff28d2010-12-02 16:35:191620 } else {
[email protected]83e9fa702013-02-25 19:30:441621 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1622 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1623 &name_to_switch_map);
1624 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1625 e.command_line_value, &name_to_switch_map);
1626 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1627 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191628 }
1629 }
[email protected]e2ddbc92010-10-15 20:02:071630
1631 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531632 flags_switches_.insert(
1633 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1634 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071635 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1636 it != enabled_experiments.end();
1637 ++it) {
1638 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531639 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191640 name_to_switch_map.find(experiment_name);
1641 if (name_to_switch_it == name_to_switch_map.end()) {
1642 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071643 continue;
[email protected]8a6ff28d2010-12-02 16:35:191644 }
[email protected]e2ddbc92010-10-15 20:02:071645
[email protected]a82744532011-02-11 16:15:531646 const std::pair<std::string, std::string>&
1647 switch_and_value_pair = name_to_switch_it->second;
1648
1649 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1650 switch_and_value_pair.second);
1651 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071652 }
1653 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531654 flags_switches_.insert(
1655 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1656 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071657}
1658
1659bool FlagsState::IsRestartNeededToCommitChanges() {
1660 return needs_restart_;
1661}
1662
1663void FlagsState::SetExperimentEnabled(
1664 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]83e9fa702013-02-25 19:30:441665 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191666 if (at_index != std::string::npos) {
1667 DCHECK(enable);
1668 // We're being asked to enable a multi-choice experiment. Disable the
1669 // currently selected choice.
1670 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221671 const std::string experiment_name = internal_name.substr(0, at_index);
1672 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191673
[email protected]28e35af2011-02-09 12:56:221674 // And enable the new choice, if it is not the default first choice.
1675 if (internal_name != experiment_name + "@0") {
1676 std::set<std::string> enabled_experiments;
1677 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:081678 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]28e35af2011-02-09 12:56:221679 SetEnabledFlags(prefs, enabled_experiments);
1680 }
[email protected]8a6ff28d2010-12-02 16:35:191681 return;
1682 }
1683
[email protected]ad2a3ded2010-08-27 13:19:051684 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241685 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051686
[email protected]8a6ff28d2010-12-02 16:35:191687 const Experiment* e = NULL;
1688 for (size_t i = 0; i < num_experiments; ++i) {
1689 if (experiments[i].internal_name == internal_name) {
1690 e = experiments + i;
1691 break;
1692 }
1693 }
1694 DCHECK(e);
1695
1696 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591697 if (enable)
[email protected]147492b2013-03-19 23:52:081698 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:591699 else
[email protected]147492b2013-03-19 23:52:081700 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191701 } else {
1702 if (enable) {
1703 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:081704 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:191705 } else {
1706 // Find the currently enabled choice and disable it.
1707 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441708 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191709 if (enabled_experiments.find(choice_name) !=
1710 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:081711 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:191712 enabled_experiments.erase(choice_name);
1713 // Continue on just in case there's a bug and more than one
1714 // experiment for this choice was enabled.
1715 }
1716 }
1717 }
1718 }
[email protected]ad2a3ded2010-08-27 13:19:051719
[email protected]1a47d7e2010-10-15 00:37:241720 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051721}
1722
[email protected]e2ddbc92010-10-15 20:02:071723void FlagsState::RemoveFlagsSwitches(
1724 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531725 for (std::map<std::string, std::string>::const_iterator
1726 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1727 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071728 }
1729}
1730
[email protected]cb93bf52013-02-20 01:20:001731void FlagsState::ResetAllFlags(PrefService* prefs) {
1732 needs_restart_ = true;
1733
1734 std::set<std::string> no_experiments;
1735 SetEnabledFlags(prefs, no_experiments);
1736}
1737
[email protected]e2ddbc92010-10-15 20:02:071738void FlagsState::reset() {
1739 needs_restart_ = false;
1740 flags_switches_.clear();
1741}
1742
[email protected]38e46812011-05-09 20:49:221743} // namespace
[email protected]e2ddbc92010-10-15 20:02:071744
1745namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191746
1747// WARNING: '@' is also used in the html file. If you update this constant you
1748// also need to update the html file.
1749const char kMultiSeparator[] = "@";
1750
[email protected]e2ddbc92010-10-15 20:02:071751void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551752 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071753}
[email protected]a314ee5a2010-10-26 21:23:281754
1755void SetExperiments(const Experiment* e, size_t count) {
1756 if (!e) {
1757 experiments = kExperiments;
1758 num_experiments = arraysize(kExperiments);
1759 } else {
1760 experiments = e;
1761 num_experiments = count;
1762 }
1763}
1764
[email protected]8a6ff28d2010-12-02 16:35:191765const Experiment* GetExperiments(size_t* count) {
1766 *count = num_experiments;
1767 return experiments;
1768}
1769
[email protected]e2ddbc92010-10-15 20:02:071770} // namespace testing
1771
[email protected]1a47d7e2010-10-15 00:37:241772} // namespace about_flags