blob: b49d6c9f25937601659199d746c7ce4eb63e3dce [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]d153e6f2012-12-21 07:38:09217#if defined(USE_ASH)
218const Experiment::Choice kAshImmersiveModeChoices[] = {
219 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
220 { IDS_FLAGS_ASH_IMMERSIVE_HIDE_TAB_INDICATORS,
221 ash::switches::kAshImmersiveHideTabIndicators, ""}
222};
223#endif
[email protected]347a0c72012-05-14 20:28:06224
[email protected]4bc5050c2010-11-18 17:55:54225// RECORDING USER METRICS FOR FLAGS:
226// -----------------------------------------------------------------------------
227// The first line of the experiment is the internal name. If you'd like to
228// gather statistics about the usage of your flag, you should append a marker
229// comment to the end of the feature name, like so:
230// "my-special-feature", // FLAGS:RECORD_UMA
231//
232// After doing that, run //chrome/tools/extract_actions.py (see instructions at
233// the top of that file for details) to update the chromeactions.txt file, which
234// will enable UMA to record your feature flag.
235//
[email protected]783d5bb2012-10-24 03:47:14236// After your feature has shipped under a flag, you can locate the metrics under
237// the action name AboutFlags_internal-action-name. Actions are recorded once
238// per startup, so you should divide this number by AboutFlags_StartupTick to
239// get a sense of usage. Note that this will not be the same as number of users
240// with a given feature enabled because users can quit and relaunch the
241// application multiple times over a given time interval. The dashboard also
242// shows you how many (metrics reporting) users have enabled the flag over the
243// last seven days. However, note that this is not the same as the number of
244// users who have the flag enabled, since enabling the flag happens once,
245// whereas running with the flag enabled happens until the user flips the flag
246// again.
[email protected]4bc5050c2010-11-18 17:55:54247
[email protected]8a6ff28d2010-12-02 16:35:19248// To add a new experiment add to the end of kExperiments. There are two
249// distinct types of experiments:
250// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
251// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22252// . MULTI_VALUE: a list of choices, the first of which should correspond to a
253// deactivated state for this lab (i.e. no command line option). To specify
254// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
255// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19256// See the documentation of Experiment for details on the fields.
257//
258// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05259const Experiment kExperiments[] = {
260 {
[email protected]aac169d2011-03-18 19:53:03261 "expose-for-tabs", // FLAGS:RECORD_UMA
262 IDS_FLAGS_TABPOSE_NAME,
263 IDS_FLAGS_TABPOSE_DESCRIPTION,
264 kOsMac,
265#if defined(OS_MACOSX)
266 // The switch exists only on OS X.
267 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
268#else
269 SINGLE_VALUE_TYPE("")
270#endif
271 },
272 {
[email protected]4bc5050c2010-11-18 17:55:54273 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05274 IDS_FLAGS_CONFLICTS_CHECK_NAME,
275 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
276 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19277 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05278 },
279 {
[email protected]4bc5050c2010-11-18 17:55:54280 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54281 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
282 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45283 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22284 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31285 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22286 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
287 // always have PDF rasterization available, so no flag needed there.
288#if !defined(GOOGLE_CHROME_BUILD)
289 kOsWin,
290#else
291 0,
[email protected]fa6d2a2f2010-11-30 21:47:19292#endif
[email protected]8a6ff28d2010-12-02 16:35:19293 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42294 },
[email protected]60d77bd2012-08-22 00:10:07295#if defined(OS_WIN)
296 {
297 "print-raster",
298 IDS_FLAGS_PRINT_RASTER_NAME,
299 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
300 kOsWin,
301 SINGLE_VALUE_TYPE(switches::kPrintRaster)
302 },
303#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05304 {
[email protected]bb461532010-11-26 21:50:23305 "crxless-web-apps",
306 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
307 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
308 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19309 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23310 },
311 {
[email protected]96c6f4c2011-05-18 19:36:22312 "ignore-gpu-blacklist",
313 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
314 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
315 kOsAll,
316 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
317 },
318 {
[email protected]0110cf112011-07-02 00:39:43319 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22320 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
321 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23322 kOsMac | kOsWin | kOsLinux,
323 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22324 },
325 {
[email protected]72787e392012-03-23 05:55:43326 "threaded-compositing-mode",
327 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
328 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59329 kOsAll,
[email protected]72787e392012-03-23 05:55:43330 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59331 },
332 {
[email protected]81c64af62012-06-06 20:15:52333 "disable-accelerated-2d-canvas",
334 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
335 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
336 kOsAll,
337 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
338 },
339 {
[email protected]69cffc82012-08-10 13:27:27340 "disable-deferred-2d-canvas",
341 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
342 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
343 kOsAll,
344 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
345 },
346 {
[email protected]efcde132012-05-30 01:05:18347 "disable-threaded-animation",
348 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
349 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59350 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37351 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59352 },
353 {
[email protected]5963b772011-02-09 22:55:38354 "composited-layer-borders",
355 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
356 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
357 kOsAll,
358 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
359 },
360 {
[email protected]a8f1eaa2011-03-07 19:00:58361 "show-fps-counter",
362 IDS_FLAGS_SHOW_FPS_COUNTER,
363 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
364 kOsAll,
365 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
366 },
[email protected]8ff7f342011-05-25 01:49:47367 {
[email protected]70c98a332011-12-21 20:51:52368 "accelerated-filters",
369 IDS_FLAGS_ACCELERATED_FILTERS,
370 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
371 kOsAll,
372 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
373 },
374 {
[email protected]8ff7f342011-05-25 01:49:47375 "disable-gpu-vsync",
376 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
377 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
378 kOsAll,
379 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
380 },
[email protected]deaba6d52011-09-23 14:47:12381 {
382 "disable-webgl",
383 IDS_FLAGS_DISABLE_WEBGL_NAME,
384 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
385 kOsAll,
386 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
387 },
[email protected]09096e02012-05-24 11:12:04388 {
[email protected]96bcdc102012-05-24 23:42:10389 "fixed-position-creates-stacking-context",
390 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
391 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
392 kOsAll,
[email protected]de023762012-07-26 17:10:17393 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10394 },
[email protected]a7640ef22012-10-06 00:52:08395 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53396 {
[email protected]e3791ce92011-08-09 01:03:32397 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40398 IDS_FLAGS_ENABLE_NACL_NAME,
399 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
400 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19401 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40402 },
[email protected]b39c6d92012-01-31 16:38:41403 // TODO(halyavin): When exception handling is on by default, replace this
404 // flag with disable-nacl-exception-handling.
405 {
406 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
407 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
408 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]bf2c61b2012-08-30 16:37:04409 kOsAll,
[email protected]b39c6d92012-01-31 16:38:41410 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
411 },
[email protected]4ff87d202010-11-06 01:28:40412 {
[email protected]9addd1c2012-09-15 14:28:24413 "enable-nacl-debug", // FLAGS:RECORD_UMA
414 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
415 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]401b90792012-05-30 11:41:13416 kOsAll,
[email protected]9addd1c2012-09-15 14:28:24417 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13418 },
419 {
[email protected]66f409c2012-10-04 20:59:04420 "nacl-debug-mask", // FLAGS:RECORD_UMA
421 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
422 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
423 kOsAll,
424 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
425 },
426 {
[email protected]7babd1c2012-08-08 20:35:29427 "enable-pnacl", // FLAGS:RECORD_UMA
428 IDS_FLAGS_ENABLE_PNACL_NAME,
429 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
430 kOsAll,
431 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
432 },
[email protected]a7640ef22012-10-06 00:52:08433 // TODO(bbudge): When NaCl switches to the IPC-based proxy, remove this
434 // flag entry.
435 {
[email protected]45a9c0a2012-11-08 21:00:29436 "enable-nacl-srpc-proxy", // FLAGS:RECORD_UMA
437 IDS_FLAGS_ENABLE_NACL_SRPC_PROXY_NAME,
438 IDS_FLAGS_ENABLE_NACL_SRPC_PROXY_DESCRIPTION,
[email protected]a7640ef22012-10-06 00:52:08439 kOsAll,
[email protected]45a9c0a2012-11-08 21:00:29440 SINGLE_VALUE_TYPE(switches::kEnableNaClSRPCProxy)
[email protected]a7640ef22012-10-06 00:52:08441 },
[email protected]7babd1c2012-08-08 20:35:29442 {
[email protected]4bc5050c2010-11-18 17:55:54443 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32444 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
445 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
446 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19447 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32448 },
[email protected]3627b06d2010-11-12 16:36:16449 {
[email protected]544471a2012-10-13 05:27:09450 "action-box",
[email protected]cab18ef2012-04-27 07:22:03451 IDS_FLAGS_ACTION_BOX_NAME,
452 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
453 kOsAll,
[email protected]544471a2012-10-13 05:27:09454 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03455 },
456 {
[email protected]3a362432012-06-18 20:39:51457 "script-badges",
458 IDS_FLAGS_SCRIPT_BADGES_NAME,
459 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
460 kOsAll,
[email protected]544471a2012-10-13 05:27:09461 SINGLE_VALUE_TYPE(switches::kScriptBadges)
462 },
463 {
464 "script-bubble",
465 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
466 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
467 kOsAll,
468 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51469 },
470 {
[email protected]cbe224d2011-08-04 22:12:49471 "apps-new-install-bubble",
472 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
473 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
474 kOsAll,
475 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
476 },
477 {
[email protected]80bd24e2010-11-30 09:34:38478 "disable-hyperlink-auditing",
479 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
480 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
481 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19482 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51483 },
484 {
485 "experimental-location-features", // FLAGS:RECORD_UMA
486 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
487 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
488 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19489 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
490 },
491 {
[email protected]5aea1862011-03-23 23:55:39492 "tab-groups-context-menu",
493 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
494 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
495 kOsWin,
496 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
497 },
[email protected]c94cebd2012-06-21 00:55:28498 {
499 "enable-instant-extended-api",
500 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
501 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
502 kOsAll,
503 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
504 },
[email protected]e9bf9d92011-03-31 20:57:15505 {
[email protected]354e33b2011-06-15 00:29:10506 "static-ip-config",
507 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
508 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
509 kOsCrOS,
510#if defined(OS_CHROMEOS)
511 // This switch exists only on Chrome OS.
512 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
513#else
514 SINGLE_VALUE_TYPE("")
515#endif
516 },
[email protected]3eb5728c2011-06-20 22:32:24517 {
518 "show-autofill-type-predictions",
519 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
520 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
521 kOsAll,
522 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
523 },
[email protected]bff4d3e2011-06-21 23:58:52524 {
[email protected]fdf4e252012-04-27 00:26:55525 "sync-tab-favicons",
526 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
527 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
528 kOsAll,
529 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
530 },
531 {
[email protected]aae9eeb12011-10-21 21:59:26532 "sync-app-notifications",
533 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
534 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
535 kOsAll,
[email protected]0b6fba82011-11-18 01:31:11536 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26537 },
538 {
[email protected]5d90a0a2012-11-15 02:43:40539 "sync-keystore-encryption",
540 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
541 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
542 kOsAll,
543 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
544 },
545 {
[email protected]e755a382012-09-13 17:16:35546 "enable-gesture-tap-highlight",
547 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
548 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
549 kOsLinux | kOsCrOS,
550 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
551 },
552 {
[email protected]a22ebd812011-06-23 00:05:39553 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
554 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
555 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
556 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40557 // On by default for the Mac (different implementation in WebKit).
[email protected]554b7062011-09-03 03:09:40558 kOsWin | kOsLinux | kOsCrOS,
[email protected]a22ebd812011-06-23 00:05:39559 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
560 },
[email protected]81a6b0b2011-06-24 17:55:40561 {
[email protected]68317802012-06-07 19:13:23562 "omnibox-history-quick-provider-new-scoring",
563 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
564 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
565 kOsAll,
566 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
567 },
568 {
[email protected]128dc6c2012-06-22 20:30:35569 "omnibox-history-quick-provider-reorder-for-inlining",
570 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
571 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
572 kOsAll,
573 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
574 },
575 {
[email protected]032d5e6c2012-02-17 17:53:55576 "omnibox-inline-history-quick-provider",
577 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
578 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
579 kOsAll,
580 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
581 },
582 {
[email protected]7e7a28092011-12-09 22:24:55583 "enable-panels",
584 IDS_FLAGS_ENABLE_PANELS_NAME,
585 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]73fb1fc52011-07-09 00:06:54586 kOsAll,
[email protected]7e7a28092011-12-09 22:24:55587 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54588 },
[email protected]e3749d12011-07-25 22:22:12589 {
[email protected]fd38cc82012-12-19 18:19:29590 "enable-panel-stacking",
591 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
592 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
593 kOsAll,
594 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
595 },
596 {
[email protected]27c14f02012-06-22 17:29:58597 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27598 "save-page-as-mhtml", // FLAGS:RECORD_UMA
599 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
600 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
601 kOsMac | kOsWin | kOsLinux,
602 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
603 },
604 {
[email protected]b7bb44f2011-09-01 05:17:03605 "enable-autologin",
606 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
607 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
608 kOsMac | kOsWin | kOsLinux,
609 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
610 },
[email protected]b9841172011-09-26 23:36:09611 {
[email protected]bbadb112011-12-12 16:55:28612 "enable-http-pipelining",
613 IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME,
614 IDS_FLAGS_ENABLE_HTTP_PIPELINING_DESCRIPTION,
615 kOsAll,
616 SINGLE_VALUE_TYPE(switches::kEnableHttpPipelining)
617 },
[email protected]d411c01d2011-10-18 16:00:27618 {
[email protected]3231b612012-03-23 05:57:54619 "enable-spdy3",
620 IDS_FLAGS_ENABLE_SPDY3_NAME,
621 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
622 kOsAll,
623 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
624 },
625 {
[email protected]27b3fe92012-03-21 05:35:06626 "enable-async-dns",
627 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
628 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46629 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40630 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06631 },
632 {
[email protected]1eb93802012-09-11 18:57:56633 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11634 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
635 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32636 kOsAll,
[email protected]da43c082012-09-07 18:56:11637 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44638 },
[email protected]e4e68dbb2011-11-18 01:50:22639 {
[email protected]9f5b7822012-04-18 23:39:03640 "enable-encrypted-media",
641 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
642 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
643 kOsAll,
644 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
645 },
[email protected]f88628792012-12-18 07:07:50646 {
647 "enable-opus-playback",
648 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
649 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
650 kOsAll,
651 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
652 },
[email protected]dc04be7c2012-03-15 23:57:49653#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50654 {
[email protected]cda278d2012-10-30 20:31:40655 "ash-disable-auto-window-placement",
656 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
657 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
658 kOsWin | kOsLinux | kOsCrOS,
659 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
660 },
[email protected]b4e4ec42012-11-29 21:42:40661 {
662 "ash-enable-per-app-launcher",
663 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_NAME,
664 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_DESCRIPTION,
665 kOsWin | kOsLinux | kOsCrOS,
666 SINGLE_VALUE_TYPE(ash::switches::kAshEnablePerAppLauncher)
667 },
[email protected]dc04be7c2012-03-15 23:57:49668#endif
[email protected]eaae8b462012-01-20 22:20:39669 {
[email protected]db543d322011-12-15 20:40:15670 "per-tile-painting",
671 IDS_FLAGS_PER_TILE_PAINTING_NAME,
672 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
673#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37674 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15675#else
676 0,
677#endif
[email protected]65bfd9972012-10-19 03:39:37678 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15679 },
[email protected]bf88c032011-12-22 19:05:47680 {
681 "enable-javascript-harmony",
682 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
683 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
684 kOsAll,
685 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
686 },
[email protected]7e7f378a2012-01-05 14:35:37687 {
[email protected]85646172012-01-09 22:45:54688 "enable-tab-browser-dragging",
689 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
690 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
691 kOsWin,
692 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
693 },
694 {
[email protected]068b7b52012-02-27 12:41:44695 "disable-restore-session-state",
696 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
697 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37698 kOsAll,
[email protected]068b7b52012-02-27 12:41:44699 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37700 },
[email protected]88864db2012-01-18 20:56:35701 {
702 "disable-software-rasterizer",
703 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
704 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
705#if defined(ENABLE_SWIFTSHADER)
706 kOsAll,
707#else
708 0,
709#endif
710 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
711 },
[email protected]15a5d722012-01-23 09:11:14712 {
[email protected]ff7b6dd2012-09-15 20:20:03713 "enable-experimental-webkit-features",
714 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
715 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16716 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03717 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49718 },
719 {
[email protected]0f95a252012-09-13 22:30:04720 "enable-css-shaders",
721 IDS_FLAGS_CSS_SHADERS_NAME,
722 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
723 kOsAll,
724 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
725 },
726 {
[email protected]9860c68b2012-02-02 01:58:09727 "enable-extension-activity-ui",
728 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
729 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
730 kOsAll,
731 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00732 },
[email protected]54ae4e92012-02-16 15:19:05733 {
[email protected]3e8befc2012-03-13 01:17:03734 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16735 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
736 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
737 kOsAll,
[email protected]3e8befc2012-03-13 01:17:03738 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16739 },
[email protected]dc04be7c2012-03-15 23:57:49740#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01741 {
[email protected]3cd198a22012-03-12 20:38:01742 "enable-ash-oak",
743 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
744 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
745 kOsAll,
746 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
747 },
[email protected]31cf1c52012-02-29 20:55:01748#endif
[email protected]184ec592012-03-01 11:54:28749 {
750 "enable-devtools-experiments",
751 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
752 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
753 kOsAll,
754 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
755 },
[email protected]76d1854e2012-03-02 23:57:44756 {
757 "enable-suggestions-ntp",
758 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
759 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
762 },
[email protected]a3d54252012-04-05 20:04:13763 {
[email protected]1dbaf5e2012-11-30 05:51:32764 "spellcheck-autocorrect",
765 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
766 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
767 kOsWin | kOsLinux | kOsCrOS,
768 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
769 },
770 {
[email protected]d7932532012-11-21 21:10:31771 "touch-events",
772 IDS_TOUCH_EVENTS_NAME,
773 IDS_TOUCH_EVENTS_DESCRIPTION,
774 kOsAll,
775 MULTI_VALUE_TYPE(kTouchEventsChoices)
776 },
777 {
[email protected]c9c73ad42012-04-18 03:35:59778 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06779 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
780 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55781 kOsWin,
[email protected]347a0c72012-05-14 20:28:06782 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59783 },
[email protected]8a6aaa72012-04-20 20:53:58784 {
[email protected]f6f82832012-09-04 17:12:04785 "enable-webkit-text-subpixel-positioning",
786 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
787 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
788 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48789 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04790 },
791 {
[email protected]b9c96ff2012-11-26 22:24:40792 "disable-touch-adjustment",
793 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
794 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
795 kOsWin | kOsLinux | kOsCrOS,
796 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
797 },
798 {
[email protected]0b9383a2012-10-26 00:58:16799 "enable-tab-capture",
800 IDS_ENABLE_TAB_CAPTURE_NAME,
801 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25802 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16803 MULTI_VALUE_TYPE(kTabCaptureChoices)
804 },
[email protected]0b60afa2012-04-19 17:36:39805#if defined(OS_CHROMEOS)
806 {
[email protected]7c4a9bc2012-09-11 22:10:05807 "enable-background-loader",
808 IDS_ENABLE_BACKLOADER_NAME,
809 IDS_ENABLE_BACKLOADER_DESCRIPTION,
810 kOsCrOS,
811 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
812 },
813 {
[email protected]c5667b282012-08-31 00:32:50814 "enable-bezel-touch",
815 IDS_ENABLE_BEZEL_TOUCH_NAME,
816 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47817 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50818 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47819 },
820 {
[email protected]0b60afa2012-04-19 17:36:39821 "no-discard-tabs",
822 IDS_FLAGS_NO_DISCARD_TABS_NAME,
823 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
824 kOsCrOS,
825 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
826 },
827#endif
[email protected]79be6d32012-04-24 20:47:44828 {
[email protected]9a5940d2012-04-27 19:16:23829 "allow-nacl-socket-api",
830 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
831 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
832 kOsAll,
833 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
834 },
[email protected]85333732012-05-01 19:02:24835 {
[email protected]60673ad72012-05-02 06:16:33836 "stacked-tab-strip",
837 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
838 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
839 kOsWin,
840 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
841 },
842 {
[email protected]4bd20202012-06-14 17:35:01843 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24844 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
845 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
846 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01847 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24848 },
[email protected]190349fd2012-05-02 00:10:47849#if defined(OS_CHROMEOS)
850 {
851 "allow-touchpad-three-finger-click",
852 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
853 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
854 kOsCrOS,
855 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
856 },
[email protected]fbc176b62012-10-27 02:19:58857 {
858 "allow-touchpad-three-finger-swipe",
859 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
860 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
861 kOsCrOS,
862 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
863 },
[email protected]190349fd2012-05-02 00:10:47864#endif
[email protected]1992a2f42012-10-23 18:32:21865 {
[email protected]3420d9a2012-12-13 02:30:01866 "use-web-based-signin-flow",
867 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_NAME,
868 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21869 kOsMac | kOsWin | kOsLinux,
[email protected]3420d9a2012-12-13 02:30:01870 SINGLE_VALUE_TYPE(switches::kUseWebBasedSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21871 },
[email protected]8ee02242012-12-04 15:23:32872 {
873 "enable-desktop-guest-mode",
874 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
875 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
876 kOsMac | kOsWin | kOsLinux,
877 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
878 },
[email protected]53520b1b2012-05-07 21:43:37879#if defined(USE_ASH)
880 {
[email protected]55444502012-05-10 15:43:53881 "show-launcher-alignment-menu",
882 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
883 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
884 kOsAll,
885 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
886 },
[email protected]817ecd12012-05-16 18:36:53887 {
[email protected]73074742012-05-17 01:44:41888 "show-touch-hud",
889 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
890 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
891 kOsAll,
892 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
893 },
894 {
[email protected]9f0940b62012-05-23 22:56:35895 "enable-pinch",
896 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
897 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06898 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35899 SINGLE_VALUE_TYPE(switches::kEnablePinch),
900 },
[email protected]a8379312012-06-15 00:20:43901 {
902 "app-list-show-apps-only",
903 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
904 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
905 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03906 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43907 },
[email protected]73074742012-05-17 01:44:41908#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28909#if defined(OS_CHROMEOS)
910 {
[email protected]e03dc78d2012-07-24 08:21:43911 "disable-new-oobe",
912 IDS_FLAGS_DISABLE_NEW_OOBE,
913 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:28914 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:43915 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:28916 },
[email protected]8b04a1652012-08-04 02:59:49917 {
[email protected]528ced32012-12-14 00:40:44918 "disable-new-password-changed-dialog",
919 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
920 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
921 kOsCrOS,
922 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
923 },
924 {
[email protected]8b04a1652012-08-04 02:59:49925 "disable-boot-animation",
926 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
927 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
928 kOsCrOS,
929 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
930 },
[email protected]95058572012-08-20 14:57:29931 {
[email protected]b4557192012-09-19 11:29:58932 "disable-boot-animation2",
933 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
934 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
935 kOsCrOS,
936 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
937 },
938 {
[email protected]ea2f3342012-09-21 21:13:36939 "boot-animation-fucntion",
940 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
941 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
942 kOsCrOS,
943 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
944 },
[email protected]839667d62012-10-23 19:38:57945 {
[email protected]d96aef22012-10-30 11:47:02946 "captive-portal-detector",
947 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
948 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
949 kOsCrOS,
950 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
951 },
952 {
[email protected]c11aa8f12012-12-18 18:43:14953 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57954 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
955 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
956 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14957 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57958 },
[email protected]f0280952012-11-06 20:30:50959 {
[email protected]0fb5c4852012-11-08 20:33:23960 "file-manager-packaged",
961 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
962 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
963 kOsCrOS,
964 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
965 },
[email protected]3e035e82012-11-27 20:54:32966 {
[email protected]62018dc2012-12-13 00:37:35967 "enable-launcher-per-display",
968 IDS_FLAGS_ENABLE_LAUNCHER_PER_DISPLAY_NAME,
969 IDS_FLAGS_ENABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
970 kOsCrOS,
971 SINGLE_VALUE_TYPE(ash::switches::kAshLauncherPerDisplay),
972 },
973#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:39974 {
975 "enable-views-textfield",
976 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
977 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
978 kOsWin,
979 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
980 },
[email protected]bd0cd3bb2012-06-14 03:03:38981 {
[email protected]ef41b7ee2012-07-24 19:10:41982 "old-checkbox-style",
983 IDS_FLAGS_OLD_CHECKBOX_STYLE,
984 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
985 kOsLinux | kOsCrOS,
986 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
987 },
988 {
[email protected]2d4817742012-12-17 20:16:18989 "enable-new-dialog-style",
990 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
991 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:32992 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:18993 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:32994 },
[email protected]7db8893a2012-07-26 00:49:40995 { "disable-accelerated-video-decode",
996 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
997 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]66dcb0492012-06-18 22:32:15998 kOsAll,
[email protected]7db8893a2012-07-26 00:49:40999 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151000 },
[email protected]66ae9fc2012-06-19 21:33:521001#if defined(USE_ASH)
1002 {
1003 "ash-debug-shortcuts",
1004 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1005 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1006 kOsAll,
1007 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1008 },
1009#endif
[email protected]37fee0942012-08-07 21:07:451010 {
[email protected]9a8e9352012-08-24 00:45:171011 "disable-website-settings", // FLAGS:RECORD_UMA
1012 IDS_FLAGS_DISABLE_WEBSITE_SETTINGS_NAME,
1013 IDS_FLAGS_DISABLE_WEBSITE_SETTINGS_DESCRIPTION,
[email protected]37fee0942012-08-07 21:07:451014 kOsAll,
[email protected]9a8e9352012-08-24 00:45:171015 SINGLE_VALUE_TYPE(switches::kDisableWebsiteSettings),
[email protected]37fee0942012-08-07 21:07:451016 },
[email protected]ad3f6d22012-08-29 02:34:191017 {
[email protected]e2e8e322012-09-12 04:37:021018 "enable-webaudio-input",
1019 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1020 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
1021 kOsAll,
1022 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1023 },
1024 {
[email protected]ad3f6d22012-08-29 02:34:191025 "enable-contacts",
1026 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1027 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1028 kOsCrOS,
1029 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1030 },
[email protected]1d9bb9cd2012-08-28 22:02:501031#if defined(USE_ASH)
1032 { "ash-enable-advanced-gestures",
1033 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1034 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1035 kOsCrOS,
1036 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1037 },
[email protected]51075f8c2012-11-13 01:48:161038 { "ash-enable-tab-scrubbing",
1039 IDS_FLAGS_ENABLE_TAB_SCRUBBING_NAME,
1040 IDS_FLAGS_ENABLE_TAB_SCRUBBING_DESCRIPTION,
1041 kOsCrOS,
1042 SINGLE_VALUE_TYPE(switches::kAshEnableTabScrubbing),
1043 },
[email protected]83eef802012-12-02 07:43:521044 { "ash-enable-workspace-scrubbing",
1045 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1046 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1047 kOsCrOS,
1048 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1049 },
[email protected]d153e6f2012-12-21 07:38:091050 { "ash-immersive-mode",
1051 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1052 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241053 kOsCrOS,
[email protected]d153e6f2012-12-21 07:38:091054 MULTI_VALUE_TYPE(kAshImmersiveModeChoices),
[email protected]c043df272012-11-21 00:43:241055 },
[email protected]316708a2012-11-05 22:57:021056#if defined(OS_LINUX)
1057 { "ash-enable-memory-monitor",
1058 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1059 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1060 kOsCrOS,
1061 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1062 },
1063#endif
[email protected]1d9bb9cd2012-08-28 22:02:501064#endif
[email protected]9b7ab882012-09-10 23:46:361065#if defined(OS_CHROMEOS)
[email protected]badba1ad2012-11-16 17:21:461066 { "enable-new-network-handlers",
1067 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_NAME,
1068 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_DESCRIPTION,
1069 kOsCrOS,
1070 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewNetworkHandlers),
1071 },
[email protected]9b7ab882012-09-10 23:46:361072 {
[email protected]205f07892012-10-16 20:26:221073 "enable-carrier-switching",
1074 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1075 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1076 kOsCrOS,
1077 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1078 },
1079 {
[email protected]9b7ab882012-09-10 23:46:361080 "enable-request-tablet-site",
1081 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1082 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1083 kOsCrOS,
1084 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1085 },
1086#endif
[email protected]dab49c0b2012-10-04 05:55:351087 {
1088 "debug-packed-apps",
1089 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1090 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
1091 kOsAll,
1092 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1093 },
[email protected]d1459ed2012-10-10 01:29:331094 {
1095 "enable-password-generation",
1096 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1097 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f5d230b32012-12-11 02:04:111098 kOsAll,
[email protected]d1459ed2012-10-10 01:29:331099 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1100 },
[email protected]26d045f2012-10-18 21:18:431101 {
1102 "crash-on-gpu-hang",
1103 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1104 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1105 kOsAll,
1106 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1107 },
[email protected]075543d2012-10-24 01:29:141108 {
[email protected]76f7d4882012-10-26 21:09:221109 "enable-deferred-image-decoding",
1110 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1111 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1112#if defined(USE_SKIA)
1113 kOsMac | kOsLinux | kOsCrOS,
1114#else
1115 0,
1116#endif
1117 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1118 },
1119 {
[email protected]075543d2012-10-24 01:29:141120 "performance-monitor-gathering",
1121 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1122 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1123 kOsAll,
1124 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1125 },
[email protected]783d5bb2012-10-24 03:47:141126 {
[email protected]0572fb2e2012-11-03 00:38:591127 "enable-new-autofill-ui",
1128 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1129 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
1130 kOsWin | kOsLinux,
1131 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1132 },
1133 {
[email protected]783d5bb2012-10-24 03:47:141134 "enable-new-autofill-heuristics",
1135 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1136 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1137 kOsAll,
1138 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1139 },
[email protected]2c273bd2012-10-25 18:55:031140 {
[email protected]99002fd2012-11-06 04:35:521141 "show-app-list-shortcut",
1142 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1143 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1144 kOsWin,
1145 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1146 },
[email protected]a7259fb2012-11-08 06:22:231147 {
1148 "enable-experimental-form-filling",
1149 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1150 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1151 kOsWin | kOsCrOS,
1152 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1153 },
[email protected]aa75e4ed2012-11-08 23:51:511154 {
1155 "enable-interactive-autocomplete",
1156 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1157 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1158 kOsWin | kOsCrOS,
1159 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1160 },
[email protected]e42b1f82012-11-16 21:18:461161#if defined(USE_AURA)
1162 {
1163 "enable-overscroll-history-navigation",
1164 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1165 IDS_FLAGS_ENABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1166 kOsAll,
1167 SINGLE_VALUE_TYPE(switches::kEnableOverscrollHistoryNavigation)
1168 },
1169#endif
[email protected]3a6446f12012-12-08 16:55:291170
[email protected]edbea622012-11-28 20:39:381171 {
1172 "enable-touch-drag-drop",
1173 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1174 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1175 kOsWin | kOsCrOS,
1176 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1177 },
[email protected]3a6446f12012-12-08 16:55:291178 {
1179 "load-cloud-policy-on-signin",
1180 IDS_FLAGS_DESKTOP_CLOUD_POLICY_NAME,
1181 IDS_FLAGS_DESKTOP_CLOUD_POLICY_DESCRIPTION,
1182 kOsWin | kOsMac | kOsLinux,
1183 SINGLE_VALUE_TYPE(switches::kLoadCloudPolicyOnSignin)
[email protected]92e12dd92012-12-11 03:33:201184 },
1185 {
1186 "enable-rich-notifications",
1187 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1188 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1189 kOsWin | kOsCrOS,
1190 SINGLE_VALUE_TYPE(switches::kEnableRichNotifications)
1191 },
[email protected]4d51c682012-12-11 11:34:551192 {
1193 "full-history-sync",
1194 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1195 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1196 kOsAll,
1197 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1198 },
[email protected]a0e4b072011-08-17 01:47:071199};
[email protected]ad2a3ded2010-08-27 13:19:051200
[email protected]a314ee5a2010-10-26 21:23:281201const Experiment* experiments = kExperiments;
1202size_t num_experiments = arraysize(kExperiments);
1203
[email protected]e2ddbc92010-10-15 20:02:071204// Stores and encapsulates the little state that about:flags has.
1205class FlagsState {
1206 public:
1207 FlagsState() : needs_restart_(false) {}
1208 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1209 bool IsRestartNeededToCommitChanges();
1210 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281211 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071212 void RemoveFlagsSwitches(
1213 std::map<std::string, CommandLine::StringType>* switch_list);
1214 void reset();
1215
1216 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551217 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071218 return Singleton<FlagsState>::get();
1219 }
1220
1221 private:
1222 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531223 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071224
1225 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1226};
1227
[email protected]c7b7800a2010-10-07 18:51:351228// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051229// in a set.
[email protected]1a47d7e2010-10-15 00:37:241230void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051231 const ListValue* enabled_experiments = prefs->GetList(
1232 prefs::kEnabledLabsExperiments);
1233 if (!enabled_experiments)
1234 return;
1235
1236 for (ListValue::const_iterator it = enabled_experiments->begin();
1237 it != enabled_experiments->end();
1238 ++it) {
1239 std::string experiment_name;
1240 if (!(*it)->GetAsString(&experiment_name)) {
1241 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1242 continue;
1243 }
1244 result->insert(experiment_name);
1245 }
1246}
1247
1248// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241249void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051250 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381251 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1252 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051253
1254 experiments_list->Clear();
1255 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1256 it != enabled_experiments.end();
1257 ++it) {
1258 experiments_list->Append(new StringValue(*it));
1259 }
1260}
1261
[email protected]8a6ff28d2010-12-02 16:35:191262// Returns the name used in prefs for the choice at the specified index.
1263std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341264 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1265 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191266 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1267 base::IntToString(index);
1268}
1269
1270// Adds the internal names for the specified experiment to |names|.
1271void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1272 if (e.type == Experiment::SINGLE_VALUE) {
1273 names->insert(e.internal_name);
1274 } else {
[email protected]2ce9c89752011-02-25 18:24:341275 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191276 for (int i = 0; i < e.num_choices; ++i)
1277 names->insert(NameForChoice(e, i));
1278 }
1279}
1280
[email protected]28e35af2011-02-09 12:56:221281// Confirms that an experiment is valid, used in a DCHECK in
1282// SanitizeList below.
1283bool ValidateExperiment(const Experiment& e) {
1284 switch (e.type) {
1285 case Experiment::SINGLE_VALUE:
1286 DCHECK_EQ(0, e.num_choices);
1287 DCHECK(!e.choices);
1288 break;
1289 case Experiment::MULTI_VALUE:
1290 DCHECK_GT(e.num_choices, 0);
1291 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531292 DCHECK(e.choices[0].command_line_switch);
1293 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221294 break;
1295 default:
1296 NOTREACHED();
1297 }
1298 return true;
1299}
1300
[email protected]ad2a3ded2010-08-27 13:19:051301// Removes all experiments from prefs::kEnabledLabsExperiments that are
1302// unknown, to prevent this list to become very long as experiments are added
1303// and removed.
1304void SanitizeList(PrefService* prefs) {
1305 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221306 for (size_t i = 0; i < num_experiments; ++i) {
1307 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191308 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221309 }
[email protected]ad2a3ded2010-08-27 13:19:051310
1311 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241312 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051313
1314 std::set<std::string> new_enabled_experiments;
1315 std::set_intersection(
1316 known_experiments.begin(), known_experiments.end(),
1317 enabled_experiments.begin(), enabled_experiments.end(),
1318 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1319
[email protected]4c8853f2012-07-23 01:29:161320 if (new_enabled_experiments != enabled_experiments)
1321 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051322}
1323
[email protected]1a47d7e2010-10-15 00:37:241324void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051325 PrefService* prefs, std::set<std::string>* result) {
1326 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241327 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051328}
1329
[email protected]a314ee5a2010-10-26 21:23:281330// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1331// enabled on the current platform.
1332void GetSanitizedEnabledFlagsForCurrentPlatform(
1333 PrefService* prefs, std::set<std::string>* result) {
1334 GetSanitizedEnabledFlags(prefs, result);
1335
1336 // Filter out any experiments that aren't enabled on the current platform. We
1337 // don't remove these from prefs else syncing to a platform with a different
1338 // set of experiments would be lossy.
1339 std::set<std::string> platform_experiments;
1340 int current_platform = GetCurrentPlatform();
1341 for (size_t i = 0; i < num_experiments; ++i) {
1342 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191343 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281344 }
1345
1346 std::set<std::string> new_enabled_experiments;
1347 std::set_intersection(
1348 platform_experiments.begin(), platform_experiments.end(),
1349 result->begin(), result->end(),
1350 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1351
1352 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051353}
1354
[email protected]8a6ff28d2010-12-02 16:35:191355// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191356Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221357 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341358 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191359 ListValue* result = new ListValue;
1360 for (int i = 0; i < experiment.num_choices; ++i) {
1361 const Experiment::Choice& choice = experiment.choices[i];
1362 DictionaryValue* value = new DictionaryValue;
1363 std::string name = NameForChoice(experiment, i);
1364 value->SetString("description",
1365 l10n_util::GetStringUTF16(choice.description_id));
1366 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221367 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191368 result->Append(value);
1369 }
1370 return result;
1371}
1372
[email protected]e2ddbc92010-10-15 20:02:071373} // namespace
1374
[email protected]1a47d7e2010-10-15 00:37:241375void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551376 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051377}
1378
[email protected]1a47d7e2010-10-15 00:37:241379ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051380 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241381 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051382
1383 int current_platform = GetCurrentPlatform();
1384
1385 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281386 for (size_t i = 0; i < num_experiments; ++i) {
1387 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051388
1389 DictionaryValue* data = new DictionaryValue();
1390 data->SetString("internal_name", experiment.internal_name);
1391 data->SetString("name",
1392 l10n_util::GetStringUTF16(experiment.visible_name_id));
1393 data->SetString("description",
1394 l10n_util::GetStringUTF16(
1395 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401396 bool supported = !!(experiment.supported_platforms & current_platform);
1397 data->SetBoolean("supported", supported);
1398
1399 ListValue* supported_platforms = new ListValue();
1400 AddOsStrings(experiment.supported_platforms, supported_platforms);
1401 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051402
[email protected]28e35af2011-02-09 12:56:221403 switch (experiment.type) {
1404 case Experiment::SINGLE_VALUE:
1405 data->SetBoolean(
1406 "enabled",
1407 enabled_experiments.count(experiment.internal_name) > 0);
1408 break;
1409 case Experiment::MULTI_VALUE:
1410 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1411 break;
1412 default:
1413 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191414 }
1415
[email protected]ad2a3ded2010-08-27 13:19:051416 experiments_data->Append(data);
1417 }
1418 return experiments_data;
1419}
1420
[email protected]ad2a3ded2010-08-27 13:19:051421bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551422 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051423}
1424
1425void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351426 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551427 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071428}
1429
1430void RemoveFlagsSwitches(
1431 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551432 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071433}
1434
[email protected]a314ee5a2010-10-26 21:23:281435int GetCurrentPlatform() {
1436#if defined(OS_MACOSX)
1437 return kOsMac;
1438#elif defined(OS_WIN)
1439 return kOsWin;
1440#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1441 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211442#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281443 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401444#elif defined(OS_ANDROID)
1445 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281446#else
1447#error Unknown platform
1448#endif
1449}
1450
[email protected]4bc5050c2010-11-18 17:55:541451void RecordUMAStatistics(const PrefService* prefs) {
1452 std::set<std::string> flags;
1453 GetEnabledFlags(prefs, &flags);
1454 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1455 ++it) {
1456 std::string action("AboutFlags_");
1457 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381458 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541459 }
1460 // Since flag metrics are recorded every startup, add a tick so that the
1461 // stats can be made meaningful.
1462 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381463 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1464 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541465}
1466
[email protected]e2ddbc92010-10-15 20:02:071467//////////////////////////////////////////////////////////////////////////////
1468// FlagsState implementation.
1469
1470namespace {
1471
1472void FlagsState::ConvertFlagsToSwitches(
1473 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071474 if (command_line->HasSwitch(switches::kNoExperiments))
1475 return;
1476
1477 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001478
[email protected]a314ee5a2010-10-26 21:23:281479 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071480
[email protected]a82744532011-02-11 16:15:531481 typedef std::map<std::string, std::pair<std::string, std::string> >
1482 NameToSwitchAndValueMap;
1483 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191484 for (size_t i = 0; i < num_experiments; ++i) {
1485 const Experiment& e = experiments[i];
1486 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531487 name_to_switch_map[e.internal_name] =
1488 std::pair<std::string, std::string>(e.command_line_switch,
1489 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191490 } else {
1491 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531492 name_to_switch_map[NameForChoice(e, j)] =
1493 std::pair<std::string, std::string>(
1494 e.choices[j].command_line_switch,
1495 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191496 }
1497 }
[email protected]e2ddbc92010-10-15 20:02:071498
1499 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531500 flags_switches_.insert(
1501 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1502 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071503 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1504 it != enabled_experiments.end();
1505 ++it) {
1506 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531507 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191508 name_to_switch_map.find(experiment_name);
1509 if (name_to_switch_it == name_to_switch_map.end()) {
1510 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071511 continue;
[email protected]8a6ff28d2010-12-02 16:35:191512 }
[email protected]e2ddbc92010-10-15 20:02:071513
[email protected]a82744532011-02-11 16:15:531514 const std::pair<std::string, std::string>&
1515 switch_and_value_pair = name_to_switch_it->second;
1516
1517 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1518 switch_and_value_pair.second);
1519 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071520 }
1521 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531522 flags_switches_.insert(
1523 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1524 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071525}
1526
1527bool FlagsState::IsRestartNeededToCommitChanges() {
1528 return needs_restart_;
1529}
1530
1531void FlagsState::SetExperimentEnabled(
1532 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051533 needs_restart_ = true;
1534
[email protected]8a6ff28d2010-12-02 16:35:191535 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1536 if (at_index != std::string::npos) {
1537 DCHECK(enable);
1538 // We're being asked to enable a multi-choice experiment. Disable the
1539 // currently selected choice.
1540 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221541 const std::string experiment_name = internal_name.substr(0, at_index);
1542 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191543
[email protected]28e35af2011-02-09 12:56:221544 // And enable the new choice, if it is not the default first choice.
1545 if (internal_name != experiment_name + "@0") {
1546 std::set<std::string> enabled_experiments;
1547 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1548 enabled_experiments.insert(internal_name);
1549 SetEnabledFlags(prefs, enabled_experiments);
1550 }
[email protected]8a6ff28d2010-12-02 16:35:191551 return;
1552 }
1553
[email protected]ad2a3ded2010-08-27 13:19:051554 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241555 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051556
[email protected]8a6ff28d2010-12-02 16:35:191557 const Experiment* e = NULL;
1558 for (size_t i = 0; i < num_experiments; ++i) {
1559 if (experiments[i].internal_name == internal_name) {
1560 e = experiments + i;
1561 break;
1562 }
1563 }
1564 DCHECK(e);
1565
1566 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591567 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191568 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591569 else
[email protected]8a6ff28d2010-12-02 16:35:191570 enabled_experiments.erase(internal_name);
1571 } else {
1572 if (enable) {
1573 // Enable the first choice.
1574 enabled_experiments.insert(NameForChoice(*e, 0));
1575 } else {
1576 // Find the currently enabled choice and disable it.
1577 for (int i = 0; i < e->num_choices; ++i) {
1578 std::string choice_name = NameForChoice(*e, i);
1579 if (enabled_experiments.find(choice_name) !=
1580 enabled_experiments.end()) {
1581 enabled_experiments.erase(choice_name);
1582 // Continue on just in case there's a bug and more than one
1583 // experiment for this choice was enabled.
1584 }
1585 }
1586 }
1587 }
[email protected]ad2a3ded2010-08-27 13:19:051588
[email protected]1a47d7e2010-10-15 00:37:241589 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051590}
1591
[email protected]e2ddbc92010-10-15 20:02:071592void FlagsState::RemoveFlagsSwitches(
1593 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531594 for (std::map<std::string, std::string>::const_iterator
1595 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1596 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071597 }
1598}
1599
1600void FlagsState::reset() {
1601 needs_restart_ = false;
1602 flags_switches_.clear();
1603}
1604
[email protected]38e46812011-05-09 20:49:221605} // namespace
[email protected]e2ddbc92010-10-15 20:02:071606
1607namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191608
1609// WARNING: '@' is also used in the html file. If you update this constant you
1610// also need to update the html file.
1611const char kMultiSeparator[] = "@";
1612
[email protected]e2ddbc92010-10-15 20:02:071613void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551614 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071615}
[email protected]a314ee5a2010-10-26 21:23:281616
1617void SetExperiments(const Experiment* e, size_t count) {
1618 if (!e) {
1619 experiments = kExperiments;
1620 num_experiments = arraysize(kExperiments);
1621 } else {
1622 experiments = e;
1623 num_experiments = count;
1624 }
1625}
1626
[email protected]8a6ff28d2010-12-02 16:35:191627const Experiment* GetExperiments(size_t* count) {
1628 *count = num_experiments;
1629 return experiments;
1630}
1631
[email protected]e2ddbc92010-10-15 20:02:071632} // namespace testing
1633
[email protected]1a47d7e2010-10-15 00:37:241634} // namespace about_flags