blob: 533b5f9130c49b2f16a379da624e7233901d6f15 [file] [log] [blame]
[email protected]9c66adc2012-01-05 02:10:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]ad2a3ded2010-08-27 13:19:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1a47d7e2010-10-15 00:37:245#include "chrome/browser/about_flags.h"
[email protected]ad2a3ded2010-08-27 13:19:056
7#include <algorithm>
8#include <iterator>
9#include <map>
10#include <set>
[email protected]83e9fa702013-02-25 19:30:4411#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0512
[email protected]7d1d2092013-03-04 04:12:4313#include "apps/switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0514#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1515#include "base/memory/singleton.h"
[email protected]3853a4c2013-02-11 17:15:5716#include "base/prefs/pref_service.h"
[email protected]3ea1b182013-02-08 22:38:4117#include "base/strings/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0318#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0519#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5220#include "cc/base/switches.h"
[email protected]1bc78422011-03-31 08:41:3821#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0322#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0523#include "chrome/common/chrome_switches.h"
24#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3825#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0226#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0527#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0228#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0229#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0330#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1731#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5932#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4833#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2734#include "ui/gl/gl_switches.h"
[email protected]8b1c3c72013-01-25 01:48:4335#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0536
[email protected]f1c39242013-01-29 16:13:0137#if defined(ENABLE_MESSAGE_CENTER)
38#include "ui/message_center/message_center_switches.h"
39#endif
40
[email protected]dc04be7c2012-03-15 23:57:4941#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3142#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4943#endif
44
[email protected]badba1ad2012-11-16 17:21:4645#if defined(OS_CHROMEOS)
46#include "chromeos/chromeos_switches.h"
47#endif
48
[email protected]7f6f44c2011-12-14 13:23:3849using content::UserMetricsAction;
50
[email protected]1a47d7e2010-10-15 00:37:2451namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0552
[email protected]8a6ff28d2010-12-02 16:35:1953// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5354#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4455 Experiment::SINGLE_VALUE, \
56 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5357#define SINGLE_VALUE_TYPE(command_line_switch) \
58 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4459#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
60 disable_switch, disable_value) \
61 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
62 disable_switch, disable_value, NULL, 3
63#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
64 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5365#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4466 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1967
[email protected]e2ddbc92010-10-15 20:02:0768namespace {
69
[email protected]9c7453d2012-01-21 00:45:4070const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5671const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0572
[email protected]cc3e2052011-12-20 01:01:4073// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
74// whether the experiment is available on that platform.
75void AddOsStrings(unsigned bitmask, ListValue* list) {
76 struct {
77 unsigned bit;
78 const char* const name;
79 } kBitsToOs[] = {
80 {kOsMac, "Mac"},
81 {kOsWin, "Windows"},
82 {kOsLinux, "Linux"},
83 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0184 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4085 };
86 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
87 if (bitmask & kBitsToOs[i].bit)
88 list->Append(new StringValue(kBitsToOs[i].name));
89}
90
[email protected]68317802012-06-07 19:13:2391const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
92 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
93 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
94 switches::kOmniboxHistoryQuickProviderNewScoring,
95 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
97 switches::kOmniboxHistoryQuickProviderNewScoring,
98 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
99};
100
[email protected]128dc6c2012-06-22 20:30:35101const Experiment::Choice
102 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
103 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
104 "",
105 "" },
106 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
107 switches::kOmniboxHistoryQuickProviderReorderForInlining,
108 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
109 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
110 switches::kOmniboxHistoryQuickProviderReorderForInlining,
111 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
112};
113
[email protected]032d5e6c2012-02-17 17:53:55114const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
115 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
116 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
117 switches::kOmniboxInlineHistoryQuickProvider,
118 switches::kOmniboxInlineHistoryQuickProviderAllowed },
119 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
120 switches::kOmniboxInlineHistoryQuickProvider,
121 switches::kOmniboxInlineHistoryQuickProviderProhibited }
122};
123
[email protected]fb854192013-02-06 01:30:04124const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = {
125 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
126 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
127 switches::kEnableCompositingForFixedPosition, ""},
128 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
129 switches::kDisableCompositingForFixedPosition, ""},
130 { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI,
131 switches::kEnableHighDpiCompositingForFixedPosition, ""}
132};
133
[email protected]8b1c3c72013-01-25 01:48:43134const Experiment::Choice kGDIPresentChoices[] = {
135 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
136 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
137 switches::kDoFirstShowPresentWithGDI, ""},
138 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
139 switches::kDoAllShowPresentWithGDI, ""}
140};
141
[email protected]d7932532012-11-21 21:10:31142const Experiment::Choice kTouchEventsChoices[] = {
143 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
144 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
145 switches::kTouchEvents,
146 switches::kTouchEventsEnabled },
147 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
148 switches::kTouchEvents,
149 switches::kTouchEventsDisabled }
150};
151
[email protected]347a0c72012-05-14 20:28:06152const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31153 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20154 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06155 switches::kTouchOptimizedUI,
156 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20157 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06158 switches::kTouchOptimizedUI,
159 switches::kTouchOptimizedUIDisabled }
160};
161
[email protected]66f409c2012-10-04 20:59:04162const Experiment::Choice kNaClDebugMaskChoices[] = {
163 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
164 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
165 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
166 // an option to switch off its debugging.
167 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
168 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
169 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
170 switches::kNaClDebugMask, "*://*/*debug.nmf" }
171};
172
[email protected]ea2f3342012-09-21 21:13:36173#if defined(OS_CHROMEOS)
174const Experiment::Choice kAshBootAnimationFunction[] = {
175 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
176 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
177 ash::switches::kAshBootAnimationFunction2, ""},
178 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
179 ash::switches::kAshBootAnimationFunction3, ""}
180};
[email protected]d96aef22012-10-30 11:47:02181
182const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19183 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02184 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19185 switches::kEnableChromeCaptivePortalDetector, ""},
186 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
187 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02188};
[email protected]a78c7432013-03-13 06:22:43189
[email protected]ea2f3342012-09-21 21:13:36190#endif
191
[email protected]9323fdd12013-02-23 00:31:36192const Experiment::Choice kImplSidePaintingChoices[] = {
193 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
194 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
195 cc::switches::kEnableImplSidePainting, ""},
196 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
197 cc::switches::kDisableImplSidePainting, ""}
198};
199
[email protected]4bc5050c2010-11-18 17:55:54200// RECORDING USER METRICS FOR FLAGS:
201// -----------------------------------------------------------------------------
202// The first line of the experiment is the internal name. If you'd like to
203// gather statistics about the usage of your flag, you should append a marker
204// comment to the end of the feature name, like so:
205// "my-special-feature", // FLAGS:RECORD_UMA
206//
207// After doing that, run //chrome/tools/extract_actions.py (see instructions at
208// the top of that file for details) to update the chromeactions.txt file, which
209// will enable UMA to record your feature flag.
210//
[email protected]783d5bb2012-10-24 03:47:14211// After your feature has shipped under a flag, you can locate the metrics under
212// the action name AboutFlags_internal-action-name. Actions are recorded once
213// per startup, so you should divide this number by AboutFlags_StartupTick to
214// get a sense of usage. Note that this will not be the same as number of users
215// with a given feature enabled because users can quit and relaunch the
216// application multiple times over a given time interval. The dashboard also
217// shows you how many (metrics reporting) users have enabled the flag over the
218// last seven days. However, note that this is not the same as the number of
219// users who have the flag enabled, since enabling the flag happens once,
220// whereas running with the flag enabled happens until the user flips the flag
221// again.
[email protected]4bc5050c2010-11-18 17:55:54222
[email protected]8a6ff28d2010-12-02 16:35:19223// To add a new experiment add to the end of kExperiments. There are two
224// distinct types of experiments:
225// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
226// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22227// . MULTI_VALUE: a list of choices, the first of which should correspond to a
228// deactivated state for this lab (i.e. no command line option). To specify
229// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
230// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19231// See the documentation of Experiment for details on the fields.
232//
233// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05234const Experiment kExperiments[] = {
[email protected]270f0342013-02-20 01:19:44235#if defined(OS_ANDROID)
236 {
[email protected]199def22013-02-21 17:52:29237 "enable-spdy-proxy-auth",
238 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME,
239 IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION,
[email protected]270f0342013-02-20 01:19:44240 kOsAndroid,
[email protected]199def22013-02-21 17:52:29241 SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth)
[email protected]270f0342013-02-20 01:19:44242 },
243#endif
[email protected]ad2a3ded2010-08-27 13:19:05244 {
[email protected]aac169d2011-03-18 19:53:03245 "expose-for-tabs", // FLAGS:RECORD_UMA
246 IDS_FLAGS_TABPOSE_NAME,
247 IDS_FLAGS_TABPOSE_DESCRIPTION,
248 kOsMac,
249#if defined(OS_MACOSX)
250 // The switch exists only on OS X.
251 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
252#else
253 SINGLE_VALUE_TYPE("")
254#endif
255 },
256 {
[email protected]4bc5050c2010-11-18 17:55:54257 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05258 IDS_FLAGS_CONFLICTS_CHECK_NAME,
259 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
260 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19261 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05262 },
263 {
[email protected]4bc5050c2010-11-18 17:55:54264 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54265 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
266 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45267 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22268 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31269 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22270 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
271 // always have PDF rasterization available, so no flag needed there.
272#if !defined(GOOGLE_CHROME_BUILD)
273 kOsWin,
274#else
275 0,
[email protected]fa6d2a2f2010-11-30 21:47:19276#endif
[email protected]8a6ff28d2010-12-02 16:35:19277 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42278 },
[email protected]60d77bd2012-08-22 00:10:07279#if defined(OS_WIN)
280 {
281 "print-raster",
282 IDS_FLAGS_PRINT_RASTER_NAME,
283 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
284 kOsWin,
285 SINGLE_VALUE_TYPE(switches::kPrintRaster)
286 },
287#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05288 {
[email protected]96c6f4c2011-05-18 19:36:22289 "ignore-gpu-blacklist",
290 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
291 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
292 kOsAll,
293 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
294 },
295 {
[email protected]0110cf112011-07-02 00:39:43296 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22297 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
298 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23299 kOsMac | kOsWin | kOsLinux,
[email protected]83e9fa702013-02-25 19:30:44300 ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode,
301 switches::kDisableForceCompositingMode)
[email protected]96c6f4c2011-05-18 19:36:22302 },
303 {
[email protected]72787e392012-03-23 05:55:43304 "threaded-compositing-mode",
305 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
306 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56307 kOsDesktop & ~kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44308 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
309 switches::kDisableThreadedCompositing)
[email protected]644a1072012-03-16 09:29:59310 },
311 {
[email protected]17e27692013-02-06 17:02:09312 "force-accelerated-composited-scrolling",
313 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
314 IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
315 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44316 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll,
317 switches::kDisableAcceleratedOverflowScroll)
[email protected]17e27692013-02-06 17:02:09318 },
319 {
[email protected]8b1c3c72013-01-25 01:48:43320 "present-with-GDI",
321 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
322 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
323 kOsWin,
324 MULTI_VALUE_TYPE(kGDIPresentChoices)
325 },
326 {
[email protected]81c64af62012-06-06 20:15:52327 "disable-accelerated-2d-canvas",
328 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
329 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
330 kOsAll,
331 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
332 },
333 {
[email protected]69cffc82012-08-10 13:27:27334 "disable-deferred-2d-canvas",
335 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
336 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
337 kOsAll,
338 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
339 },
340 {
[email protected]efcde132012-05-30 01:05:18341 "disable-threaded-animation",
342 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
343 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59344 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37345 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59346 },
347 {
[email protected]5963b772011-02-09 22:55:38348 "composited-layer-borders",
349 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
350 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
351 kOsAll,
352 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
353 },
354 {
[email protected]a8f1eaa2011-03-07 19:00:58355 "show-fps-counter",
356 IDS_FLAGS_SHOW_FPS_COUNTER,
357 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
358 kOsAll,
359 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
360 },
[email protected]8ff7f342011-05-25 01:49:47361 {
[email protected]70c98a332011-12-21 20:51:52362 "accelerated-filters",
363 IDS_FLAGS_ACCELERATED_FILTERS,
364 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
365 kOsAll,
366 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
367 },
368 {
[email protected]8ff7f342011-05-25 01:49:47369 "disable-gpu-vsync",
370 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
371 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56372 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47373 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
374 },
[email protected]deaba6d52011-09-23 14:47:12375 {
[email protected]4052d832013-01-16 05:31:01376 "enable-webgl",
377 IDS_FLAGS_ENABLE_WEBGL_NAME,
378 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
379 kOsAndroid,
380#if defined(OS_ANDROID)
381 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
382#else
383 SINGLE_VALUE_TYPE("")
384#endif
385 },
386 {
[email protected]deaba6d52011-09-23 14:47:12387 "disable-webgl",
388 IDS_FLAGS_DISABLE_WEBGL_NAME,
389 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56390 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01391#if defined(OS_ANDROID)
392 SINGLE_VALUE_TYPE("")
393#else
[email protected]deaba6d52011-09-23 14:47:12394 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01395#endif
[email protected]deaba6d52011-09-23 14:47:12396 },
[email protected]09096e02012-05-24 11:12:04397 {
[email protected]ce585bf2013-03-14 16:25:16398 "disable-webrtc",
399 IDS_FLAGS_DISABLE_WEBRTC_NAME,
400 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05401 kOsAndroid,
402#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16403 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05404#else
405 SINGLE_VALUE_TYPE("")
406#endif
407 },
408 {
[email protected]96bcdc102012-05-24 23:42:10409 "fixed-position-creates-stacking-context",
410 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
411 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
412 kOsAll,
[email protected]83e9fa702013-02-25 19:30:44413 ENABLE_DISABLE_VALUE_TYPE(
414 switches::kEnableFixedPositionCreatesStackingContext,
415 switches::kDisableFixedPositionCreatesStackingContext)
[email protected]96bcdc102012-05-24 23:42:10416 },
[email protected]fb854192013-02-06 01:30:04417 {
418 "enable-compositing-for-fixed-position",
419 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME,
420 IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION,
421 kOsAll,
422 MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices)
423 },
[email protected]a7640ef22012-10-06 00:52:08424 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53425 {
[email protected]e3791ce92011-08-09 01:03:32426 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40427 IDS_FLAGS_ENABLE_NACL_NAME,
428 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56429 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19430 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40431 },
[email protected]b39c6d92012-01-31 16:38:41432 // TODO(halyavin): When exception handling is on by default, replace this
433 // flag with disable-nacl-exception-handling.
434 {
435 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
436 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
437 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56438 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41439 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
440 },
[email protected]4ff87d202010-11-06 01:28:40441 {
[email protected]9addd1c2012-09-15 14:28:24442 "enable-nacl-debug", // FLAGS:RECORD_UMA
443 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
444 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56445 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24446 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13447 },
448 {
[email protected]66f409c2012-10-04 20:59:04449 "nacl-debug-mask", // FLAGS:RECORD_UMA
450 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
451 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56452 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04453 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
454 },
455 {
[email protected]7babd1c2012-08-08 20:35:29456 "enable-pnacl", // FLAGS:RECORD_UMA
457 IDS_FLAGS_ENABLE_PNACL_NAME,
458 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56459 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29460 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
461 },
462 {
[email protected]4bc5050c2010-11-18 17:55:54463 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32464 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
465 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56466 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19467 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32468 },
[email protected]3627b06d2010-11-12 16:36:16469 {
[email protected]544471a2012-10-13 05:27:09470 "action-box",
[email protected]cab18ef2012-04-27 07:22:03471 IDS_FLAGS_ACTION_BOX_NAME,
472 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56473 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44474 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1",
475 switches::kActionBox, "0")
[email protected]cab18ef2012-04-27 07:22:03476 },
477 {
[email protected]3a362432012-06-18 20:39:51478 "script-badges",
479 IDS_FLAGS_SCRIPT_BADGES_NAME,
480 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56481 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09482 SINGLE_VALUE_TYPE(switches::kScriptBadges)
483 },
484 {
485 "script-bubble",
486 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
487 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56488 kOsDesktop,
[email protected]83e9fa702013-02-25 19:30:44489 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1",
490 switches::kScriptBubble, "0")
[email protected]3a362432012-06-18 20:39:51491 },
492 {
[email protected]cbe224d2011-08-04 22:12:49493 "apps-new-install-bubble",
494 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
495 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56496 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49497 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
498 },
499 {
[email protected]80bd24e2010-11-30 09:34:38500 "disable-hyperlink-auditing",
501 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
502 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
503 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19504 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51505 },
506 {
507 "experimental-location-features", // FLAGS:RECORD_UMA
508 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
509 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
510 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19511 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
512 },
513 {
[email protected]5aea1862011-03-23 23:55:39514 "tab-groups-context-menu",
515 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
516 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
517 kOsWin,
518 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
519 },
[email protected]c94cebd2012-06-21 00:55:28520 {
521 "enable-instant-extended-api",
522 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
523 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56524 kOsDesktop,
[email protected]73444382013-02-26 19:31:51525 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI,
526 switches::kDisableInstantExtendedAPI)
[email protected]c94cebd2012-06-21 00:55:28527 },
[email protected]e9bf9d92011-03-31 20:57:15528 {
[email protected]354e33b2011-06-15 00:29:10529 "static-ip-config",
530 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
531 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
532 kOsCrOS,
533#if defined(OS_CHROMEOS)
534 // This switch exists only on Chrome OS.
535 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
536#else
537 SINGLE_VALUE_TYPE("")
538#endif
539 },
[email protected]3eb5728c2011-06-20 22:32:24540 {
541 "show-autofill-type-predictions",
542 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
543 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
544 kOsAll,
545 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
546 },
[email protected]bff4d3e2011-06-21 23:58:52547 {
[email protected]fdf4e252012-04-27 00:26:55548 "sync-tab-favicons",
549 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
550 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
551 kOsAll,
552 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
553 },
554 {
[email protected]5d90a0a2012-11-15 02:43:40555 "sync-keystore-encryption",
556 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
557 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
558 kOsAll,
559 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
560 },
561 {
[email protected]e755a382012-09-13 17:16:35562 "enable-gesture-tap-highlight",
563 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
564 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
565 kOsLinux | kOsCrOS,
[email protected]06ca05d2013-03-13 19:12:47566 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight,
567 switches::kDisableGestureTapHighlight)
[email protected]e755a382012-09-13 17:16:35568 },
569 {
[email protected]a22ebd812011-06-23 00:05:39570 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
571 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
572 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
573 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40574 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25575 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39576 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
577 },
[email protected]81a6b0b2011-06-24 17:55:40578 {
[email protected]68317802012-06-07 19:13:23579 "omnibox-history-quick-provider-new-scoring",
580 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
581 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
582 kOsAll,
583 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
584 },
585 {
[email protected]128dc6c2012-06-22 20:30:35586 "omnibox-history-quick-provider-reorder-for-inlining",
587 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
588 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
589 kOsAll,
590 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
591 },
592 {
[email protected]032d5e6c2012-02-17 17:53:55593 "omnibox-inline-history-quick-provider",
594 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
595 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
596 kOsAll,
597 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
598 },
599 {
[email protected]7e7a28092011-12-09 22:24:55600 "enable-panels",
601 IDS_FLAGS_ENABLE_PANELS_NAME,
602 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56603 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55604 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54605 },
[email protected]e3749d12011-07-25 22:22:12606 {
[email protected]27c14f02012-06-22 17:29:58607 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27608 "save-page-as-mhtml", // FLAGS:RECORD_UMA
609 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
610 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
611 kOsMac | kOsWin | kOsLinux,
612 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
613 },
614 {
[email protected]b7bb44f2011-09-01 05:17:03615 "enable-autologin",
616 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
617 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
618 kOsMac | kOsWin | kOsLinux,
619 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
620 },
[email protected]b9841172011-09-26 23:36:09621 {
[email protected]3231b612012-03-23 05:57:54622 "enable-spdy3",
623 IDS_FLAGS_ENABLE_SPDY3_NAME,
624 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
625 kOsAll,
626 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
627 },
628 {
[email protected]27b3fe92012-03-21 05:35:06629 "enable-async-dns",
630 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
631 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46632 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44633 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
634 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06635 },
636 {
[email protected]1eb93802012-09-11 18:57:56637 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11638 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
639 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32640 kOsAll,
[email protected]da43c082012-09-07 18:56:11641 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44642 },
[email protected]e4e68dbb2011-11-18 01:50:22643 {
[email protected]36d98412013-01-31 20:28:53644 "disable-encrypted-media",
645 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME,
646 IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56647 kOsDesktop,
[email protected]36d98412013-01-31 20:28:53648 SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03649 },
[email protected]f88628792012-12-18 07:07:50650 {
651 "enable-opus-playback",
652 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
653 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56654 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50655 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
656 },
[email protected]ca6eaa5a2013-01-24 16:16:04657 {
[email protected]c54e1aa2013-01-25 09:26:17658 "enable-vp9-playback",
659 IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME,
660 IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION,
661 kOsDesktop,
662 SINGLE_VALUE_TYPE(switches::kEnableVp9Playback)
663 },
664 {
[email protected]ca6eaa5a2013-01-24 16:16:04665 "enable-managed-users",
666 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
667 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
668 kOsAll,
669 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
670 },
[email protected]dc04be7c2012-03-15 23:57:49671#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50672 {
[email protected]cda278d2012-10-30 20:31:40673 "ash-disable-auto-window-placement",
674 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
675 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
676 kOsWin | kOsLinux | kOsCrOS,
677 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
678 },
[email protected]b4e4ec42012-11-29 21:42:40679 {
[email protected]16f55a22013-02-13 23:47:34680 "ash-disable-per-app-launcher",
681 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME,
682 IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION,
[email protected]b4e4ec42012-11-29 21:42:40683 kOsWin | kOsLinux | kOsCrOS,
[email protected]16f55a22013-02-13 23:47:34684 SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher)
[email protected]b4e4ec42012-11-29 21:42:40685 },
[email protected]dc04be7c2012-03-15 23:57:49686#endif
[email protected]eaae8b462012-01-20 22:20:39687 {
[email protected]db543d322011-12-15 20:40:15688 "per-tile-painting",
689 IDS_FLAGS_PER_TILE_PAINTING_NAME,
690 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
[email protected]a5b1b272012-01-06 20:44:37691 kOsMac | kOsLinux | kOsCrOS,
[email protected]65bfd9972012-10-19 03:39:37692 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15693 },
[email protected]bf88c032011-12-22 19:05:47694 {
695 "enable-javascript-harmony",
696 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
697 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
698 kOsAll,
699 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
700 },
[email protected]7e7f378a2012-01-05 14:35:37701 {
[email protected]85646172012-01-09 22:45:54702 "enable-tab-browser-dragging",
703 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
704 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
705 kOsWin,
706 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
707 },
708 {
[email protected]068b7b52012-02-27 12:41:44709 "disable-restore-session-state",
710 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
711 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37712 kOsAll,
[email protected]068b7b52012-02-27 12:41:44713 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37714 },
[email protected]88864db2012-01-18 20:56:35715 {
716 "disable-software-rasterizer",
717 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
718 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
719#if defined(ENABLE_SWIFTSHADER)
720 kOsAll,
721#else
722 0,
723#endif
724 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
725 },
[email protected]15a5d722012-01-23 09:11:14726 {
[email protected]ff7b6dd2012-09-15 20:20:03727 "enable-experimental-webkit-features",
728 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
729 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16730 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03731 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49732 },
733 {
[email protected]0f95a252012-09-13 22:30:04734 "enable-css-shaders",
735 IDS_FLAGS_CSS_SHADERS_NAME,
736 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
737 kOsAll,
738 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
739 },
740 {
[email protected]9860c68b2012-02-02 01:58:09741 "enable-extension-activity-ui",
742 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
743 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56744 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09745 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00746 },
[email protected]54ae4e92012-02-16 15:19:05747 {
[email protected]3e8befc2012-03-13 01:17:03748 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16749 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
750 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56751 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03752 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16753 },
[email protected]dc04be7c2012-03-15 23:57:49754#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01755 {
[email protected]3cd198a22012-03-12 20:38:01756 "enable-ash-oak",
757 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
758 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
759 kOsAll,
760 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
761 },
[email protected]31cf1c52012-02-29 20:55:01762#endif
[email protected]184ec592012-03-01 11:54:28763 {
764 "enable-devtools-experiments",
765 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
766 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56767 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28768 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
769 },
[email protected]76d1854e2012-03-02 23:57:44770 {
[email protected]2fefdb32013-02-26 14:28:10771 "silent-debugger-extension-api",
772 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
773 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
774 kOsDesktop,
775 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
776 },
777 {
[email protected]76d1854e2012-03-02 23:57:44778 "enable-suggestions-ntp",
779 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
780 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56781 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44782 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
783 },
[email protected]a3d54252012-04-05 20:04:13784 {
[email protected]1dbaf5e2012-11-30 05:51:32785 "spellcheck-autocorrect",
786 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
787 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
788 kOsWin | kOsLinux | kOsCrOS,
789 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
790 },
791 {
[email protected]d7932532012-11-21 21:10:31792 "touch-events",
793 IDS_TOUCH_EVENTS_NAME,
794 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56795 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31796 MULTI_VALUE_TYPE(kTouchEventsChoices)
797 },
798 {
[email protected]c9c73ad42012-04-18 03:35:59799 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06800 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
801 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55802 kOsWin,
[email protected]347a0c72012-05-14 20:28:06803 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59804 },
[email protected]8a6aaa72012-04-20 20:53:58805 {
[email protected]b9c96ff2012-11-26 22:24:40806 "disable-touch-adjustment",
807 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
808 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
809 kOsWin | kOsLinux | kOsCrOS,
810 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
811 },
812 {
[email protected]0b9383a2012-10-26 00:58:16813 "enable-tab-capture",
814 IDS_ENABLE_TAB_CAPTURE_NAME,
815 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25816 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44817 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1",
818 switches::kTabCapture, "0")
[email protected]0b9383a2012-10-26 00:58:16819 },
[email protected]0b60afa2012-04-19 17:36:39820#if defined(OS_CHROMEOS)
821 {
[email protected]7c4a9bc2012-09-11 22:10:05822 "enable-background-loader",
823 IDS_ENABLE_BACKLOADER_NAME,
824 IDS_ENABLE_BACKLOADER_DESCRIPTION,
825 kOsCrOS,
826 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
827 },
828 {
[email protected]c5667b282012-08-31 00:32:50829 "enable-bezel-touch",
830 IDS_ENABLE_BEZEL_TOUCH_NAME,
831 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47832 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50833 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47834 },
835 {
[email protected]3f4181a2013-02-01 21:31:07836 "enable-screensaver-extension",
837 IDS_ENABLE_SCREENSAVER_EXTENSION_NAME,
838 IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION,
839 kOsCrOS,
840 SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions)
841 },
842 {
[email protected]0b60afa2012-04-19 17:36:39843 "no-discard-tabs",
844 IDS_FLAGS_NO_DISCARD_TABS_NAME,
845 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
846 kOsCrOS,
847 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
848 },
849#endif
[email protected]79be6d32012-04-24 20:47:44850 {
[email protected]8d68a3e02013-01-12 15:57:10851 "enable-download-resumption",
852 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
853 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56854 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10855 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
856 },
857 {
[email protected]9a5940d2012-04-27 19:16:23858 "allow-nacl-socket-api",
859 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
860 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56861 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23862 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
863 },
[email protected]85333732012-05-01 19:02:24864 {
[email protected]60673ad72012-05-02 06:16:33865 "stacked-tab-strip",
866 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
867 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
868 kOsWin,
869 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
870 },
871 {
[email protected]4bd20202012-06-14 17:35:01872 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24873 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
874 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
875 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01876 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24877 },
[email protected]190349fd2012-05-02 00:10:47878#if defined(OS_CHROMEOS)
879 {
880 "allow-touchpad-three-finger-click",
881 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
882 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
883 kOsCrOS,
884 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
885 },
[email protected]fbc176b62012-10-27 02:19:58886 {
887 "allow-touchpad-three-finger-swipe",
888 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
889 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
890 kOsCrOS,
891 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
892 },
[email protected]190349fd2012-05-02 00:10:47893#endif
[email protected]1992a2f42012-10-23 18:32:21894 {
[email protected]a585e462013-01-26 00:37:15895 "use-client-login-signin-flow",
896 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME,
897 IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21898 kOsMac | kOsWin | kOsLinux,
[email protected]a585e462013-01-26 00:37:15899 SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21900 },
[email protected]8ee02242012-12-04 15:23:32901 {
902 "enable-desktop-guest-mode",
903 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
904 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
905 kOsMac | kOsWin | kOsLinux,
906 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
907 },
[email protected]53520b1b2012-05-07 21:43:37908#if defined(USE_ASH)
909 {
[email protected]fac380e02013-03-08 20:06:30910 "hide-launcher-alignment-menu",
911 IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_NAME,
912 IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
[email protected]35a4ced2013-02-06 23:24:42913 kOsAll,
[email protected]fac380e02013-03-08 20:06:30914 SINGLE_VALUE_TYPE(switches::kHideLauncherAlignmentMenu)
[email protected]35a4ced2013-02-06 23:24:42915 },
916 {
[email protected]73074742012-05-17 01:44:41917 "show-touch-hud",
918 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
919 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
920 kOsAll,
921 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
922 },
923 {
[email protected]9f0940b62012-05-23 22:56:35924 "enable-pinch",
925 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
926 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06927 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35928 SINGLE_VALUE_TYPE(switches::kEnablePinch),
929 },
[email protected]a8379312012-06-15 00:20:43930 {
931 "app-list-show-apps-only",
932 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
933 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
934 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03935 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43936 },
[email protected]73074742012-05-17 01:44:41937#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28938#if defined(OS_CHROMEOS)
939 {
[email protected]8b04a1652012-08-04 02:59:49940 "disable-boot-animation",
941 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
942 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
943 kOsCrOS,
944 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
945 },
[email protected]95058572012-08-20 14:57:29946 {
[email protected]b4557192012-09-19 11:29:58947 "disable-boot-animation2",
948 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
949 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
950 kOsCrOS,
951 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
952 },
953 {
[email protected]ea2f3342012-09-21 21:13:36954 "boot-animation-fucntion",
955 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
956 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
957 kOsCrOS,
958 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
959 },
[email protected]839667d62012-10-23 19:38:57960 {
[email protected]d96aef22012-10-30 11:47:02961 "captive-portal-detector",
962 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
963 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
964 kOsCrOS,
965 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
966 },
967 {
[email protected]c11aa8f12012-12-18 18:43:14968 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57969 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
970 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
971 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14972 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57973 },
[email protected]f0280952012-11-06 20:30:50974 {
[email protected]0fb5c4852012-11-08 20:33:23975 "file-manager-packaged",
976 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
977 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
978 kOsCrOS,
979 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
980 },
[email protected]3e035e82012-11-27 20:54:32981 {
[email protected]8039e06c2013-01-17 23:34:50982 "disable-launcher-per-display",
983 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
984 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:35985 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:50986 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:35987 },
[email protected]06b146d2013-02-07 06:06:47988 {
989 "enable-app-mode",
990 IDS_FLAGS_ENABLE_KIOSK_APPS_NAME,
991 IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION,
992 kOsCrOS,
993 SINGLE_VALUE_TYPE(switches::kEnableAppMode),
994 },
[email protected]6ad015c2013-03-06 00:49:51995 {
996 "force-fullscreen-app",
997 IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME,
998 IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION,
999 kOsCrOS,
1000 SINGLE_VALUE_TYPE(switches::kForceFullscreenApp),
1001 },
[email protected]62018dc2012-12-13 00:37:351002#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391003 {
[email protected]6247aba2013-03-04 22:57:181004 "views-textfield",
1005 IDS_FLAGS_VIEWS_TEXTFIELD_NAME,
1006 IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION,
[email protected]fc7a93c2012-06-08 20:25:391007 kOsWin,
[email protected]6247aba2013-03-04 22:57:181008 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield,
1009 switches::kDisableViewsTextfield),
[email protected]fc7a93c2012-06-08 20:25:391010 },
[email protected]bd0cd3bb2012-06-14 03:03:381011 {
[email protected]2d4817742012-12-17 20:16:181012 "enable-new-dialog-style",
1013 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1014 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321015 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181016 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321017 },
[email protected]7db8893a2012-07-26 00:49:401018 { "disable-accelerated-video-decode",
1019 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1020 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561021 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401022 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151023 },
[email protected]66ae9fc2012-06-19 21:33:521024#if defined(USE_ASH)
1025 {
1026 "ash-debug-shortcuts",
1027 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1028 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1029 kOsAll,
1030 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1031 },
1032#endif
[email protected]37fee0942012-08-07 21:07:451033 {
[email protected]ad3f6d22012-08-29 02:34:191034 "enable-contacts",
1035 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1036 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1037 kOsCrOS,
1038 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1039 },
[email protected]1d9bb9cd2012-08-28 22:02:501040#if defined(USE_ASH)
1041 { "ash-enable-advanced-gestures",
1042 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1043 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1044 kOsCrOS,
1045 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1046 },
[email protected]cfa24e62013-02-13 21:19:111047 { "ash-disable-tab-scrubbing",
1048 IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME,
1049 IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION,
[email protected]51075f8c2012-11-13 01:48:161050 kOsCrOS,
[email protected]cfa24e62013-02-13 21:19:111051 SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing),
[email protected]51075f8c2012-11-13 01:48:161052 },
[email protected]83eef802012-12-02 07:43:521053 { "ash-enable-workspace-scrubbing",
1054 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1055 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1056 kOsCrOS,
1057 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1058 },
[email protected]8c426dc2013-03-06 01:30:121059 { "ash-disable-immersive-mode",
1060 IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_NAME,
1061 IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241062 kOsCrOS,
[email protected]8c426dc2013-03-06 01:30:121063 SINGLE_VALUE_TYPE(ash::switches::kAshDisableImmersiveMode),
[email protected]c043df272012-11-21 00:43:241064 },
[email protected]316708a2012-11-05 22:57:021065#if defined(OS_LINUX)
1066 { "ash-enable-memory-monitor",
1067 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1068 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1069 kOsCrOS,
1070 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1071 },
1072#endif
[email protected]1d9bb9cd2012-08-28 22:02:501073#endif
[email protected]9b7ab882012-09-10 23:46:361074#if defined(OS_CHROMEOS)
[email protected]9475ee6f2013-03-08 18:20:091075 { "ash-disable-new-network-status-area",
1076 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME,
1077 IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION,
[email protected]badba1ad2012-11-16 17:21:461078 kOsCrOS,
[email protected]9475ee6f2013-03-08 18:20:091079 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea),
[email protected]badba1ad2012-11-16 17:21:461080 },
[email protected]9b7ab882012-09-10 23:46:361081 {
[email protected]205f07892012-10-16 20:26:221082 "enable-carrier-switching",
1083 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1084 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1085 kOsCrOS,
1086 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1087 },
1088 {
[email protected]9b7ab882012-09-10 23:46:361089 "enable-request-tablet-site",
1090 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1091 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1092 kOsCrOS,
1093 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1094 },
1095#endif
[email protected]dab49c0b2012-10-04 05:55:351096 {
1097 "debug-packed-apps",
1098 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1099 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561100 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351101 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1102 },
[email protected]d1459ed2012-10-10 01:29:331103 {
1104 "enable-password-generation",
1105 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1106 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561107 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331108 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1109 },
[email protected]26d045f2012-10-18 21:18:431110 {
[email protected]76f7d4882012-10-26 21:09:221111 "enable-deferred-image-decoding",
1112 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1113 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221114 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221115 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1116 },
1117 {
[email protected]075543d2012-10-24 01:29:141118 "performance-monitor-gathering",
1119 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1120 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1121 kOsAll,
1122 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1123 },
[email protected]783d5bb2012-10-24 03:47:141124 {
[email protected]b58d5a02013-03-06 04:33:531125 "enable-native-autofill-ui",
1126 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME,
1127 IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561128 kOsDesktop,
[email protected]b58d5a02013-03-06 04:33:531129 SINGLE_VALUE_TYPE(switches::kEnableNativeAutofillUi)
[email protected]0572fb2e2012-11-03 00:38:591130 },
1131 {
[email protected]99002fd2012-11-06 04:35:521132 "show-app-list-shortcut",
1133 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1134 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1135 kOsWin,
[email protected]7d1d2092013-03-04 04:12:431136 SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut)
[email protected]99002fd2012-11-06 04:35:521137 },
[email protected]a7259fb2012-11-08 06:22:231138 {
1139 "enable-experimental-form-filling",
1140 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1141 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1142 kOsWin | kOsCrOS,
1143 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1144 },
[email protected]6e6efe42013-01-30 00:04:501145 {
1146 "enable-interactive-autocomplete",
1147 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1148 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
[email protected]57e67ac2013-02-22 03:37:221149 kOsWin | kOsCrOS | kOsAndroid,
[email protected]6e6efe42013-01-30 00:04:501150 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1151 },
[email protected]e42b1f82012-11-16 21:18:461152#if defined(USE_AURA)
1153 {
[email protected]b75ba132013-02-26 19:38:311154 "disable-overscroll-history-navigation",
1155 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1156 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461157 kOsAll,
[email protected]b75ba132013-02-26 19:38:311158 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461159 },
1160#endif
[email protected]edbea622012-11-28 20:39:381161 {
1162 "enable-touch-drag-drop",
1163 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1164 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1165 kOsWin | kOsCrOS,
1166 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1167 },
[email protected]0e2f43b62013-02-21 00:47:151168 {
1169 "enable-touch-editing",
1170 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1171 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
1172 kOsCrOS,
1173 SINGLE_VALUE_TYPE(switches::kEnableTouchEditing)
1174 },
[email protected]f1c39242013-01-29 16:13:011175#if defined(ENABLE_MESSAGE_CENTER)
[email protected]92e12dd92012-12-11 03:33:201176 {
1177 "enable-rich-notifications",
1178 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1179 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1180 kOsWin | kOsCrOS,
[email protected]f1c39242013-01-29 16:13:011181 SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications)
[email protected]92e12dd92012-12-11 03:33:201182 },
[email protected]f1c39242013-01-29 16:13:011183#endif
[email protected]4d51c682012-12-11 11:34:551184 {
1185 "full-history-sync",
1186 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1187 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1188 kOsAll,
1189 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1190 },
[email protected]628a69a92012-12-23 04:09:341191 {
[email protected]fd030142013-02-08 02:04:381192 "enable-usermedia-screen-capture",
1193 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME,
1194 IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION,
1195 kOsDesktop,
1196 SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing)
1197 },
[email protected]5b93e162013-02-19 06:33:091198 {
1199 "enable-apps-devtool-app",
1200 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME,
1201 IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION,
1202 kOsDesktop,
1203 SINGLE_VALUE_TYPE(switches::kAppsDevtool)
1204 },
[email protected]9323fdd12013-02-23 00:31:361205 {
1206 "impl-side-painting",
1207 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1208 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
1209 kOsAndroid,
1210 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1211 },
[email protected]2f2f72b2013-03-08 22:37:311212 // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura.
1213#if !defined(USE_AURA)
[email protected]484deaa2013-03-01 03:10:371214 {
1215 "track-active-visit-time",
1216 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME,
1217 IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION,
1218 kOsWin,
1219 SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime)
1220 },
[email protected]2f2f72b2013-03-08 22:37:311221#endif
[email protected]8cc71d42013-03-02 17:26:081222#if defined(OS_ANDROID)
1223 {
1224 "disable-gesture-requirement-for-media-playback",
1225 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1226 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1227 kOsAndroid,
1228 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1229 },
1230#endif
[email protected]e79f2fd52013-03-08 23:52:471231#if defined(OS_CHROMEOS)
1232 {
1233 "enable-experimental-bluetooth",
1234 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME,
1235 IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION,
1236 kOsCrOS,
1237 SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth)
1238 },
1239#endif
[email protected]6077cab2013-03-11 19:36:141240#if defined(ENABLE_GOOGLE_NOW)
1241 {
1242 "enable-google-now",
1243 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME,
1244 IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION,
1245 kOsWin | kOsCrOS,
1246 SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration)
1247 },
1248#endif
[email protected]a0e4b072011-08-17 01:47:071249};
[email protected]ad2a3ded2010-08-27 13:19:051250
[email protected]a314ee5a2010-10-26 21:23:281251const Experiment* experiments = kExperiments;
1252size_t num_experiments = arraysize(kExperiments);
1253
[email protected]e2ddbc92010-10-15 20:02:071254// Stores and encapsulates the little state that about:flags has.
1255class FlagsState {
1256 public:
1257 FlagsState() : needs_restart_(false) {}
1258 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1259 bool IsRestartNeededToCommitChanges();
1260 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281261 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071262 void RemoveFlagsSwitches(
1263 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]cb93bf52013-02-20 01:20:001264 void ResetAllFlags(PrefService* prefs);
[email protected]e2ddbc92010-10-15 20:02:071265 void reset();
1266
1267 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551268 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071269 return Singleton<FlagsState>::get();
1270 }
1271
1272 private:
1273 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531274 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071275
1276 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1277};
1278
[email protected]c7b7800a2010-10-07 18:51:351279// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]c6343372013-03-13 17:05:491280// in a set.
[email protected]1a47d7e2010-10-15 00:37:241281void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051282 const ListValue* enabled_experiments = prefs->GetList(
1283 prefs::kEnabledLabsExperiments);
1284 if (!enabled_experiments)
1285 return;
1286
1287 for (ListValue::const_iterator it = enabled_experiments->begin();
1288 it != enabled_experiments->end();
1289 ++it) {
1290 std::string experiment_name;
1291 if (!(*it)->GetAsString(&experiment_name)) {
1292 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1293 continue;
1294 }
1295 result->insert(experiment_name);
1296 }
1297}
1298
[email protected]c6343372013-03-13 17:05:491299// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241300void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051301 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381302 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1303 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051304
1305 experiments_list->Clear();
1306 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1307 it != enabled_experiments.end();
1308 ++it) {
1309 experiments_list->Append(new StringValue(*it));
1310 }
1311}
1312
[email protected]8a6ff28d2010-12-02 16:35:191313// Adds the internal names for the specified experiment to |names|.
1314void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1315 if (e.type == Experiment::SINGLE_VALUE) {
1316 names->insert(e.internal_name);
1317 } else {
[email protected]83e9fa702013-02-25 19:30:441318 DCHECK(e.type == Experiment::MULTI_VALUE ||
1319 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191320 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:441321 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:191322 }
1323}
1324
[email protected]28e35af2011-02-09 12:56:221325// Confirms that an experiment is valid, used in a DCHECK in
1326// SanitizeList below.
1327bool ValidateExperiment(const Experiment& e) {
1328 switch (e.type) {
1329 case Experiment::SINGLE_VALUE:
1330 DCHECK_EQ(0, e.num_choices);
1331 DCHECK(!e.choices);
1332 break;
1333 case Experiment::MULTI_VALUE:
1334 DCHECK_GT(e.num_choices, 0);
1335 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531336 DCHECK(e.choices[0].command_line_switch);
1337 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221338 break;
[email protected]83e9fa702013-02-25 19:30:441339 case Experiment::ENABLE_DISABLE_VALUE:
1340 DCHECK_EQ(3, e.num_choices);
1341 DCHECK(!e.choices);
1342 DCHECK(e.command_line_switch);
1343 DCHECK(e.command_line_value);
1344 DCHECK(e.disable_command_line_switch);
1345 DCHECK(e.disable_command_line_value);
1346 break;
[email protected]28e35af2011-02-09 12:56:221347 default:
1348 NOTREACHED();
1349 }
1350 return true;
1351}
1352
[email protected]ad2a3ded2010-08-27 13:19:051353// Removes all experiments from prefs::kEnabledLabsExperiments that are
1354// unknown, to prevent this list to become very long as experiments are added
1355// and removed.
1356void SanitizeList(PrefService* prefs) {
1357 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221358 for (size_t i = 0; i < num_experiments; ++i) {
1359 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191360 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221361 }
[email protected]ad2a3ded2010-08-27 13:19:051362
1363 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241364 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051365
1366 std::set<std::string> new_enabled_experiments;
1367 std::set_intersection(
1368 known_experiments.begin(), known_experiments.end(),
1369 enabled_experiments.begin(), enabled_experiments.end(),
1370 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1371
[email protected]4c8853f2012-07-23 01:29:161372 if (new_enabled_experiments != enabled_experiments)
1373 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051374}
1375
[email protected]1a47d7e2010-10-15 00:37:241376void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051377 PrefService* prefs, std::set<std::string>* result) {
1378 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241379 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051380}
1381
[email protected]a314ee5a2010-10-26 21:23:281382// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1383// enabled on the current platform.
1384void GetSanitizedEnabledFlagsForCurrentPlatform(
1385 PrefService* prefs, std::set<std::string>* result) {
1386 GetSanitizedEnabledFlags(prefs, result);
1387
1388 // Filter out any experiments that aren't enabled on the current platform. We
1389 // don't remove these from prefs else syncing to a platform with a different
1390 // set of experiments would be lossy.
1391 std::set<std::string> platform_experiments;
1392 int current_platform = GetCurrentPlatform();
1393 for (size_t i = 0; i < num_experiments; ++i) {
1394 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191395 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281396 }
1397
1398 std::set<std::string> new_enabled_experiments;
1399 std::set_intersection(
1400 platform_experiments.begin(), platform_experiments.end(),
1401 result->begin(), result->end(),
1402 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1403
1404 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051405}
1406
[email protected]8a6ff28d2010-12-02 16:35:191407// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191408Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221409 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:441410 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
1411 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:191412 ListValue* result = new ListValue;
1413 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]8a6ff28d2010-12-02 16:35:191414 DictionaryValue* value = new DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:441415 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191416 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:441417 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:221418 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191419 result->Append(value);
1420 }
1421 return result;
1422}
1423
[email protected]e2ddbc92010-10-15 20:02:071424} // namespace
1425
[email protected]83e9fa702013-02-25 19:30:441426std::string Experiment::NameForChoice(int index) const {
1427 DCHECK(type == Experiment::MULTI_VALUE ||
1428 type == Experiment::ENABLE_DISABLE_VALUE);
1429 DCHECK_LT(index, num_choices);
1430 return std::string(internal_name) + testing::kMultiSeparator +
1431 base::IntToString(index);
1432}
1433
1434string16 Experiment::DescriptionForChoice(int index) const {
1435 DCHECK(type == Experiment::MULTI_VALUE ||
1436 type == Experiment::ENABLE_DISABLE_VALUE);
1437 DCHECK_LT(index, num_choices);
1438 int description_id;
1439 if (type == Experiment::ENABLE_DISABLE_VALUE) {
1440 const int kEnableDisableDescriptionIds[] = {
1441 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
1442 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
1443 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
1444 };
1445 description_id = kEnableDisableDescriptionIds[index];
1446 } else {
1447 description_id = choices[index].description_id;
1448 }
1449 return l10n_util::GetStringUTF16(description_id);
1450}
1451
[email protected]1a47d7e2010-10-15 00:37:241452void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551453 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051454}
1455
[email protected]1a47d7e2010-10-15 00:37:241456ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051457 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241458 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051459
1460 int current_platform = GetCurrentPlatform();
1461
1462 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281463 for (size_t i = 0; i < num_experiments; ++i) {
1464 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051465
1466 DictionaryValue* data = new DictionaryValue();
1467 data->SetString("internal_name", experiment.internal_name);
1468 data->SetString("name",
1469 l10n_util::GetStringUTF16(experiment.visible_name_id));
1470 data->SetString("description",
1471 l10n_util::GetStringUTF16(
1472 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401473 bool supported = !!(experiment.supported_platforms & current_platform);
1474 data->SetBoolean("supported", supported);
1475
1476 ListValue* supported_platforms = new ListValue();
1477 AddOsStrings(experiment.supported_platforms, supported_platforms);
1478 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051479
[email protected]28e35af2011-02-09 12:56:221480 switch (experiment.type) {
1481 case Experiment::SINGLE_VALUE:
1482 data->SetBoolean(
1483 "enabled",
1484 enabled_experiments.count(experiment.internal_name) > 0);
1485 break;
1486 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:441487 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:221488 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1489 break;
1490 default:
1491 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191492 }
1493
[email protected]ad2a3ded2010-08-27 13:19:051494 experiments_data->Append(data);
1495 }
1496 return experiments_data;
1497}
1498
[email protected]ad2a3ded2010-08-27 13:19:051499bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551500 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051501}
1502
1503void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351504 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551505 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071506}
1507
1508void RemoveFlagsSwitches(
1509 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551510 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071511}
1512
[email protected]cb93bf52013-02-20 01:20:001513void ResetAllFlags(PrefService* prefs) {
1514 FlagsState::GetInstance()->ResetAllFlags(prefs);
1515}
1516
[email protected]a314ee5a2010-10-26 21:23:281517int GetCurrentPlatform() {
1518#if defined(OS_MACOSX)
1519 return kOsMac;
1520#elif defined(OS_WIN)
1521 return kOsWin;
1522#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1523 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211524#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281525 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401526#elif defined(OS_ANDROID)
1527 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281528#else
1529#error Unknown platform
1530#endif
1531}
1532
[email protected]4bc5050c2010-11-18 17:55:541533void RecordUMAStatistics(const PrefService* prefs) {
1534 std::set<std::string> flags;
1535 GetEnabledFlags(prefs, &flags);
1536 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1537 ++it) {
1538 std::string action("AboutFlags_");
1539 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381540 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541541 }
1542 // Since flag metrics are recorded every startup, add a tick so that the
1543 // stats can be made meaningful.
1544 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381545 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1546 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541547}
1548
[email protected]e2ddbc92010-10-15 20:02:071549//////////////////////////////////////////////////////////////////////////////
1550// FlagsState implementation.
1551
1552namespace {
1553
[email protected]83e9fa702013-02-25 19:30:441554typedef std::map<std::string, std::pair<std::string, std::string> >
1555 NameToSwitchAndValueMap;
1556
1557void SetFlagToSwitchMapping(const std::string& key,
1558 const std::string& switch_name,
1559 const std::string& switch_value,
1560 NameToSwitchAndValueMap* name_to_switch_map) {
1561 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
1562 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
1563}
1564
[email protected]e2ddbc92010-10-15 20:02:071565void FlagsState::ConvertFlagsToSwitches(
1566 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071567 if (command_line->HasSwitch(switches::kNoExperiments))
1568 return;
1569
1570 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001571
[email protected]a314ee5a2010-10-26 21:23:281572 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071573
[email protected]a82744532011-02-11 16:15:531574 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191575 for (size_t i = 0; i < num_experiments; ++i) {
1576 const Experiment& e = experiments[i];
1577 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:441578 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
1579 e.command_line_value, &name_to_switch_map);
1580 } else if (e.type == Experiment::MULTI_VALUE) {
1581 for (int j = 0; j < e.num_choices; ++j) {
1582 SetFlagToSwitchMapping(e.NameForChoice(j),
1583 e.choices[j].command_line_switch,
1584 e.choices[j].command_line_value,
1585 &name_to_switch_map);
1586 }
[email protected]8a6ff28d2010-12-02 16:35:191587 } else {
[email protected]83e9fa702013-02-25 19:30:441588 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
1589 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
1590 &name_to_switch_map);
1591 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
1592 e.command_line_value, &name_to_switch_map);
1593 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
1594 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:191595 }
1596 }
[email protected]e2ddbc92010-10-15 20:02:071597
1598 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531599 flags_switches_.insert(
1600 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1601 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071602 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1603 it != enabled_experiments.end();
1604 ++it) {
1605 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531606 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191607 name_to_switch_map.find(experiment_name);
1608 if (name_to_switch_it == name_to_switch_map.end()) {
1609 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071610 continue;
[email protected]8a6ff28d2010-12-02 16:35:191611 }
[email protected]e2ddbc92010-10-15 20:02:071612
[email protected]a82744532011-02-11 16:15:531613 const std::pair<std::string, std::string>&
1614 switch_and_value_pair = name_to_switch_it->second;
1615
1616 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1617 switch_and_value_pair.second);
1618 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071619 }
1620 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531621 flags_switches_.insert(
1622 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1623 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071624}
1625
1626bool FlagsState::IsRestartNeededToCommitChanges() {
1627 return needs_restart_;
1628}
1629
1630void FlagsState::SetExperimentEnabled(
1631 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051632 needs_restart_ = true;
1633
[email protected]83e9fa702013-02-25 19:30:441634 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:191635 if (at_index != std::string::npos) {
1636 DCHECK(enable);
1637 // We're being asked to enable a multi-choice experiment. Disable the
1638 // currently selected choice.
1639 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221640 const std::string experiment_name = internal_name.substr(0, at_index);
1641 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191642
[email protected]28e35af2011-02-09 12:56:221643 // And enable the new choice, if it is not the default first choice.
1644 if (internal_name != experiment_name + "@0") {
1645 std::set<std::string> enabled_experiments;
1646 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1647 enabled_experiments.insert(internal_name);
1648 SetEnabledFlags(prefs, enabled_experiments);
1649 }
[email protected]8a6ff28d2010-12-02 16:35:191650 return;
1651 }
1652
[email protected]ad2a3ded2010-08-27 13:19:051653 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241654 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051655
[email protected]8a6ff28d2010-12-02 16:35:191656 const Experiment* e = NULL;
1657 for (size_t i = 0; i < num_experiments; ++i) {
1658 if (experiments[i].internal_name == internal_name) {
1659 e = experiments + i;
1660 break;
1661 }
1662 }
1663 DCHECK(e);
1664
1665 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591666 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191667 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591668 else
[email protected]8a6ff28d2010-12-02 16:35:191669 enabled_experiments.erase(internal_name);
1670 } else {
1671 if (enable) {
1672 // Enable the first choice.
[email protected]83e9fa702013-02-25 19:30:441673 enabled_experiments.insert(e->NameForChoice(0));
[email protected]8a6ff28d2010-12-02 16:35:191674 } else {
1675 // Find the currently enabled choice and disable it.
1676 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:441677 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:191678 if (enabled_experiments.find(choice_name) !=
1679 enabled_experiments.end()) {
1680 enabled_experiments.erase(choice_name);
1681 // Continue on just in case there's a bug and more than one
1682 // experiment for this choice was enabled.
1683 }
1684 }
1685 }
1686 }
[email protected]ad2a3ded2010-08-27 13:19:051687
[email protected]1a47d7e2010-10-15 00:37:241688 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051689}
1690
[email protected]e2ddbc92010-10-15 20:02:071691void FlagsState::RemoveFlagsSwitches(
1692 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531693 for (std::map<std::string, std::string>::const_iterator
1694 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1695 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071696 }
1697}
1698
[email protected]cb93bf52013-02-20 01:20:001699void FlagsState::ResetAllFlags(PrefService* prefs) {
1700 needs_restart_ = true;
1701
1702 std::set<std::string> no_experiments;
1703 SetEnabledFlags(prefs, no_experiments);
1704}
1705
[email protected]e2ddbc92010-10-15 20:02:071706void FlagsState::reset() {
1707 needs_restart_ = false;
1708 flags_switches_.clear();
1709}
1710
[email protected]38e46812011-05-09 20:49:221711} // namespace
[email protected]e2ddbc92010-10-15 20:02:071712
1713namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191714
1715// WARNING: '@' is also used in the html file. If you update this constant you
1716// also need to update the html file.
1717const char kMultiSeparator[] = "@";
1718
[email protected]e2ddbc92010-10-15 20:02:071719void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551720 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071721}
[email protected]a314ee5a2010-10-26 21:23:281722
1723void SetExperiments(const Experiment* e, size_t count) {
1724 if (!e) {
1725 experiments = kExperiments;
1726 num_experiments = arraysize(kExperiments);
1727 } else {
1728 experiments = e;
1729 num_experiments = count;
1730 }
1731}
1732
[email protected]8a6ff28d2010-12-02 16:35:191733const Experiment* GetExperiments(size_t* count) {
1734 *count = num_experiments;
1735 return experiments;
1736}
1737
[email protected]e2ddbc92010-10-15 20:02:071738} // namespace testing
1739
[email protected]1a47d7e2010-10-15 00:37:241740} // namespace about_flags