blob: b50f6e8a766c85c54aa1364b1fd6496ce9092e3e [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>
11
[email protected]ad2a3ded2010-08-27 13:19:0512#include "base/command_line.h"
[email protected]3b63f8f42011-03-28 01:54:1513#include "base/memory/singleton.h"
[email protected]8a6ff28d2010-12-02 16:35:1914#include "base/string_number_conversions.h"
[email protected]d208f4d82011-05-23 21:52:0315#include "base/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0516#include "base/values.h"
[email protected]65bfd9972012-10-19 03:39:3717#include "cc/switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0518#include "chrome/browser/prefs/pref_service.h"
[email protected]1bc78422011-03-31 08:41:3819#include "chrome/browser/prefs/scoped_user_pref_update.h"
[email protected]d208f4d82011-05-23 21:52:0320#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0521#include "chrome/common/chrome_switches.h"
22#include "chrome/common/pref_names.h"
[email protected]7f6f44c2011-12-14 13:23:3823#include "content/public/browser/user_metrics.h"
[email protected]d96aef22012-10-30 11:47:0224#include "grit/chromium_strings.h"
[email protected]ad2a3ded2010-08-27 13:19:0525#include "grit/generated_resources.h"
[email protected]d96aef22012-10-30 11:47:0226#include "grit/google_chrome_strings.h"
[email protected]e2e8e322012-09-12 04:37:0227#include "media/base/media_switches.h"
[email protected]0bc6c272012-07-17 03:32:0328#include "ui/app_list/app_list_switches.h"
[email protected]c051a1b2011-01-21 23:30:1729#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5930#include "ui/base/ui_base_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4831#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2732#include "ui/gl/gl_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0533
[email protected]dc04be7c2012-03-15 23:57:4934#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3135#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4936#endif
37
38#if defined(USE_AURA)
[email protected]308aaa32012-03-12 13:14:5039#include "ui/aura/aura_switches.h"
[email protected]8cc10df2011-11-03 23:57:5040#endif
41
[email protected]badba1ad2012-11-16 17:21:4642#if defined(OS_CHROMEOS)
43#include "chromeos/chromeos_switches.h"
44#endif
45
[email protected]7f6f44c2011-12-14 13:23:3846using content::UserMetricsAction;
47
[email protected]1a47d7e2010-10-15 00:37:2448namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0549
[email protected]8a6ff28d2010-12-02 16:35:1950// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5351#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
52 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
53#define SINGLE_VALUE_TYPE(command_line_switch) \
54 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
55#define MULTI_VALUE_TYPE(choices) \
[email protected]0e6f56d2011-02-12 23:45:1556 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1957
[email protected]e2ddbc92010-10-15 20:02:0758namespace {
59
[email protected]9c7453d2012-01-21 00:45:4060const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]ad2a3ded2010-08-27 13:19:0561
[email protected]cc3e2052011-12-20 01:01:4062// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
63// whether the experiment is available on that platform.
64void AddOsStrings(unsigned bitmask, ListValue* list) {
65 struct {
66 unsigned bit;
67 const char* const name;
68 } kBitsToOs[] = {
69 {kOsMac, "Mac"},
70 {kOsWin, "Windows"},
71 {kOsLinux, "Linux"},
72 {kOsCrOS, "Chrome OS"},
73 };
74 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
75 if (bitmask & kBitsToOs[i].bit)
76 list->Append(new StringValue(kBitsToOs[i].name));
77}
78
[email protected]68317802012-06-07 19:13:2379const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
80 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
81 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
82 switches::kOmniboxHistoryQuickProviderNewScoring,
83 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
84 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
85 switches::kOmniboxHistoryQuickProviderNewScoring,
86 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
87};
88
[email protected]128dc6c2012-06-22 20:30:3589const Experiment::Choice
90 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
91 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
92 "",
93 "" },
94 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
95 switches::kOmniboxHistoryQuickProviderReorderForInlining,
96 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
98 switches::kOmniboxHistoryQuickProviderReorderForInlining,
99 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
100};
101
[email protected]032d5e6c2012-02-17 17:53:55102const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
103 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
104 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
105 switches::kOmniboxInlineHistoryQuickProvider,
106 switches::kOmniboxInlineHistoryQuickProviderAllowed },
107 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
108 switches::kOmniboxInlineHistoryQuickProvider,
109 switches::kOmniboxInlineHistoryQuickProviderProhibited }
110};
111
[email protected]de023762012-07-26 17:10:17112const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = {
113 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
114 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
115 switches::kEnableFixedPositionCreatesStackingContext, ""},
116 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
117 switches::kDisableFixedPositionCreatesStackingContext, ""}
118};
119
[email protected]9b19cf82012-06-13 06:23:23120const Experiment::Choice kForceCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20121 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
122 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]9b19cf82012-06-13 06:23:23123 switches::kForceCompositingMode, ""},
[email protected]a45c69402012-06-24 16:32:20124 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]9b19cf82012-06-13 06:23:23125 switches::kDisableForceCompositingMode, ""}
126};
127
[email protected]72787e392012-03-23 05:55:43128const Experiment::Choice kThreadedCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20129 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
130 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]72787e392012-03-23 05:55:43131 switches::kDisableThreadedCompositing, ""},
[email protected]a45c69402012-06-24 16:32:20132 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]72787e392012-03-23 05:55:43133 switches::kEnableThreadedCompositing, ""}
134};
135
[email protected]d7932532012-11-21 21:10:31136const Experiment::Choice kTouchEventsChoices[] = {
137 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
138 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
139 switches::kTouchEvents,
140 switches::kTouchEventsEnabled },
141 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
142 switches::kTouchEvents,
143 switches::kTouchEventsDisabled }
144};
145
[email protected]347a0c72012-05-14 20:28:06146const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31147 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20148 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06149 switches::kTouchOptimizedUI,
150 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06152 switches::kTouchOptimizedUI,
153 switches::kTouchOptimizedUIDisabled }
154};
155
[email protected]026876f32012-08-22 23:53:40156const Experiment::Choice kAsyncDnsChoices[] = {
157 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
158 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
159 switches::kDisableAsyncDns, ""},
160 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
161 switches::kEnableAsyncDns, ""}
162};
163
[email protected]66f409c2012-10-04 20:59:04164const Experiment::Choice kNaClDebugMaskChoices[] = {
165 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
166 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
167 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
168 // an option to switch off its debugging.
169 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
170 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
171 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
172 switches::kNaClDebugMask, "*://*/*debug.nmf" }
173};
174
[email protected]544471a2012-10-13 05:27:09175const Experiment::Choice kActionBoxChoices[] = {
176 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
177 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
178 switches::kActionBox, "0"},
179 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
180 switches::kActionBox, "1"}
181};
182
183const Experiment::Choice kScriptBubbleChoices[] = {
184 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
185 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
186 switches::kScriptBubble, "0"},
187 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
188 switches::kScriptBubble, "1"}
189};
190
[email protected]0b9383a2012-10-26 00:58:16191const Experiment::Choice kTabCaptureChoices[] = {
192 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
193 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
194 switches::kTabCapture, "0"},
195 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
196 switches::kTabCapture, "1"}
197};
198
[email protected]ea2f3342012-09-21 21:13:36199#if defined(OS_CHROMEOS)
200const Experiment::Choice kAshBootAnimationFunction[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
202 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
203 ash::switches::kAshBootAnimationFunction2, ""},
204 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
205 ash::switches::kAshBootAnimationFunction3, ""}
206};
[email protected]d96aef22012-10-30 11:47:02207
208const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19209 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02210 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19211 switches::kEnableChromeCaptivePortalDetector, ""},
212 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
213 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02214};
[email protected]ea2f3342012-09-21 21:13:36215#endif
216
[email protected]347a0c72012-05-14 20:28:06217
[email protected]4bc5050c2010-11-18 17:55:54218// RECORDING USER METRICS FOR FLAGS:
219// -----------------------------------------------------------------------------
220// The first line of the experiment is the internal name. If you'd like to
221// gather statistics about the usage of your flag, you should append a marker
222// comment to the end of the feature name, like so:
223// "my-special-feature", // FLAGS:RECORD_UMA
224//
225// After doing that, run //chrome/tools/extract_actions.py (see instructions at
226// the top of that file for details) to update the chromeactions.txt file, which
227// will enable UMA to record your feature flag.
228//
[email protected]783d5bb2012-10-24 03:47:14229// After your feature has shipped under a flag, you can locate the metrics under
230// the action name AboutFlags_internal-action-name. Actions are recorded once
231// per startup, so you should divide this number by AboutFlags_StartupTick to
232// get a sense of usage. Note that this will not be the same as number of users
233// with a given feature enabled because users can quit and relaunch the
234// application multiple times over a given time interval. The dashboard also
235// shows you how many (metrics reporting) users have enabled the flag over the
236// last seven days. However, note that this is not the same as the number of
237// users who have the flag enabled, since enabling the flag happens once,
238// whereas running with the flag enabled happens until the user flips the flag
239// again.
[email protected]4bc5050c2010-11-18 17:55:54240
[email protected]8a6ff28d2010-12-02 16:35:19241// To add a new experiment add to the end of kExperiments. There are two
242// distinct types of experiments:
243// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
244// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22245// . MULTI_VALUE: a list of choices, the first of which should correspond to a
246// deactivated state for this lab (i.e. no command line option). To specify
247// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
248// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19249// See the documentation of Experiment for details on the fields.
250//
251// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05252const Experiment kExperiments[] = {
253 {
[email protected]aac169d2011-03-18 19:53:03254 "expose-for-tabs", // FLAGS:RECORD_UMA
255 IDS_FLAGS_TABPOSE_NAME,
256 IDS_FLAGS_TABPOSE_DESCRIPTION,
257 kOsMac,
258#if defined(OS_MACOSX)
259 // The switch exists only on OS X.
260 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
261#else
262 SINGLE_VALUE_TYPE("")
263#endif
264 },
265 {
[email protected]4bc5050c2010-11-18 17:55:54266 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05267 IDS_FLAGS_CONFLICTS_CHECK_NAME,
268 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
269 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19270 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05271 },
272 {
[email protected]4bc5050c2010-11-18 17:55:54273 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54274 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
275 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45276 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22277 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31278 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22279 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
280 // always have PDF rasterization available, so no flag needed there.
281#if !defined(GOOGLE_CHROME_BUILD)
282 kOsWin,
283#else
284 0,
[email protected]fa6d2a2f2010-11-30 21:47:19285#endif
[email protected]8a6ff28d2010-12-02 16:35:19286 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42287 },
[email protected]60d77bd2012-08-22 00:10:07288#if defined(OS_WIN)
289 {
290 "print-raster",
291 IDS_FLAGS_PRINT_RASTER_NAME,
292 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
293 kOsWin,
294 SINGLE_VALUE_TYPE(switches::kPrintRaster)
295 },
296#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05297 {
[email protected]bb461532010-11-26 21:50:23298 "crxless-web-apps",
299 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
300 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
301 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19302 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23303 },
304 {
[email protected]96c6f4c2011-05-18 19:36:22305 "ignore-gpu-blacklist",
306 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
307 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
308 kOsAll,
309 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
310 },
311 {
[email protected]0110cf112011-07-02 00:39:43312 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22313 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
314 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23315 kOsMac | kOsWin | kOsLinux,
316 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22317 },
318 {
[email protected]72787e392012-03-23 05:55:43319 "threaded-compositing-mode",
320 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
321 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59322 kOsAll,
[email protected]72787e392012-03-23 05:55:43323 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59324 },
325 {
[email protected]81c64af62012-06-06 20:15:52326 "disable-accelerated-2d-canvas",
327 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
328 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
329 kOsAll,
330 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
331 },
332 {
[email protected]69cffc82012-08-10 13:27:27333 "disable-deferred-2d-canvas",
334 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
335 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
336 kOsAll,
337 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
338 },
339 {
[email protected]efcde132012-05-30 01:05:18340 "disable-threaded-animation",
341 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
342 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59343 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37344 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59345 },
346 {
[email protected]5963b772011-02-09 22:55:38347 "composited-layer-borders",
348 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
349 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
350 kOsAll,
351 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
352 },
353 {
[email protected]a8f1eaa2011-03-07 19:00:58354 "show-fps-counter",
355 IDS_FLAGS_SHOW_FPS_COUNTER,
356 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
357 kOsAll,
358 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
359 },
[email protected]8ff7f342011-05-25 01:49:47360 {
[email protected]70c98a332011-12-21 20:51:52361 "accelerated-filters",
362 IDS_FLAGS_ACCELERATED_FILTERS,
363 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
364 kOsAll,
365 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
366 },
367 {
[email protected]8ff7f342011-05-25 01:49:47368 "disable-gpu-vsync",
369 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
370 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
371 kOsAll,
372 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
373 },
[email protected]deaba6d52011-09-23 14:47:12374 {
375 "disable-webgl",
376 IDS_FLAGS_DISABLE_WEBGL_NAME,
377 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
378 kOsAll,
379 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
380 },
[email protected]09096e02012-05-24 11:12:04381 {
[email protected]96bcdc102012-05-24 23:42:10382 "fixed-position-creates-stacking-context",
383 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
384 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
385 kOsAll,
[email protected]de023762012-07-26 17:10:17386 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10387 },
[email protected]a7640ef22012-10-06 00:52:08388 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53389 {
[email protected]e3791ce92011-08-09 01:03:32390 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40391 IDS_FLAGS_ENABLE_NACL_NAME,
392 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
393 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19394 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40395 },
[email protected]b39c6d92012-01-31 16:38:41396 // TODO(halyavin): When exception handling is on by default, replace this
397 // flag with disable-nacl-exception-handling.
398 {
399 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
400 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
401 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]bf2c61b2012-08-30 16:37:04402 kOsAll,
[email protected]b39c6d92012-01-31 16:38:41403 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
404 },
[email protected]4ff87d202010-11-06 01:28:40405 {
[email protected]9addd1c2012-09-15 14:28:24406 "enable-nacl-debug", // FLAGS:RECORD_UMA
407 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
408 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]401b90792012-05-30 11:41:13409 kOsAll,
[email protected]9addd1c2012-09-15 14:28:24410 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13411 },
412 {
[email protected]66f409c2012-10-04 20:59:04413 "nacl-debug-mask", // FLAGS:RECORD_UMA
414 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
415 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
416 kOsAll,
417 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
418 },
419 {
[email protected]7babd1c2012-08-08 20:35:29420 "enable-pnacl", // FLAGS:RECORD_UMA
421 IDS_FLAGS_ENABLE_PNACL_NAME,
422 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
423 kOsAll,
424 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
425 },
[email protected]a7640ef22012-10-06 00:52:08426 // TODO(bbudge): When NaCl switches to the IPC-based proxy, remove this
427 // flag entry.
428 {
[email protected]45a9c0a2012-11-08 21:00:29429 "enable-nacl-srpc-proxy", // FLAGS:RECORD_UMA
430 IDS_FLAGS_ENABLE_NACL_SRPC_PROXY_NAME,
431 IDS_FLAGS_ENABLE_NACL_SRPC_PROXY_DESCRIPTION,
[email protected]a7640ef22012-10-06 00:52:08432 kOsAll,
[email protected]45a9c0a2012-11-08 21:00:29433 SINGLE_VALUE_TYPE(switches::kEnableNaClSRPCProxy)
[email protected]a7640ef22012-10-06 00:52:08434 },
[email protected]7babd1c2012-08-08 20:35:29435 {
[email protected]4bc5050c2010-11-18 17:55:54436 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32437 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
438 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
439 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19440 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32441 },
[email protected]3627b06d2010-11-12 16:36:16442 {
[email protected]544471a2012-10-13 05:27:09443 "action-box",
[email protected]cab18ef2012-04-27 07:22:03444 IDS_FLAGS_ACTION_BOX_NAME,
445 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
446 kOsAll,
[email protected]544471a2012-10-13 05:27:09447 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03448 },
449 {
[email protected]3a362432012-06-18 20:39:51450 "script-badges",
451 IDS_FLAGS_SCRIPT_BADGES_NAME,
452 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
453 kOsAll,
[email protected]544471a2012-10-13 05:27:09454 SINGLE_VALUE_TYPE(switches::kScriptBadges)
455 },
456 {
457 "script-bubble",
458 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
459 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
460 kOsAll,
461 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51462 },
463 {
[email protected]cbe224d2011-08-04 22:12:49464 "apps-new-install-bubble",
465 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
466 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
467 kOsAll,
468 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
469 },
470 {
[email protected]80bd24e2010-11-30 09:34:38471 "disable-hyperlink-auditing",
472 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
473 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
474 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19475 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51476 },
477 {
478 "experimental-location-features", // FLAGS:RECORD_UMA
479 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
480 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
481 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19482 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
483 },
484 {
[email protected]5aea1862011-03-23 23:55:39485 "tab-groups-context-menu",
486 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
487 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
488 kOsWin,
489 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
490 },
[email protected]c94cebd2012-06-21 00:55:28491 {
492 "enable-instant-extended-api",
493 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
494 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
495 kOsAll,
496 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
497 },
[email protected]e9bf9d92011-03-31 20:57:15498 {
[email protected]354e33b2011-06-15 00:29:10499 "static-ip-config",
500 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
501 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
502 kOsCrOS,
503#if defined(OS_CHROMEOS)
504 // This switch exists only on Chrome OS.
505 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
506#else
507 SINGLE_VALUE_TYPE("")
508#endif
509 },
[email protected]3eb5728c2011-06-20 22:32:24510 {
511 "show-autofill-type-predictions",
512 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
513 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
514 kOsAll,
515 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
516 },
[email protected]bff4d3e2011-06-21 23:58:52517 {
[email protected]fdf4e252012-04-27 00:26:55518 "sync-tab-favicons",
519 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
520 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
521 kOsAll,
522 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
523 },
524 {
[email protected]aae9eeb12011-10-21 21:59:26525 "sync-app-notifications",
526 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
527 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
528 kOsAll,
[email protected]0b6fba82011-11-18 01:31:11529 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26530 },
531 {
[email protected]5d90a0a2012-11-15 02:43:40532 "sync-keystore-encryption",
533 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
534 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
535 kOsAll,
536 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
537 },
538 {
[email protected]e755a382012-09-13 17:16:35539 "enable-gesture-tap-highlight",
540 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
541 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
542 kOsLinux | kOsCrOS,
543 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
544 },
545 {
[email protected]a22ebd812011-06-23 00:05:39546 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
547 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
548 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
549 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40550 // On by default for the Mac (different implementation in WebKit).
[email protected]554b7062011-09-03 03:09:40551 kOsWin | kOsLinux | kOsCrOS,
[email protected]a22ebd812011-06-23 00:05:39552 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
553 },
[email protected]81a6b0b2011-06-24 17:55:40554 {
[email protected]68317802012-06-07 19:13:23555 "omnibox-history-quick-provider-new-scoring",
556 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
557 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
558 kOsAll,
559 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
560 },
561 {
[email protected]128dc6c2012-06-22 20:30:35562 "omnibox-history-quick-provider-reorder-for-inlining",
563 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
564 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
565 kOsAll,
566 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
567 },
568 {
[email protected]032d5e6c2012-02-17 17:53:55569 "omnibox-inline-history-quick-provider",
570 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
571 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
572 kOsAll,
573 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
574 },
575 {
[email protected]7e7a28092011-12-09 22:24:55576 "enable-panels",
577 IDS_FLAGS_ENABLE_PANELS_NAME,
578 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]73fb1fc52011-07-09 00:06:54579 kOsAll,
[email protected]7e7a28092011-12-09 22:24:55580 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54581 },
[email protected]e3749d12011-07-25 22:22:12582 {
[email protected]fd38cc82012-12-19 18:19:29583 "enable-panel-stacking",
584 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
585 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
586 kOsAll,
587 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
588 },
589 {
[email protected]27c14f02012-06-22 17:29:58590 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27591 "save-page-as-mhtml", // FLAGS:RECORD_UMA
592 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
593 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
594 kOsMac | kOsWin | kOsLinux,
595 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
596 },
597 {
[email protected]b7bb44f2011-09-01 05:17:03598 "enable-autologin",
599 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
600 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
601 kOsMac | kOsWin | kOsLinux,
602 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
603 },
[email protected]b9841172011-09-26 23:36:09604 {
[email protected]bbadb112011-12-12 16:55:28605 "enable-http-pipelining",
606 IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME,
607 IDS_FLAGS_ENABLE_HTTP_PIPELINING_DESCRIPTION,
608 kOsAll,
609 SINGLE_VALUE_TYPE(switches::kEnableHttpPipelining)
610 },
[email protected]d411c01d2011-10-18 16:00:27611 {
[email protected]3231b612012-03-23 05:57:54612 "enable-spdy3",
613 IDS_FLAGS_ENABLE_SPDY3_NAME,
614 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
615 kOsAll,
616 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
617 },
618 {
[email protected]27b3fe92012-03-21 05:35:06619 "enable-async-dns",
620 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
621 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46622 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40623 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06624 },
625 {
[email protected]1eb93802012-09-11 18:57:56626 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11627 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
628 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32629 kOsAll,
[email protected]da43c082012-09-07 18:56:11630 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44631 },
[email protected]e4e68dbb2011-11-18 01:50:22632 {
[email protected]9f5b7822012-04-18 23:39:03633 "enable-encrypted-media",
634 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
635 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
636 kOsAll,
637 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
638 },
[email protected]f88628792012-12-18 07:07:50639 {
640 "enable-opus-playback",
641 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
642 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
643 kOsAll,
644 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
645 },
[email protected]dc04be7c2012-03-15 23:57:49646#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50647 {
[email protected]cda278d2012-10-30 20:31:40648 "ash-disable-auto-window-placement",
649 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
650 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
651 kOsWin | kOsLinux | kOsCrOS,
652 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
653 },
[email protected]b4e4ec42012-11-29 21:42:40654 {
655 "ash-enable-per-app-launcher",
656 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_NAME,
657 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_DESCRIPTION,
658 kOsWin | kOsLinux | kOsCrOS,
659 SINGLE_VALUE_TYPE(ash::switches::kAshEnablePerAppLauncher)
660 },
[email protected]dc04be7c2012-03-15 23:57:49661#endif
[email protected]eaae8b462012-01-20 22:20:39662 {
[email protected]db543d322011-12-15 20:40:15663 "per-tile-painting",
664 IDS_FLAGS_PER_TILE_PAINTING_NAME,
665 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
666#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37667 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15668#else
669 0,
670#endif
[email protected]65bfd9972012-10-19 03:39:37671 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15672 },
[email protected]bf88c032011-12-22 19:05:47673 {
674 "enable-javascript-harmony",
675 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
676 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
677 kOsAll,
678 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
679 },
[email protected]7e7f378a2012-01-05 14:35:37680 {
[email protected]85646172012-01-09 22:45:54681 "enable-tab-browser-dragging",
682 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
683 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
684 kOsWin,
685 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
686 },
687 {
[email protected]068b7b52012-02-27 12:41:44688 "disable-restore-session-state",
689 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
690 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37691 kOsAll,
[email protected]068b7b52012-02-27 12:41:44692 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37693 },
[email protected]88864db2012-01-18 20:56:35694 {
695 "disable-software-rasterizer",
696 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
697 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
698#if defined(ENABLE_SWIFTSHADER)
699 kOsAll,
700#else
701 0,
702#endif
703 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
704 },
[email protected]15a5d722012-01-23 09:11:14705 {
[email protected]ff7b6dd2012-09-15 20:20:03706 "enable-experimental-webkit-features",
707 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
708 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16709 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03710 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49711 },
712 {
[email protected]0f95a252012-09-13 22:30:04713 "enable-css-shaders",
714 IDS_FLAGS_CSS_SHADERS_NAME,
715 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
716 kOsAll,
717 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
718 },
719 {
[email protected]9860c68b2012-02-02 01:58:09720 "enable-extension-activity-ui",
721 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
722 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
723 kOsAll,
724 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00725 },
[email protected]54ae4e92012-02-16 15:19:05726 {
[email protected]3e8befc2012-03-13 01:17:03727 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16728 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
729 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
730 kOsAll,
[email protected]3e8befc2012-03-13 01:17:03731 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16732 },
[email protected]dc04be7c2012-03-15 23:57:49733#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01734 {
[email protected]3cd198a22012-03-12 20:38:01735 "enable-ash-oak",
736 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
737 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
738 kOsAll,
739 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
740 },
[email protected]31cf1c52012-02-29 20:55:01741#endif
[email protected]184ec592012-03-01 11:54:28742 {
743 "enable-devtools-experiments",
744 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
745 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
746 kOsAll,
747 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
748 },
[email protected]76d1854e2012-03-02 23:57:44749 {
750 "enable-suggestions-ntp",
751 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
752 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
753 kOsAll,
754 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
755 },
[email protected]a3d54252012-04-05 20:04:13756 {
[email protected]1dbaf5e2012-11-30 05:51:32757 "spellcheck-autocorrect",
758 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
759 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
760 kOsWin | kOsLinux | kOsCrOS,
761 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
762 },
763 {
[email protected]d7932532012-11-21 21:10:31764 "touch-events",
765 IDS_TOUCH_EVENTS_NAME,
766 IDS_TOUCH_EVENTS_DESCRIPTION,
767 kOsAll,
768 MULTI_VALUE_TYPE(kTouchEventsChoices)
769 },
770 {
[email protected]c9c73ad42012-04-18 03:35:59771 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06772 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
773 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55774 kOsWin,
[email protected]347a0c72012-05-14 20:28:06775 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59776 },
[email protected]8a6aaa72012-04-20 20:53:58777 {
[email protected]f6f82832012-09-04 17:12:04778 "enable-webkit-text-subpixel-positioning",
779 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
780 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
781 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48782 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04783 },
784 {
[email protected]b9c96ff2012-11-26 22:24:40785 "disable-touch-adjustment",
786 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
787 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
788 kOsWin | kOsLinux | kOsCrOS,
789 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
790 },
791 {
[email protected]0b9383a2012-10-26 00:58:16792 "enable-tab-capture",
793 IDS_ENABLE_TAB_CAPTURE_NAME,
794 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25795 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16796 MULTI_VALUE_TYPE(kTabCaptureChoices)
797 },
[email protected]0b60afa2012-04-19 17:36:39798#if defined(OS_CHROMEOS)
799 {
[email protected]7c4a9bc2012-09-11 22:10:05800 "enable-background-loader",
801 IDS_ENABLE_BACKLOADER_NAME,
802 IDS_ENABLE_BACKLOADER_DESCRIPTION,
803 kOsCrOS,
804 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
805 },
806 {
[email protected]c5667b282012-08-31 00:32:50807 "enable-bezel-touch",
808 IDS_ENABLE_BEZEL_TOUCH_NAME,
809 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47810 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50811 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47812 },
813 {
[email protected]0b60afa2012-04-19 17:36:39814 "no-discard-tabs",
815 IDS_FLAGS_NO_DISCARD_TABS_NAME,
816 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
817 kOsCrOS,
818 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
819 },
820#endif
[email protected]79be6d32012-04-24 20:47:44821 {
[email protected]9a5940d2012-04-27 19:16:23822 "allow-nacl-socket-api",
823 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
824 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
825 kOsAll,
826 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
827 },
[email protected]85333732012-05-01 19:02:24828 {
[email protected]60673ad72012-05-02 06:16:33829 "stacked-tab-strip",
830 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
831 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
832 kOsWin,
833 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
834 },
835 {
[email protected]4bd20202012-06-14 17:35:01836 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24837 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
838 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
839 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01840 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24841 },
[email protected]190349fd2012-05-02 00:10:47842#if defined(OS_CHROMEOS)
843 {
844 "allow-touchpad-three-finger-click",
845 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
846 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
847 kOsCrOS,
848 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
849 },
[email protected]fbc176b62012-10-27 02:19:58850 {
851 "allow-touchpad-three-finger-swipe",
852 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
853 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
854 kOsCrOS,
855 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
856 },
[email protected]190349fd2012-05-02 00:10:47857#endif
[email protected]1992a2f42012-10-23 18:32:21858 {
[email protected]3420d9a2012-12-13 02:30:01859 "use-web-based-signin-flow",
860 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_NAME,
861 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21862 kOsMac | kOsWin | kOsLinux,
[email protected]3420d9a2012-12-13 02:30:01863 SINGLE_VALUE_TYPE(switches::kUseWebBasedSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21864 },
[email protected]8ee02242012-12-04 15:23:32865 {
866 "enable-desktop-guest-mode",
867 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
868 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
869 kOsMac | kOsWin | kOsLinux,
870 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
871 },
[email protected]53520b1b2012-05-07 21:43:37872#if defined(USE_ASH)
873 {
[email protected]55444502012-05-10 15:43:53874 "show-launcher-alignment-menu",
875 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
876 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
877 kOsAll,
878 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
879 },
[email protected]817ecd12012-05-16 18:36:53880 {
[email protected]73074742012-05-17 01:44:41881 "show-touch-hud",
882 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
883 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
884 kOsAll,
885 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
886 },
887 {
[email protected]9f0940b62012-05-23 22:56:35888 "enable-pinch",
889 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
890 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06891 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35892 SINGLE_VALUE_TYPE(switches::kEnablePinch),
893 },
[email protected]a8379312012-06-15 00:20:43894 {
895 "app-list-show-apps-only",
896 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
897 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
898 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03899 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43900 },
[email protected]73074742012-05-17 01:44:41901#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28902#if defined(OS_CHROMEOS)
903 {
[email protected]e03dc78d2012-07-24 08:21:43904 "disable-new-oobe",
905 IDS_FLAGS_DISABLE_NEW_OOBE,
906 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:28907 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:43908 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:28909 },
[email protected]8b04a1652012-08-04 02:59:49910 {
[email protected]528ced32012-12-14 00:40:44911 "disable-new-password-changed-dialog",
912 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
913 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
914 kOsCrOS,
915 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
916 },
917 {
[email protected]8b04a1652012-08-04 02:59:49918 "disable-boot-animation",
919 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
920 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
921 kOsCrOS,
922 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
923 },
[email protected]95058572012-08-20 14:57:29924 {
[email protected]b4557192012-09-19 11:29:58925 "disable-boot-animation2",
926 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
927 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
928 kOsCrOS,
929 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
930 },
931 {
[email protected]ea2f3342012-09-21 21:13:36932 "boot-animation-fucntion",
933 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
934 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
935 kOsCrOS,
936 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
937 },
[email protected]839667d62012-10-23 19:38:57938 {
[email protected]d96aef22012-10-30 11:47:02939 "captive-portal-detector",
940 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
941 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
942 kOsCrOS,
943 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
944 },
945 {
[email protected]c11aa8f12012-12-18 18:43:14946 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57947 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
948 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
949 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14950 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57951 },
[email protected]f0280952012-11-06 20:30:50952 {
[email protected]0fb5c4852012-11-08 20:33:23953 "file-manager-packaged",
954 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
955 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
956 kOsCrOS,
957 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
958 },
[email protected]3e035e82012-11-27 20:54:32959 {
[email protected]62018dc2012-12-13 00:37:35960 "enable-launcher-per-display",
961 IDS_FLAGS_ENABLE_LAUNCHER_PER_DISPLAY_NAME,
962 IDS_FLAGS_ENABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
963 kOsCrOS,
964 SINGLE_VALUE_TYPE(ash::switches::kAshLauncherPerDisplay),
965 },
966#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:39967 {
968 "enable-views-textfield",
969 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
970 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
971 kOsWin,
972 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
973 },
[email protected]bd0cd3bb2012-06-14 03:03:38974 {
[email protected]ef41b7ee2012-07-24 19:10:41975 "old-checkbox-style",
976 IDS_FLAGS_OLD_CHECKBOX_STYLE,
977 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
978 kOsLinux | kOsCrOS,
979 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
980 },
981 {
[email protected]2d4817742012-12-17 20:16:18982 "enable-new-dialog-style",
983 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
984 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:32985 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:18986 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:32987 },
[email protected]7db8893a2012-07-26 00:49:40988 { "disable-accelerated-video-decode",
989 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
990 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]66dcb0492012-06-18 22:32:15991 kOsAll,
[email protected]7db8893a2012-07-26 00:49:40992 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:15993 },
[email protected]66ae9fc2012-06-19 21:33:52994#if defined(USE_ASH)
995 {
996 "ash-debug-shortcuts",
997 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
998 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
999 kOsAll,
1000 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1001 },
1002#endif
[email protected]37fee0942012-08-07 21:07:451003 {
[email protected]9a8e9352012-08-24 00:45:171004 "disable-website-settings", // FLAGS:RECORD_UMA
1005 IDS_FLAGS_DISABLE_WEBSITE_SETTINGS_NAME,
1006 IDS_FLAGS_DISABLE_WEBSITE_SETTINGS_DESCRIPTION,
[email protected]37fee0942012-08-07 21:07:451007 kOsAll,
[email protected]9a8e9352012-08-24 00:45:171008 SINGLE_VALUE_TYPE(switches::kDisableWebsiteSettings),
[email protected]37fee0942012-08-07 21:07:451009 },
[email protected]ad3f6d22012-08-29 02:34:191010 {
[email protected]e2e8e322012-09-12 04:37:021011 "enable-webaudio-input",
1012 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1013 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
1014 kOsAll,
1015 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1016 },
1017 {
[email protected]ad3f6d22012-08-29 02:34:191018 "enable-contacts",
1019 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1020 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1021 kOsCrOS,
1022 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1023 },
[email protected]1d9bb9cd2012-08-28 22:02:501024#if defined(USE_ASH)
1025 { "ash-enable-advanced-gestures",
1026 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1027 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1028 kOsCrOS,
1029 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1030 },
[email protected]51075f8c2012-11-13 01:48:161031 { "ash-enable-tab-scrubbing",
1032 IDS_FLAGS_ENABLE_TAB_SCRUBBING_NAME,
1033 IDS_FLAGS_ENABLE_TAB_SCRUBBING_DESCRIPTION,
1034 kOsCrOS,
1035 SINGLE_VALUE_TYPE(switches::kAshEnableTabScrubbing),
1036 },
[email protected]83eef802012-12-02 07:43:521037 { "ash-enable-workspace-scrubbing",
1038 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1039 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1040 kOsCrOS,
1041 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1042 },
[email protected]c043df272012-11-21 00:43:241043 { "ash-enable-immersive-mode",
1044 IDS_FLAGS_ENABLE_IMMERSIVE_MODE_NAME,
1045 IDS_FLAGS_ENABLE_IMMERSIVE_MODE_DESCRIPTION,
1046 kOsCrOS,
1047 SINGLE_VALUE_TYPE(ash::switches::kAshImmersive),
1048 },
[email protected]316708a2012-11-05 22:57:021049#if defined(OS_LINUX)
1050 { "ash-enable-memory-monitor",
1051 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1052 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1053 kOsCrOS,
1054 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1055 },
1056#endif
[email protected]1d9bb9cd2012-08-28 22:02:501057#endif
[email protected]9b7ab882012-09-10 23:46:361058#if defined(OS_CHROMEOS)
[email protected]badba1ad2012-11-16 17:21:461059 { "enable-new-network-handlers",
1060 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_NAME,
1061 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_DESCRIPTION,
1062 kOsCrOS,
1063 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewNetworkHandlers),
1064 },
[email protected]9b7ab882012-09-10 23:46:361065 {
[email protected]205f07892012-10-16 20:26:221066 "enable-carrier-switching",
1067 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1068 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1069 kOsCrOS,
1070 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1071 },
1072 {
[email protected]9b7ab882012-09-10 23:46:361073 "enable-request-tablet-site",
1074 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1075 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1076 kOsCrOS,
1077 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1078 },
1079#endif
[email protected]dab49c0b2012-10-04 05:55:351080 {
1081 "debug-packed-apps",
1082 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1083 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1084 kOsAll,
1085 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1086 },
[email protected]d1459ed2012-10-10 01:29:331087 {
1088 "enable-password-generation",
1089 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1090 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f5d230b32012-12-11 02:04:111091 kOsAll,
[email protected]d1459ed2012-10-10 01:29:331092 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1093 },
[email protected]26d045f2012-10-18 21:18:431094 {
1095 "crash-on-gpu-hang",
1096 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1097 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1098 kOsAll,
1099 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1100 },
[email protected]075543d2012-10-24 01:29:141101 {
[email protected]76f7d4882012-10-26 21:09:221102 "enable-deferred-image-decoding",
1103 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1104 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1105#if defined(USE_SKIA)
1106 kOsMac | kOsLinux | kOsCrOS,
1107#else
1108 0,
1109#endif
1110 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1111 },
1112 {
[email protected]075543d2012-10-24 01:29:141113 "performance-monitor-gathering",
1114 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1115 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1116 kOsAll,
1117 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1118 },
[email protected]783d5bb2012-10-24 03:47:141119 {
[email protected]0572fb2e2012-11-03 00:38:591120 "enable-new-autofill-ui",
1121 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1122 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
1123 kOsWin | kOsLinux,
1124 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1125 },
1126 {
[email protected]783d5bb2012-10-24 03:47:141127 "enable-new-autofill-heuristics",
1128 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1129 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1130 kOsAll,
1131 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1132 },
[email protected]2c273bd2012-10-25 18:55:031133 {
[email protected]99002fd2012-11-06 04:35:521134 "show-app-list-shortcut",
1135 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1136 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1137 kOsWin,
1138 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1139 },
[email protected]a7259fb2012-11-08 06:22:231140 {
1141 "enable-experimental-form-filling",
1142 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1143 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1144 kOsWin | kOsCrOS,
1145 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1146 },
[email protected]aa75e4ed2012-11-08 23:51:511147 {
1148 "enable-interactive-autocomplete",
1149 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1150 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1151 kOsWin | kOsCrOS,
1152 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1153 },
[email protected]e42b1f82012-11-16 21:18:461154#if defined(USE_AURA)
1155 {
1156 "enable-overscroll-history-navigation",
1157 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1158 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1159 kOsAll,
1160 SINGLE_VALUE_TYPE(switches::kEnableOverscrollHistoryNavigation)
1161 },
1162#endif
[email protected]3a6446f12012-12-08 16:55:291163
[email protected]edbea622012-11-28 20:39:381164 {
1165 "enable-touch-drag-drop",
1166 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1167 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1168 kOsWin | kOsCrOS,
1169 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1170 },
[email protected]3a6446f12012-12-08 16:55:291171 {
1172 "load-cloud-policy-on-signin",
1173 IDS_FLAGS_DESKTOP_CLOUD_POLICY_NAME,
1174 IDS_FLAGS_DESKTOP_CLOUD_POLICY_DESCRIPTION,
1175 kOsWin | kOsMac | kOsLinux,
1176 SINGLE_VALUE_TYPE(switches::kLoadCloudPolicyOnSignin)
[email protected]92e12dd92012-12-11 03:33:201177 },
1178 {
1179 "enable-rich-notifications",
1180 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1181 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1182 kOsWin | kOsCrOS,
1183 SINGLE_VALUE_TYPE(switches::kEnableRichNotifications)
1184 },
[email protected]4d51c682012-12-11 11:34:551185 {
1186 "full-history-sync",
1187 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1188 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1189 kOsAll,
1190 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1191 },
[email protected]a0e4b072011-08-17 01:47:071192};
[email protected]ad2a3ded2010-08-27 13:19:051193
[email protected]a314ee5a2010-10-26 21:23:281194const Experiment* experiments = kExperiments;
1195size_t num_experiments = arraysize(kExperiments);
1196
[email protected]e2ddbc92010-10-15 20:02:071197// Stores and encapsulates the little state that about:flags has.
1198class FlagsState {
1199 public:
1200 FlagsState() : needs_restart_(false) {}
1201 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1202 bool IsRestartNeededToCommitChanges();
1203 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281204 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071205 void RemoveFlagsSwitches(
1206 std::map<std::string, CommandLine::StringType>* switch_list);
1207 void reset();
1208
1209 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551210 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071211 return Singleton<FlagsState>::get();
1212 }
1213
1214 private:
1215 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531216 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071217
1218 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1219};
1220
[email protected]c7b7800a2010-10-07 18:51:351221// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051222// in a set.
[email protected]1a47d7e2010-10-15 00:37:241223void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051224 const ListValue* enabled_experiments = prefs->GetList(
1225 prefs::kEnabledLabsExperiments);
1226 if (!enabled_experiments)
1227 return;
1228
1229 for (ListValue::const_iterator it = enabled_experiments->begin();
1230 it != enabled_experiments->end();
1231 ++it) {
1232 std::string experiment_name;
1233 if (!(*it)->GetAsString(&experiment_name)) {
1234 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1235 continue;
1236 }
1237 result->insert(experiment_name);
1238 }
1239}
1240
1241// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241242void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051243 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381244 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1245 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051246
1247 experiments_list->Clear();
1248 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1249 it != enabled_experiments.end();
1250 ++it) {
1251 experiments_list->Append(new StringValue(*it));
1252 }
1253}
1254
[email protected]8a6ff28d2010-12-02 16:35:191255// Returns the name used in prefs for the choice at the specified index.
1256std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341257 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1258 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191259 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1260 base::IntToString(index);
1261}
1262
1263// Adds the internal names for the specified experiment to |names|.
1264void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1265 if (e.type == Experiment::SINGLE_VALUE) {
1266 names->insert(e.internal_name);
1267 } else {
[email protected]2ce9c89752011-02-25 18:24:341268 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191269 for (int i = 0; i < e.num_choices; ++i)
1270 names->insert(NameForChoice(e, i));
1271 }
1272}
1273
[email protected]28e35af2011-02-09 12:56:221274// Confirms that an experiment is valid, used in a DCHECK in
1275// SanitizeList below.
1276bool ValidateExperiment(const Experiment& e) {
1277 switch (e.type) {
1278 case Experiment::SINGLE_VALUE:
1279 DCHECK_EQ(0, e.num_choices);
1280 DCHECK(!e.choices);
1281 break;
1282 case Experiment::MULTI_VALUE:
1283 DCHECK_GT(e.num_choices, 0);
1284 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531285 DCHECK(e.choices[0].command_line_switch);
1286 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221287 break;
1288 default:
1289 NOTREACHED();
1290 }
1291 return true;
1292}
1293
[email protected]ad2a3ded2010-08-27 13:19:051294// Removes all experiments from prefs::kEnabledLabsExperiments that are
1295// unknown, to prevent this list to become very long as experiments are added
1296// and removed.
1297void SanitizeList(PrefService* prefs) {
1298 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221299 for (size_t i = 0; i < num_experiments; ++i) {
1300 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191301 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221302 }
[email protected]ad2a3ded2010-08-27 13:19:051303
1304 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241305 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051306
1307 std::set<std::string> new_enabled_experiments;
1308 std::set_intersection(
1309 known_experiments.begin(), known_experiments.end(),
1310 enabled_experiments.begin(), enabled_experiments.end(),
1311 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1312
[email protected]4c8853f2012-07-23 01:29:161313 if (new_enabled_experiments != enabled_experiments)
1314 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051315}
1316
[email protected]1a47d7e2010-10-15 00:37:241317void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051318 PrefService* prefs, std::set<std::string>* result) {
1319 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241320 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051321}
1322
[email protected]a314ee5a2010-10-26 21:23:281323// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1324// enabled on the current platform.
1325void GetSanitizedEnabledFlagsForCurrentPlatform(
1326 PrefService* prefs, std::set<std::string>* result) {
1327 GetSanitizedEnabledFlags(prefs, result);
1328
1329 // Filter out any experiments that aren't enabled on the current platform. We
1330 // don't remove these from prefs else syncing to a platform with a different
1331 // set of experiments would be lossy.
1332 std::set<std::string> platform_experiments;
1333 int current_platform = GetCurrentPlatform();
1334 for (size_t i = 0; i < num_experiments; ++i) {
1335 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191336 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281337 }
1338
1339 std::set<std::string> new_enabled_experiments;
1340 std::set_intersection(
1341 platform_experiments.begin(), platform_experiments.end(),
1342 result->begin(), result->end(),
1343 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1344
1345 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051346}
1347
[email protected]8a6ff28d2010-12-02 16:35:191348// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191349Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221350 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341351 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191352 ListValue* result = new ListValue;
1353 for (int i = 0; i < experiment.num_choices; ++i) {
1354 const Experiment::Choice& choice = experiment.choices[i];
1355 DictionaryValue* value = new DictionaryValue;
1356 std::string name = NameForChoice(experiment, i);
1357 value->SetString("description",
1358 l10n_util::GetStringUTF16(choice.description_id));
1359 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221360 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191361 result->Append(value);
1362 }
1363 return result;
1364}
1365
[email protected]e2ddbc92010-10-15 20:02:071366} // namespace
1367
[email protected]1a47d7e2010-10-15 00:37:241368void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551369 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051370}
1371
[email protected]1a47d7e2010-10-15 00:37:241372ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051373 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241374 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051375
1376 int current_platform = GetCurrentPlatform();
1377
1378 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281379 for (size_t i = 0; i < num_experiments; ++i) {
1380 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051381
1382 DictionaryValue* data = new DictionaryValue();
1383 data->SetString("internal_name", experiment.internal_name);
1384 data->SetString("name",
1385 l10n_util::GetStringUTF16(experiment.visible_name_id));
1386 data->SetString("description",
1387 l10n_util::GetStringUTF16(
1388 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401389 bool supported = !!(experiment.supported_platforms & current_platform);
1390 data->SetBoolean("supported", supported);
1391
1392 ListValue* supported_platforms = new ListValue();
1393 AddOsStrings(experiment.supported_platforms, supported_platforms);
1394 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051395
[email protected]28e35af2011-02-09 12:56:221396 switch (experiment.type) {
1397 case Experiment::SINGLE_VALUE:
1398 data->SetBoolean(
1399 "enabled",
1400 enabled_experiments.count(experiment.internal_name) > 0);
1401 break;
1402 case Experiment::MULTI_VALUE:
1403 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1404 break;
1405 default:
1406 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191407 }
1408
[email protected]ad2a3ded2010-08-27 13:19:051409 experiments_data->Append(data);
1410 }
1411 return experiments_data;
1412}
1413
[email protected]ad2a3ded2010-08-27 13:19:051414bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551415 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051416}
1417
1418void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351419 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551420 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071421}
1422
1423void RemoveFlagsSwitches(
1424 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551425 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071426}
1427
[email protected]a314ee5a2010-10-26 21:23:281428int GetCurrentPlatform() {
1429#if defined(OS_MACOSX)
1430 return kOsMac;
1431#elif defined(OS_WIN)
1432 return kOsWin;
1433#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1434 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211435#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281436 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401437#elif defined(OS_ANDROID)
1438 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281439#else
1440#error Unknown platform
1441#endif
1442}
1443
[email protected]4bc5050c2010-11-18 17:55:541444void RecordUMAStatistics(const PrefService* prefs) {
1445 std::set<std::string> flags;
1446 GetEnabledFlags(prefs, &flags);
1447 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1448 ++it) {
1449 std::string action("AboutFlags_");
1450 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381451 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541452 }
1453 // Since flag metrics are recorded every startup, add a tick so that the
1454 // stats can be made meaningful.
1455 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381456 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1457 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541458}
1459
[email protected]e2ddbc92010-10-15 20:02:071460//////////////////////////////////////////////////////////////////////////////
1461// FlagsState implementation.
1462
1463namespace {
1464
1465void FlagsState::ConvertFlagsToSwitches(
1466 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071467 if (command_line->HasSwitch(switches::kNoExperiments))
1468 return;
1469
1470 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001471
[email protected]a314ee5a2010-10-26 21:23:281472 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071473
[email protected]a82744532011-02-11 16:15:531474 typedef std::map<std::string, std::pair<std::string, std::string> >
1475 NameToSwitchAndValueMap;
1476 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191477 for (size_t i = 0; i < num_experiments; ++i) {
1478 const Experiment& e = experiments[i];
1479 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531480 name_to_switch_map[e.internal_name] =
1481 std::pair<std::string, std::string>(e.command_line_switch,
1482 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191483 } else {
1484 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531485 name_to_switch_map[NameForChoice(e, j)] =
1486 std::pair<std::string, std::string>(
1487 e.choices[j].command_line_switch,
1488 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191489 }
1490 }
[email protected]e2ddbc92010-10-15 20:02:071491
1492 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531493 flags_switches_.insert(
1494 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1495 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071496 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1497 it != enabled_experiments.end();
1498 ++it) {
1499 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531500 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191501 name_to_switch_map.find(experiment_name);
1502 if (name_to_switch_it == name_to_switch_map.end()) {
1503 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071504 continue;
[email protected]8a6ff28d2010-12-02 16:35:191505 }
[email protected]e2ddbc92010-10-15 20:02:071506
[email protected]a82744532011-02-11 16:15:531507 const std::pair<std::string, std::string>&
1508 switch_and_value_pair = name_to_switch_it->second;
1509
1510 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1511 switch_and_value_pair.second);
1512 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071513 }
1514 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531515 flags_switches_.insert(
1516 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1517 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071518}
1519
1520bool FlagsState::IsRestartNeededToCommitChanges() {
1521 return needs_restart_;
1522}
1523
1524void FlagsState::SetExperimentEnabled(
1525 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051526 needs_restart_ = true;
1527
[email protected]8a6ff28d2010-12-02 16:35:191528 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1529 if (at_index != std::string::npos) {
1530 DCHECK(enable);
1531 // We're being asked to enable a multi-choice experiment. Disable the
1532 // currently selected choice.
1533 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221534 const std::string experiment_name = internal_name.substr(0, at_index);
1535 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191536
[email protected]28e35af2011-02-09 12:56:221537 // And enable the new choice, if it is not the default first choice.
1538 if (internal_name != experiment_name + "@0") {
1539 std::set<std::string> enabled_experiments;
1540 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1541 enabled_experiments.insert(internal_name);
1542 SetEnabledFlags(prefs, enabled_experiments);
1543 }
[email protected]8a6ff28d2010-12-02 16:35:191544 return;
1545 }
1546
[email protected]ad2a3ded2010-08-27 13:19:051547 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241548 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051549
[email protected]8a6ff28d2010-12-02 16:35:191550 const Experiment* e = NULL;
1551 for (size_t i = 0; i < num_experiments; ++i) {
1552 if (experiments[i].internal_name == internal_name) {
1553 e = experiments + i;
1554 break;
1555 }
1556 }
1557 DCHECK(e);
1558
1559 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591560 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191561 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591562 else
[email protected]8a6ff28d2010-12-02 16:35:191563 enabled_experiments.erase(internal_name);
1564 } else {
1565 if (enable) {
1566 // Enable the first choice.
1567 enabled_experiments.insert(NameForChoice(*e, 0));
1568 } else {
1569 // Find the currently enabled choice and disable it.
1570 for (int i = 0; i < e->num_choices; ++i) {
1571 std::string choice_name = NameForChoice(*e, i);
1572 if (enabled_experiments.find(choice_name) !=
1573 enabled_experiments.end()) {
1574 enabled_experiments.erase(choice_name);
1575 // Continue on just in case there's a bug and more than one
1576 // experiment for this choice was enabled.
1577 }
1578 }
1579 }
1580 }
[email protected]ad2a3ded2010-08-27 13:19:051581
[email protected]1a47d7e2010-10-15 00:37:241582 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051583}
1584
[email protected]e2ddbc92010-10-15 20:02:071585void FlagsState::RemoveFlagsSwitches(
1586 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531587 for (std::map<std::string, std::string>::const_iterator
1588 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1589 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071590 }
1591}
1592
1593void FlagsState::reset() {
1594 needs_restart_ = false;
1595 flags_switches_.clear();
1596}
1597
[email protected]38e46812011-05-09 20:49:221598} // namespace
[email protected]e2ddbc92010-10-15 20:02:071599
1600namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191601
1602// WARNING: '@' is also used in the html file. If you update this constant you
1603// also need to update the html file.
1604const char kMultiSeparator[] = "@";
1605
[email protected]e2ddbc92010-10-15 20:02:071606void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551607 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071608}
[email protected]a314ee5a2010-10-26 21:23:281609
1610void SetExperiments(const Experiment* e, size_t count) {
1611 if (!e) {
1612 experiments = kExperiments;
1613 num_experiments = arraysize(kExperiments);
1614 } else {
1615 experiments = e;
1616 num_experiments = count;
1617 }
1618}
1619
[email protected]8a6ff28d2010-12-02 16:35:191620const Experiment* GetExperiments(size_t* count) {
1621 *count = num_experiments;
1622 return experiments;
1623}
1624
[email protected]e2ddbc92010-10-15 20:02:071625} // namespace testing
1626
[email protected]1a47d7e2010-10-15 00:37:241627} // namespace about_flags