blob: 89e858db1c7631932ac116509597175f366f9286 [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]8b1c3c72013-01-25 01:48:4333#include "ui/surface/surface_switches.h"
[email protected]ad2a3ded2010-08-27 13:19:0534
[email protected]dc04be7c2012-03-15 23:57:4935#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3136#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4937#endif
38
39#if defined(USE_AURA)
[email protected]308aaa32012-03-12 13:14:5040#include "ui/aura/aura_switches.h"
[email protected]8cc10df2011-11-03 23:57:5041#endif
42
[email protected]badba1ad2012-11-16 17:21:4643#if defined(OS_CHROMEOS)
44#include "chromeos/chromeos_switches.h"
45#endif
46
[email protected]7f6f44c2011-12-14 13:23:3847using content::UserMetricsAction;
48
[email protected]1a47d7e2010-10-15 00:37:2449namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0550
[email protected]8a6ff28d2010-12-02 16:35:1951// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5352#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
53 Experiment::SINGLE_VALUE, command_line_switch, switch_value, NULL, 0
54#define SINGLE_VALUE_TYPE(command_line_switch) \
55 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
56#define MULTI_VALUE_TYPE(choices) \
[email protected]0e6f56d2011-02-12 23:45:1557 Experiment::MULTI_VALUE, "", "", choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1958
[email protected]e2ddbc92010-10-15 20:02:0759namespace {
60
[email protected]9c7453d2012-01-21 00:45:4061const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5662const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0563
[email protected]cc3e2052011-12-20 01:01:4064// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
65// whether the experiment is available on that platform.
66void AddOsStrings(unsigned bitmask, ListValue* list) {
67 struct {
68 unsigned bit;
69 const char* const name;
70 } kBitsToOs[] = {
71 {kOsMac, "Mac"},
72 {kOsWin, "Windows"},
73 {kOsLinux, "Linux"},
74 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0175 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4076 };
77 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
78 if (bitmask & kBitsToOs[i].bit)
79 list->Append(new StringValue(kBitsToOs[i].name));
80}
81
[email protected]68317802012-06-07 19:13:2382const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
83 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
84 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
85 switches::kOmniboxHistoryQuickProviderNewScoring,
86 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
87 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
88 switches::kOmniboxHistoryQuickProviderNewScoring,
89 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
90};
91
[email protected]128dc6c2012-06-22 20:30:3592const Experiment::Choice
93 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
94 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
95 "",
96 "" },
97 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
98 switches::kOmniboxHistoryQuickProviderReorderForInlining,
99 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
100 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
101 switches::kOmniboxHistoryQuickProviderReorderForInlining,
102 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
103};
104
[email protected]032d5e6c2012-02-17 17:53:55105const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
106 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
107 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
108 switches::kOmniboxInlineHistoryQuickProvider,
109 switches::kOmniboxInlineHistoryQuickProviderAllowed },
110 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
111 switches::kOmniboxInlineHistoryQuickProvider,
112 switches::kOmniboxInlineHistoryQuickProviderProhibited }
113};
114
[email protected]de023762012-07-26 17:10:17115const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = {
116 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
117 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
118 switches::kEnableFixedPositionCreatesStackingContext, ""},
119 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
120 switches::kDisableFixedPositionCreatesStackingContext, ""}
121};
122
[email protected]9b19cf82012-06-13 06:23:23123const Experiment::Choice kForceCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20124 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
125 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]9b19cf82012-06-13 06:23:23126 switches::kForceCompositingMode, ""},
[email protected]a45c69402012-06-24 16:32:20127 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]9b19cf82012-06-13 06:23:23128 switches::kDisableForceCompositingMode, ""}
129};
130
[email protected]72787e392012-03-23 05:55:43131const Experiment::Choice kThreadedCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20132 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
133 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]72787e392012-03-23 05:55:43134 switches::kDisableThreadedCompositing, ""},
[email protected]a45c69402012-06-24 16:32:20135 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]72787e392012-03-23 05:55:43136 switches::kEnableThreadedCompositing, ""}
137};
138
[email protected]8b1c3c72013-01-25 01:48:43139const Experiment::Choice kGDIPresentChoices[] = {
140 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
141 { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW,
142 switches::kDoFirstShowPresentWithGDI, ""},
143 { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW,
144 switches::kDoAllShowPresentWithGDI, ""}
145};
146
147
[email protected]d7932532012-11-21 21:10:31148const Experiment::Choice kTouchEventsChoices[] = {
149 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
150 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
151 switches::kTouchEvents,
152 switches::kTouchEventsEnabled },
153 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
154 switches::kTouchEvents,
155 switches::kTouchEventsDisabled }
156};
157
[email protected]347a0c72012-05-14 20:28:06158const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31159 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20160 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06161 switches::kTouchOptimizedUI,
162 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20163 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06164 switches::kTouchOptimizedUI,
165 switches::kTouchOptimizedUIDisabled }
166};
167
[email protected]026876f32012-08-22 23:53:40168const Experiment::Choice kAsyncDnsChoices[] = {
169 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
170 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
171 switches::kDisableAsyncDns, ""},
172 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
173 switches::kEnableAsyncDns, ""}
174};
175
[email protected]66f409c2012-10-04 20:59:04176const Experiment::Choice kNaClDebugMaskChoices[] = {
177 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
178 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
179 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
180 // an option to switch off its debugging.
181 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
182 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
183 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
184 switches::kNaClDebugMask, "*://*/*debug.nmf" }
185};
186
[email protected]544471a2012-10-13 05:27:09187const Experiment::Choice kActionBoxChoices[] = {
188 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
189 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
190 switches::kActionBox, "0"},
191 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
192 switches::kActionBox, "1"}
193};
194
195const Experiment::Choice kScriptBubbleChoices[] = {
196 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
197 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
198 switches::kScriptBubble, "0"},
199 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
200 switches::kScriptBubble, "1"}
201};
202
[email protected]0b9383a2012-10-26 00:58:16203const Experiment::Choice kTabCaptureChoices[] = {
204 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
205 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
206 switches::kTabCapture, "0"},
207 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
208 switches::kTabCapture, "1"}
209};
210
[email protected]ea2f3342012-09-21 21:13:36211#if defined(OS_CHROMEOS)
212const Experiment::Choice kAshBootAnimationFunction[] = {
213 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
214 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
215 ash::switches::kAshBootAnimationFunction2, ""},
216 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
217 ash::switches::kAshBootAnimationFunction3, ""}
218};
[email protected]d96aef22012-10-30 11:47:02219
220const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19221 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02222 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19223 switches::kEnableChromeCaptivePortalDetector, ""},
224 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
225 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02226};
[email protected]ea2f3342012-09-21 21:13:36227#endif
228
[email protected]d153e6f2012-12-21 07:38:09229#if defined(USE_ASH)
230const Experiment::Choice kAshImmersiveModeChoices[] = {
231 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
232 { IDS_FLAGS_ASH_IMMERSIVE_HIDE_TAB_INDICATORS,
233 ash::switches::kAshImmersiveHideTabIndicators, ""}
234};
235#endif
[email protected]347a0c72012-05-14 20:28:06236
[email protected]4bc5050c2010-11-18 17:55:54237// RECORDING USER METRICS FOR FLAGS:
238// -----------------------------------------------------------------------------
239// The first line of the experiment is the internal name. If you'd like to
240// gather statistics about the usage of your flag, you should append a marker
241// comment to the end of the feature name, like so:
242// "my-special-feature", // FLAGS:RECORD_UMA
243//
244// After doing that, run //chrome/tools/extract_actions.py (see instructions at
245// the top of that file for details) to update the chromeactions.txt file, which
246// will enable UMA to record your feature flag.
247//
[email protected]783d5bb2012-10-24 03:47:14248// After your feature has shipped under a flag, you can locate the metrics under
249// the action name AboutFlags_internal-action-name. Actions are recorded once
250// per startup, so you should divide this number by AboutFlags_StartupTick to
251// get a sense of usage. Note that this will not be the same as number of users
252// with a given feature enabled because users can quit and relaunch the
253// application multiple times over a given time interval. The dashboard also
254// shows you how many (metrics reporting) users have enabled the flag over the
255// last seven days. However, note that this is not the same as the number of
256// users who have the flag enabled, since enabling the flag happens once,
257// whereas running with the flag enabled happens until the user flips the flag
258// again.
[email protected]4bc5050c2010-11-18 17:55:54259
[email protected]8a6ff28d2010-12-02 16:35:19260// To add a new experiment add to the end of kExperiments. There are two
261// distinct types of experiments:
262// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
263// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22264// . MULTI_VALUE: a list of choices, the first of which should correspond to a
265// deactivated state for this lab (i.e. no command line option). To specify
266// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
267// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19268// See the documentation of Experiment for details on the fields.
269//
270// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05271const Experiment kExperiments[] = {
272 {
[email protected]aac169d2011-03-18 19:53:03273 "expose-for-tabs", // FLAGS:RECORD_UMA
274 IDS_FLAGS_TABPOSE_NAME,
275 IDS_FLAGS_TABPOSE_DESCRIPTION,
276 kOsMac,
277#if defined(OS_MACOSX)
278 // The switch exists only on OS X.
279 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
280#else
281 SINGLE_VALUE_TYPE("")
282#endif
283 },
284 {
[email protected]4bc5050c2010-11-18 17:55:54285 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05286 IDS_FLAGS_CONFLICTS_CHECK_NAME,
287 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
288 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19289 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05290 },
291 {
[email protected]4bc5050c2010-11-18 17:55:54292 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54293 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
294 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45295 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22296 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31297 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22298 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
299 // always have PDF rasterization available, so no flag needed there.
300#if !defined(GOOGLE_CHROME_BUILD)
301 kOsWin,
302#else
303 0,
[email protected]fa6d2a2f2010-11-30 21:47:19304#endif
[email protected]8a6ff28d2010-12-02 16:35:19305 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42306 },
[email protected]60d77bd2012-08-22 00:10:07307#if defined(OS_WIN)
308 {
309 "print-raster",
310 IDS_FLAGS_PRINT_RASTER_NAME,
311 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
312 kOsWin,
313 SINGLE_VALUE_TYPE(switches::kPrintRaster)
314 },
315#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05316 {
[email protected]bb461532010-11-26 21:50:23317 "crxless-web-apps",
318 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
319 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56320 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19321 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23322 },
323 {
[email protected]96c6f4c2011-05-18 19:36:22324 "ignore-gpu-blacklist",
325 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
326 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
327 kOsAll,
328 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
329 },
330 {
[email protected]0110cf112011-07-02 00:39:43331 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22332 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
333 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23334 kOsMac | kOsWin | kOsLinux,
335 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22336 },
337 {
[email protected]72787e392012-03-23 05:55:43338 "threaded-compositing-mode",
339 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
340 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56341 kOsDesktop & ~kOsCrOS,
[email protected]72787e392012-03-23 05:55:43342 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59343 },
344 {
[email protected]8b1c3c72013-01-25 01:48:43345 "present-with-GDI",
346 IDS_FLAGS_PRESENT_WITH_GDI_NAME,
347 IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION,
348 kOsWin,
349 MULTI_VALUE_TYPE(kGDIPresentChoices)
350 },
351 {
[email protected]81c64af62012-06-06 20:15:52352 "disable-accelerated-2d-canvas",
353 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
354 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
355 kOsAll,
356 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
357 },
358 {
[email protected]69cffc82012-08-10 13:27:27359 "disable-deferred-2d-canvas",
360 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
361 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
362 kOsAll,
363 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
364 },
365 {
[email protected]efcde132012-05-30 01:05:18366 "disable-threaded-animation",
367 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
368 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59369 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37370 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59371 },
372 {
[email protected]5963b772011-02-09 22:55:38373 "composited-layer-borders",
374 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
375 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
376 kOsAll,
377 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
378 },
379 {
[email protected]a8f1eaa2011-03-07 19:00:58380 "show-fps-counter",
381 IDS_FLAGS_SHOW_FPS_COUNTER,
382 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
383 kOsAll,
384 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
385 },
[email protected]8ff7f342011-05-25 01:49:47386 {
[email protected]70c98a332011-12-21 20:51:52387 "accelerated-filters",
388 IDS_FLAGS_ACCELERATED_FILTERS,
389 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
390 kOsAll,
391 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
392 },
393 {
[email protected]8ff7f342011-05-25 01:49:47394 "disable-gpu-vsync",
395 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
396 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56397 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47398 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
399 },
[email protected]deaba6d52011-09-23 14:47:12400 {
[email protected]4052d832013-01-16 05:31:01401 "enable-webgl",
402 IDS_FLAGS_ENABLE_WEBGL_NAME,
403 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
404 kOsAndroid,
405#if defined(OS_ANDROID)
406 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
407#else
408 SINGLE_VALUE_TYPE("")
409#endif
410 },
411 {
[email protected]deaba6d52011-09-23 14:47:12412 "disable-webgl",
413 IDS_FLAGS_DISABLE_WEBGL_NAME,
414 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56415 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01416#if defined(OS_ANDROID)
417 SINGLE_VALUE_TYPE("")
418#else
[email protected]deaba6d52011-09-23 14:47:12419 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01420#endif
[email protected]deaba6d52011-09-23 14:47:12421 },
[email protected]09096e02012-05-24 11:12:04422 {
[email protected]96bcdc102012-05-24 23:42:10423 "fixed-position-creates-stacking-context",
424 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
425 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
426 kOsAll,
[email protected]de023762012-07-26 17:10:17427 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10428 },
[email protected]a7640ef22012-10-06 00:52:08429 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53430 {
[email protected]e3791ce92011-08-09 01:03:32431 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40432 IDS_FLAGS_ENABLE_NACL_NAME,
433 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56434 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19435 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40436 },
[email protected]b39c6d92012-01-31 16:38:41437 // TODO(halyavin): When exception handling is on by default, replace this
438 // flag with disable-nacl-exception-handling.
439 {
440 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
441 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
442 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56443 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41444 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
445 },
[email protected]4ff87d202010-11-06 01:28:40446 {
[email protected]9addd1c2012-09-15 14:28:24447 "enable-nacl-debug", // FLAGS:RECORD_UMA
448 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
449 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56450 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24451 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13452 },
453 {
[email protected]66f409c2012-10-04 20:59:04454 "nacl-debug-mask", // FLAGS:RECORD_UMA
455 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
456 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56457 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04458 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
459 },
460 {
[email protected]7babd1c2012-08-08 20:35:29461 "enable-pnacl", // FLAGS:RECORD_UMA
462 IDS_FLAGS_ENABLE_PNACL_NAME,
463 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56464 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29465 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
466 },
467 {
[email protected]4bc5050c2010-11-18 17:55:54468 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32469 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
470 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56471 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19472 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32473 },
[email protected]3627b06d2010-11-12 16:36:16474 {
[email protected]544471a2012-10-13 05:27:09475 "action-box",
[email protected]cab18ef2012-04-27 07:22:03476 IDS_FLAGS_ACTION_BOX_NAME,
477 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56478 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09479 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03480 },
481 {
[email protected]3a362432012-06-18 20:39:51482 "script-badges",
483 IDS_FLAGS_SCRIPT_BADGES_NAME,
484 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56485 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09486 SINGLE_VALUE_TYPE(switches::kScriptBadges)
487 },
488 {
489 "script-bubble",
490 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
491 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56492 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09493 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51494 },
495 {
[email protected]cbe224d2011-08-04 22:12:49496 "apps-new-install-bubble",
497 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
498 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56499 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49500 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
501 },
502 {
[email protected]80bd24e2010-11-30 09:34:38503 "disable-hyperlink-auditing",
504 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
505 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
506 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19507 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51508 },
509 {
510 "experimental-location-features", // FLAGS:RECORD_UMA
511 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
512 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
513 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19514 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
515 },
516 {
[email protected]5aea1862011-03-23 23:55:39517 "tab-groups-context-menu",
518 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
519 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
520 kOsWin,
521 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
522 },
[email protected]c94cebd2012-06-21 00:55:28523 {
524 "enable-instant-extended-api",
525 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
526 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56527 kOsDesktop,
[email protected]c94cebd2012-06-21 00:55:28528 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
529 },
[email protected]e9bf9d92011-03-31 20:57:15530 {
[email protected]354e33b2011-06-15 00:29:10531 "static-ip-config",
532 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
533 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
534 kOsCrOS,
535#if defined(OS_CHROMEOS)
536 // This switch exists only on Chrome OS.
537 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
538#else
539 SINGLE_VALUE_TYPE("")
540#endif
541 },
[email protected]3eb5728c2011-06-20 22:32:24542 {
543 "show-autofill-type-predictions",
544 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
545 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
546 kOsAll,
547 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
548 },
[email protected]bff4d3e2011-06-21 23:58:52549 {
[email protected]fdf4e252012-04-27 00:26:55550 "sync-tab-favicons",
551 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
552 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
553 kOsAll,
554 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
555 },
556 {
[email protected]aae9eeb12011-10-21 21:59:26557 "sync-app-notifications",
558 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
559 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56560 kOsDesktop,
[email protected]0b6fba82011-11-18 01:31:11561 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26562 },
563 {
[email protected]5d90a0a2012-11-15 02:43:40564 "sync-keystore-encryption",
565 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
566 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
567 kOsAll,
568 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
569 },
570 {
[email protected]e755a382012-09-13 17:16:35571 "enable-gesture-tap-highlight",
572 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
573 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
574 kOsLinux | kOsCrOS,
575 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
576 },
577 {
[email protected]a22ebd812011-06-23 00:05:39578 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
579 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
580 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
581 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40582 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25583 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39584 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
585 },
[email protected]81a6b0b2011-06-24 17:55:40586 {
[email protected]68317802012-06-07 19:13:23587 "omnibox-history-quick-provider-new-scoring",
588 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
589 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
590 kOsAll,
591 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
592 },
593 {
[email protected]128dc6c2012-06-22 20:30:35594 "omnibox-history-quick-provider-reorder-for-inlining",
595 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
596 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
597 kOsAll,
598 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
599 },
600 {
[email protected]032d5e6c2012-02-17 17:53:55601 "omnibox-inline-history-quick-provider",
602 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
603 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
604 kOsAll,
605 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
606 },
607 {
[email protected]7e7a28092011-12-09 22:24:55608 "enable-panels",
609 IDS_FLAGS_ENABLE_PANELS_NAME,
610 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56611 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55612 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54613 },
[email protected]e3749d12011-07-25 22:22:12614 {
[email protected]fd38cc82012-12-19 18:19:29615 "enable-panel-stacking",
616 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
617 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56618 kOsDesktop,
[email protected]fd38cc82012-12-19 18:19:29619 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
620 },
621 {
[email protected]27c14f02012-06-22 17:29:58622 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27623 "save-page-as-mhtml", // FLAGS:RECORD_UMA
624 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
625 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
626 kOsMac | kOsWin | kOsLinux,
627 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
628 },
629 {
[email protected]b7bb44f2011-09-01 05:17:03630 "enable-autologin",
631 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
632 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
633 kOsMac | kOsWin | kOsLinux,
634 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
635 },
[email protected]b9841172011-09-26 23:36:09636 {
[email protected]bbadb112011-12-12 16:55:28637 "enable-http-pipelining",
638 IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME,
639 IDS_FLAGS_ENABLE_HTTP_PIPELINING_DESCRIPTION,
640 kOsAll,
641 SINGLE_VALUE_TYPE(switches::kEnableHttpPipelining)
642 },
[email protected]d411c01d2011-10-18 16:00:27643 {
[email protected]3231b612012-03-23 05:57:54644 "enable-spdy3",
645 IDS_FLAGS_ENABLE_SPDY3_NAME,
646 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
647 kOsAll,
648 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
649 },
650 {
[email protected]27b3fe92012-03-21 05:35:06651 "enable-async-dns",
652 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
653 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46654 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40655 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06656 },
657 {
[email protected]1eb93802012-09-11 18:57:56658 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11659 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
660 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32661 kOsAll,
[email protected]da43c082012-09-07 18:56:11662 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44663 },
[email protected]e4e68dbb2011-11-18 01:50:22664 {
[email protected]9f5b7822012-04-18 23:39:03665 "enable-encrypted-media",
666 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
667 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56668 kOsDesktop,
[email protected]9f5b7822012-04-18 23:39:03669 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
670 },
[email protected]f88628792012-12-18 07:07:50671 {
672 "enable-opus-playback",
673 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
674 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56675 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50676 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
677 },
[email protected]ca6eaa5a2013-01-24 16:16:04678 {
679 "enable-managed-users",
680 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
681 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
682 kOsAll,
683 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
684 },
[email protected]dc04be7c2012-03-15 23:57:49685#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50686 {
[email protected]cda278d2012-10-30 20:31:40687 "ash-disable-auto-window-placement",
688 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
689 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
690 kOsWin | kOsLinux | kOsCrOS,
691 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
692 },
[email protected]b4e4ec42012-11-29 21:42:40693 {
694 "ash-enable-per-app-launcher",
695 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_NAME,
696 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_DESCRIPTION,
697 kOsWin | kOsLinux | kOsCrOS,
698 SINGLE_VALUE_TYPE(ash::switches::kAshEnablePerAppLauncher)
699 },
[email protected]dc04be7c2012-03-15 23:57:49700#endif
[email protected]eaae8b462012-01-20 22:20:39701 {
[email protected]db543d322011-12-15 20:40:15702 "per-tile-painting",
703 IDS_FLAGS_PER_TILE_PAINTING_NAME,
704 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
705#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37706 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15707#else
708 0,
709#endif
[email protected]65bfd9972012-10-19 03:39:37710 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15711 },
[email protected]bf88c032011-12-22 19:05:47712 {
713 "enable-javascript-harmony",
714 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
715 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
716 kOsAll,
717 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
718 },
[email protected]7e7f378a2012-01-05 14:35:37719 {
[email protected]85646172012-01-09 22:45:54720 "enable-tab-browser-dragging",
721 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
722 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
723 kOsWin,
724 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
725 },
726 {
[email protected]068b7b52012-02-27 12:41:44727 "disable-restore-session-state",
728 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
729 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37730 kOsAll,
[email protected]068b7b52012-02-27 12:41:44731 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37732 },
[email protected]88864db2012-01-18 20:56:35733 {
734 "disable-software-rasterizer",
735 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
736 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
737#if defined(ENABLE_SWIFTSHADER)
738 kOsAll,
739#else
740 0,
741#endif
742 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
743 },
[email protected]15a5d722012-01-23 09:11:14744 {
[email protected]ff7b6dd2012-09-15 20:20:03745 "enable-experimental-webkit-features",
746 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
747 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16748 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03749 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49750 },
751 {
[email protected]0f95a252012-09-13 22:30:04752 "enable-css-shaders",
753 IDS_FLAGS_CSS_SHADERS_NAME,
754 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
755 kOsAll,
756 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
757 },
758 {
[email protected]9860c68b2012-02-02 01:58:09759 "enable-extension-activity-ui",
760 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
761 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56762 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09763 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00764 },
[email protected]54ae4e92012-02-16 15:19:05765 {
[email protected]3e8befc2012-03-13 01:17:03766 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16767 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
768 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56769 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03770 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16771 },
[email protected]dc04be7c2012-03-15 23:57:49772#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01773 {
[email protected]3cd198a22012-03-12 20:38:01774 "enable-ash-oak",
775 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
776 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
777 kOsAll,
778 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
779 },
[email protected]31cf1c52012-02-29 20:55:01780#endif
[email protected]184ec592012-03-01 11:54:28781 {
782 "enable-devtools-experiments",
783 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
784 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56785 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28786 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
787 },
[email protected]76d1854e2012-03-02 23:57:44788 {
789 "enable-suggestions-ntp",
790 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
791 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56792 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44793 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
794 },
[email protected]a3d54252012-04-05 20:04:13795 {
[email protected]1dbaf5e2012-11-30 05:51:32796 "spellcheck-autocorrect",
797 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
798 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
799 kOsWin | kOsLinux | kOsCrOS,
800 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
801 },
802 {
[email protected]d7932532012-11-21 21:10:31803 "touch-events",
804 IDS_TOUCH_EVENTS_NAME,
805 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56806 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31807 MULTI_VALUE_TYPE(kTouchEventsChoices)
808 },
809 {
[email protected]c9c73ad42012-04-18 03:35:59810 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06811 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
812 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55813 kOsWin,
[email protected]347a0c72012-05-14 20:28:06814 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59815 },
[email protected]8a6aaa72012-04-20 20:53:58816 {
[email protected]f6f82832012-09-04 17:12:04817 "enable-webkit-text-subpixel-positioning",
818 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
819 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
820 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48821 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04822 },
823 {
[email protected]b9c96ff2012-11-26 22:24:40824 "disable-touch-adjustment",
825 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
826 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
827 kOsWin | kOsLinux | kOsCrOS,
828 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
829 },
830 {
[email protected]0b9383a2012-10-26 00:58:16831 "enable-tab-capture",
832 IDS_ENABLE_TAB_CAPTURE_NAME,
833 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25834 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16835 MULTI_VALUE_TYPE(kTabCaptureChoices)
836 },
[email protected]0b60afa2012-04-19 17:36:39837#if defined(OS_CHROMEOS)
838 {
[email protected]7c4a9bc2012-09-11 22:10:05839 "enable-background-loader",
840 IDS_ENABLE_BACKLOADER_NAME,
841 IDS_ENABLE_BACKLOADER_DESCRIPTION,
842 kOsCrOS,
843 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
844 },
845 {
[email protected]c5667b282012-08-31 00:32:50846 "enable-bezel-touch",
847 IDS_ENABLE_BEZEL_TOUCH_NAME,
848 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47849 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50850 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47851 },
852 {
[email protected]0b60afa2012-04-19 17:36:39853 "no-discard-tabs",
854 IDS_FLAGS_NO_DISCARD_TABS_NAME,
855 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
856 kOsCrOS,
857 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
858 },
859#endif
[email protected]79be6d32012-04-24 20:47:44860 {
[email protected]8d68a3e02013-01-12 15:57:10861 "enable-download-resumption",
862 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
863 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56864 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10865 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
866 },
867 {
[email protected]9a5940d2012-04-27 19:16:23868 "allow-nacl-socket-api",
869 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
870 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56871 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23872 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
873 },
[email protected]85333732012-05-01 19:02:24874 {
[email protected]60673ad72012-05-02 06:16:33875 "stacked-tab-strip",
876 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
877 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
878 kOsWin,
879 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
880 },
881 {
[email protected]4bd20202012-06-14 17:35:01882 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24883 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
884 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
885 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01886 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24887 },
[email protected]190349fd2012-05-02 00:10:47888#if defined(OS_CHROMEOS)
889 {
890 "allow-touchpad-three-finger-click",
891 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
892 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
893 kOsCrOS,
894 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
895 },
[email protected]fbc176b62012-10-27 02:19:58896 {
897 "allow-touchpad-three-finger-swipe",
898 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
899 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
900 kOsCrOS,
901 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
902 },
[email protected]190349fd2012-05-02 00:10:47903#endif
[email protected]1992a2f42012-10-23 18:32:21904 {
[email protected]3420d9a2012-12-13 02:30:01905 "use-web-based-signin-flow",
906 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_NAME,
907 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21908 kOsMac | kOsWin | kOsLinux,
[email protected]3420d9a2012-12-13 02:30:01909 SINGLE_VALUE_TYPE(switches::kUseWebBasedSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21910 },
[email protected]8ee02242012-12-04 15:23:32911 {
912 "enable-desktop-guest-mode",
913 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
914 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
915 kOsMac | kOsWin | kOsLinux,
916 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
917 },
[email protected]53520b1b2012-05-07 21:43:37918#if defined(USE_ASH)
919 {
[email protected]55444502012-05-10 15:43:53920 "show-launcher-alignment-menu",
921 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
922 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
923 kOsAll,
924 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
925 },
[email protected]817ecd12012-05-16 18:36:53926 {
[email protected]73074742012-05-17 01:44:41927 "show-touch-hud",
928 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
929 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
930 kOsAll,
931 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
932 },
933 {
[email protected]9f0940b62012-05-23 22:56:35934 "enable-pinch",
935 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
936 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06937 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35938 SINGLE_VALUE_TYPE(switches::kEnablePinch),
939 },
[email protected]a8379312012-06-15 00:20:43940 {
941 "app-list-show-apps-only",
942 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
943 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
944 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03945 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43946 },
[email protected]73074742012-05-17 01:44:41947#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28948#if defined(OS_CHROMEOS)
949 {
[email protected]f9634692013-01-15 06:16:10950 "force-oauth1",
951 IDS_FLAGS_FORCE_OAUTH1_DISPLAY_NAME,
952 IDS_FLAGS_FORCE_OAUTH1_DISPLAY_DESCRIPTION,
953 kOsCrOS,
954 SINGLE_VALUE_TYPE(::switches::kForceOAuth1),
955 },
956 {
[email protected]e03dc78d2012-07-24 08:21:43957 "disable-new-oobe",
958 IDS_FLAGS_DISABLE_NEW_OOBE,
959 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:28960 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:43961 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:28962 },
[email protected]8b04a1652012-08-04 02:59:49963 {
[email protected]528ced32012-12-14 00:40:44964 "disable-new-password-changed-dialog",
965 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
966 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
967 kOsCrOS,
968 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
969 },
970 {
[email protected]8b04a1652012-08-04 02:59:49971 "disable-boot-animation",
972 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
973 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
974 kOsCrOS,
975 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
976 },
[email protected]95058572012-08-20 14:57:29977 {
[email protected]b4557192012-09-19 11:29:58978 "disable-boot-animation2",
979 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
980 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
981 kOsCrOS,
982 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
983 },
984 {
[email protected]ea2f3342012-09-21 21:13:36985 "boot-animation-fucntion",
986 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
987 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
988 kOsCrOS,
989 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
990 },
[email protected]839667d62012-10-23 19:38:57991 {
[email protected]d96aef22012-10-30 11:47:02992 "captive-portal-detector",
993 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
994 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
995 kOsCrOS,
996 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
997 },
998 {
[email protected]c11aa8f12012-12-18 18:43:14999 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:571000 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
1001 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
1002 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:141003 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:571004 },
[email protected]f0280952012-11-06 20:30:501005 {
[email protected]0fb5c4852012-11-08 20:33:231006 "file-manager-packaged",
1007 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
1008 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
1009 kOsCrOS,
1010 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
1011 },
[email protected]3e035e82012-11-27 20:54:321012 {
[email protected]8039e06c2013-01-17 23:34:501013 "disable-launcher-per-display",
1014 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
1015 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:351016 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501017 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351018 },
1019#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391020 {
1021 "enable-views-textfield",
1022 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
1023 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
1024 kOsWin,
1025 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
1026 },
[email protected]bd0cd3bb2012-06-14 03:03:381027 {
[email protected]ef41b7ee2012-07-24 19:10:411028 "old-checkbox-style",
1029 IDS_FLAGS_OLD_CHECKBOX_STYLE,
1030 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
1031 kOsLinux | kOsCrOS,
1032 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
1033 },
1034 {
[email protected]2d4817742012-12-17 20:16:181035 "enable-new-dialog-style",
1036 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1037 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321038 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181039 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321040 },
[email protected]7db8893a2012-07-26 00:49:401041 { "disable-accelerated-video-decode",
1042 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1043 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561044 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401045 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151046 },
[email protected]66ae9fc2012-06-19 21:33:521047#if defined(USE_ASH)
1048 {
1049 "ash-debug-shortcuts",
1050 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1051 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1052 kOsAll,
1053 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1054 },
1055#endif
[email protected]37fee0942012-08-07 21:07:451056 {
[email protected]e2e8e322012-09-12 04:37:021057 "enable-webaudio-input",
1058 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1059 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561060 kOsDesktop,
[email protected]e2e8e322012-09-12 04:37:021061 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1062 },
1063 {
[email protected]ad3f6d22012-08-29 02:34:191064 "enable-contacts",
1065 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1066 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1067 kOsCrOS,
1068 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1069 },
[email protected]1d9bb9cd2012-08-28 22:02:501070#if defined(USE_ASH)
1071 { "ash-enable-advanced-gestures",
1072 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1073 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1074 kOsCrOS,
1075 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1076 },
[email protected]51075f8c2012-11-13 01:48:161077 { "ash-enable-tab-scrubbing",
1078 IDS_FLAGS_ENABLE_TAB_SCRUBBING_NAME,
1079 IDS_FLAGS_ENABLE_TAB_SCRUBBING_DESCRIPTION,
1080 kOsCrOS,
1081 SINGLE_VALUE_TYPE(switches::kAshEnableTabScrubbing),
1082 },
[email protected]83eef802012-12-02 07:43:521083 { "ash-enable-workspace-scrubbing",
1084 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1085 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1086 kOsCrOS,
1087 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1088 },
[email protected]d153e6f2012-12-21 07:38:091089 { "ash-immersive-mode",
1090 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1091 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241092 kOsCrOS,
[email protected]d153e6f2012-12-21 07:38:091093 MULTI_VALUE_TYPE(kAshImmersiveModeChoices),
[email protected]c043df272012-11-21 00:43:241094 },
[email protected]316708a2012-11-05 22:57:021095#if defined(OS_LINUX)
1096 { "ash-enable-memory-monitor",
1097 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1098 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1099 kOsCrOS,
1100 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1101 },
1102#endif
[email protected]1d9bb9cd2012-08-28 22:02:501103#endif
[email protected]9b7ab882012-09-10 23:46:361104#if defined(OS_CHROMEOS)
[email protected]badba1ad2012-11-16 17:21:461105 { "enable-new-network-handlers",
1106 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_NAME,
1107 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_DESCRIPTION,
1108 kOsCrOS,
1109 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewNetworkHandlers),
1110 },
[email protected]9b7ab882012-09-10 23:46:361111 {
[email protected]205f07892012-10-16 20:26:221112 "enable-carrier-switching",
1113 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1114 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1115 kOsCrOS,
1116 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1117 },
1118 {
[email protected]9b7ab882012-09-10 23:46:361119 "enable-request-tablet-site",
1120 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1121 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1122 kOsCrOS,
1123 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1124 },
1125#endif
[email protected]dab49c0b2012-10-04 05:55:351126 {
1127 "debug-packed-apps",
1128 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1129 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561130 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351131 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1132 },
[email protected]d1459ed2012-10-10 01:29:331133 {
1134 "enable-password-generation",
1135 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1136 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561137 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331138 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1139 },
[email protected]26d045f2012-10-18 21:18:431140 {
1141 "crash-on-gpu-hang",
1142 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1143 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1144 kOsAll,
1145 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1146 },
[email protected]075543d2012-10-24 01:29:141147 {
[email protected]76f7d4882012-10-26 21:09:221148 "enable-deferred-image-decoding",
1149 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1150 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1151#if defined(USE_SKIA)
1152 kOsMac | kOsLinux | kOsCrOS,
1153#else
1154 0,
1155#endif
1156 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1157 },
1158 {
[email protected]075543d2012-10-24 01:29:141159 "performance-monitor-gathering",
1160 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1161 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1162 kOsAll,
1163 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1164 },
[email protected]783d5bb2012-10-24 03:47:141165 {
[email protected]0572fb2e2012-11-03 00:38:591166 "enable-new-autofill-ui",
1167 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1168 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561169 kOsDesktop,
[email protected]0572fb2e2012-11-03 00:38:591170 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1171 },
1172 {
[email protected]783d5bb2012-10-24 03:47:141173 "enable-new-autofill-heuristics",
1174 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1175 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1176 kOsAll,
1177 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1178 },
[email protected]2c273bd2012-10-25 18:55:031179 {
[email protected]99002fd2012-11-06 04:35:521180 "show-app-list-shortcut",
1181 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1182 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1183 kOsWin,
1184 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1185 },
[email protected]a7259fb2012-11-08 06:22:231186 {
1187 "enable-experimental-form-filling",
1188 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1189 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1190 kOsWin | kOsCrOS,
1191 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1192 },
[email protected]aa75e4ed2012-11-08 23:51:511193 {
1194 "enable-interactive-autocomplete",
1195 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1196 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1197 kOsWin | kOsCrOS,
1198 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1199 },
[email protected]e42b1f82012-11-16 21:18:461200#if defined(USE_AURA)
1201 {
[email protected]6c83c382013-01-24 20:46:011202 "disable-overscroll-history-navigation",
1203 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1204 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461205 kOsAll,
[email protected]6c83c382013-01-24 20:46:011206 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461207 },
1208#endif
[email protected]edbea622012-11-28 20:39:381209 {
1210 "enable-touch-drag-drop",
1211 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1212 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1213 kOsWin | kOsCrOS,
1214 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1215 },
[email protected]3a6446f12012-12-08 16:55:291216 {
1217 "load-cloud-policy-on-signin",
1218 IDS_FLAGS_DESKTOP_CLOUD_POLICY_NAME,
1219 IDS_FLAGS_DESKTOP_CLOUD_POLICY_DESCRIPTION,
1220 kOsWin | kOsMac | kOsLinux,
1221 SINGLE_VALUE_TYPE(switches::kLoadCloudPolicyOnSignin)
[email protected]92e12dd92012-12-11 03:33:201222 },
1223 {
1224 "enable-rich-notifications",
1225 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1226 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1227 kOsWin | kOsCrOS,
1228 SINGLE_VALUE_TYPE(switches::kEnableRichNotifications)
1229 },
[email protected]4d51c682012-12-11 11:34:551230 {
1231 "full-history-sync",
1232 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1233 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1234 kOsAll,
1235 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1236 },
[email protected]628a69a92012-12-23 04:09:341237 {
1238 "enable-data-channels",
1239 IDS_FLAGS_RTC_DATACHANNELS,
1240 IDS_FLAGS_RTC_DATACHANNELS_DESCRIPTION,
1241 kOsAll,
1242 SINGLE_VALUE_TYPE(switches::kEnableDataChannels)
1243 },
[email protected]4a831542013-01-18 00:21:091244 {
1245 "enable-sync-dictionary",
1246 IDS_FLAGS_ENABLE_SYNC_DICTIONARY_NAME,
1247 IDS_FLAGS_ENABLE_SYNC_DICTIONARY_DESCRIPTION,
1248 kOsWin | kOsCrOS | kOsLinux,
1249 SINGLE_VALUE_TYPE(switches::kEnableSyncDictionary)
1250 },
[email protected]a0e4b072011-08-17 01:47:071251};
[email protected]ad2a3ded2010-08-27 13:19:051252
[email protected]a314ee5a2010-10-26 21:23:281253const Experiment* experiments = kExperiments;
1254size_t num_experiments = arraysize(kExperiments);
1255
[email protected]e2ddbc92010-10-15 20:02:071256// Stores and encapsulates the little state that about:flags has.
1257class FlagsState {
1258 public:
1259 FlagsState() : needs_restart_(false) {}
1260 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1261 bool IsRestartNeededToCommitChanges();
1262 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281263 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071264 void RemoveFlagsSwitches(
1265 std::map<std::string, CommandLine::StringType>* switch_list);
1266 void reset();
1267
1268 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551269 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071270 return Singleton<FlagsState>::get();
1271 }
1272
1273 private:
1274 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531275 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071276
1277 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1278};
1279
[email protected]c7b7800a2010-10-07 18:51:351280// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051281// in a set.
[email protected]1a47d7e2010-10-15 00:37:241282void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051283 const ListValue* enabled_experiments = prefs->GetList(
1284 prefs::kEnabledLabsExperiments);
1285 if (!enabled_experiments)
1286 return;
1287
1288 for (ListValue::const_iterator it = enabled_experiments->begin();
1289 it != enabled_experiments->end();
1290 ++it) {
1291 std::string experiment_name;
1292 if (!(*it)->GetAsString(&experiment_name)) {
1293 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1294 continue;
1295 }
1296 result->insert(experiment_name);
1297 }
1298}
1299
1300// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241301void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051302 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381303 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1304 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051305
1306 experiments_list->Clear();
1307 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1308 it != enabled_experiments.end();
1309 ++it) {
1310 experiments_list->Append(new StringValue(*it));
1311 }
1312}
1313
[email protected]8a6ff28d2010-12-02 16:35:191314// Returns the name used in prefs for the choice at the specified index.
1315std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341316 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1317 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191318 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1319 base::IntToString(index);
1320}
1321
1322// Adds the internal names for the specified experiment to |names|.
1323void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1324 if (e.type == Experiment::SINGLE_VALUE) {
1325 names->insert(e.internal_name);
1326 } else {
[email protected]2ce9c89752011-02-25 18:24:341327 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191328 for (int i = 0; i < e.num_choices; ++i)
1329 names->insert(NameForChoice(e, i));
1330 }
1331}
1332
[email protected]28e35af2011-02-09 12:56:221333// Confirms that an experiment is valid, used in a DCHECK in
1334// SanitizeList below.
1335bool ValidateExperiment(const Experiment& e) {
1336 switch (e.type) {
1337 case Experiment::SINGLE_VALUE:
1338 DCHECK_EQ(0, e.num_choices);
1339 DCHECK(!e.choices);
1340 break;
1341 case Experiment::MULTI_VALUE:
1342 DCHECK_GT(e.num_choices, 0);
1343 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531344 DCHECK(e.choices[0].command_line_switch);
1345 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221346 break;
1347 default:
1348 NOTREACHED();
1349 }
1350 return true;
1351}
1352
[email protected]ad2a3ded2010-08-27 13:19:051353// Removes all experiments from prefs::kEnabledLabsExperiments that are
1354// unknown, to prevent this list to become very long as experiments are added
1355// and removed.
1356void SanitizeList(PrefService* prefs) {
1357 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221358 for (size_t i = 0; i < num_experiments; ++i) {
1359 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191360 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221361 }
[email protected]ad2a3ded2010-08-27 13:19:051362
1363 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241364 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051365
1366 std::set<std::string> new_enabled_experiments;
1367 std::set_intersection(
1368 known_experiments.begin(), known_experiments.end(),
1369 enabled_experiments.begin(), enabled_experiments.end(),
1370 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1371
[email protected]4c8853f2012-07-23 01:29:161372 if (new_enabled_experiments != enabled_experiments)
1373 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051374}
1375
[email protected]1a47d7e2010-10-15 00:37:241376void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051377 PrefService* prefs, std::set<std::string>* result) {
1378 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241379 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051380}
1381
[email protected]a314ee5a2010-10-26 21:23:281382// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1383// enabled on the current platform.
1384void GetSanitizedEnabledFlagsForCurrentPlatform(
1385 PrefService* prefs, std::set<std::string>* result) {
1386 GetSanitizedEnabledFlags(prefs, result);
1387
1388 // Filter out any experiments that aren't enabled on the current platform. We
1389 // don't remove these from prefs else syncing to a platform with a different
1390 // set of experiments would be lossy.
1391 std::set<std::string> platform_experiments;
1392 int current_platform = GetCurrentPlatform();
1393 for (size_t i = 0; i < num_experiments; ++i) {
1394 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191395 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281396 }
1397
1398 std::set<std::string> new_enabled_experiments;
1399 std::set_intersection(
1400 platform_experiments.begin(), platform_experiments.end(),
1401 result->begin(), result->end(),
1402 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1403
1404 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051405}
1406
[email protected]8a6ff28d2010-12-02 16:35:191407// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191408Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221409 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341410 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191411 ListValue* result = new ListValue;
1412 for (int i = 0; i < experiment.num_choices; ++i) {
1413 const Experiment::Choice& choice = experiment.choices[i];
1414 DictionaryValue* value = new DictionaryValue;
1415 std::string name = NameForChoice(experiment, i);
1416 value->SetString("description",
1417 l10n_util::GetStringUTF16(choice.description_id));
1418 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221419 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191420 result->Append(value);
1421 }
1422 return result;
1423}
1424
[email protected]e2ddbc92010-10-15 20:02:071425} // namespace
1426
[email protected]1a47d7e2010-10-15 00:37:241427void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551428 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051429}
1430
[email protected]1a47d7e2010-10-15 00:37:241431ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051432 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241433 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051434
1435 int current_platform = GetCurrentPlatform();
1436
1437 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281438 for (size_t i = 0; i < num_experiments; ++i) {
1439 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051440
1441 DictionaryValue* data = new DictionaryValue();
1442 data->SetString("internal_name", experiment.internal_name);
1443 data->SetString("name",
1444 l10n_util::GetStringUTF16(experiment.visible_name_id));
1445 data->SetString("description",
1446 l10n_util::GetStringUTF16(
1447 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401448 bool supported = !!(experiment.supported_platforms & current_platform);
1449 data->SetBoolean("supported", supported);
1450
1451 ListValue* supported_platforms = new ListValue();
1452 AddOsStrings(experiment.supported_platforms, supported_platforms);
1453 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051454
[email protected]28e35af2011-02-09 12:56:221455 switch (experiment.type) {
1456 case Experiment::SINGLE_VALUE:
1457 data->SetBoolean(
1458 "enabled",
1459 enabled_experiments.count(experiment.internal_name) > 0);
1460 break;
1461 case Experiment::MULTI_VALUE:
1462 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1463 break;
1464 default:
1465 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191466 }
1467
[email protected]ad2a3ded2010-08-27 13:19:051468 experiments_data->Append(data);
1469 }
1470 return experiments_data;
1471}
1472
[email protected]ad2a3ded2010-08-27 13:19:051473bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551474 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051475}
1476
1477void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351478 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551479 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071480}
1481
1482void RemoveFlagsSwitches(
1483 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551484 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071485}
1486
[email protected]a314ee5a2010-10-26 21:23:281487int GetCurrentPlatform() {
1488#if defined(OS_MACOSX)
1489 return kOsMac;
1490#elif defined(OS_WIN)
1491 return kOsWin;
1492#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1493 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211494#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281495 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401496#elif defined(OS_ANDROID)
1497 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281498#else
1499#error Unknown platform
1500#endif
1501}
1502
[email protected]4bc5050c2010-11-18 17:55:541503void RecordUMAStatistics(const PrefService* prefs) {
1504 std::set<std::string> flags;
1505 GetEnabledFlags(prefs, &flags);
1506 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1507 ++it) {
1508 std::string action("AboutFlags_");
1509 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381510 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541511 }
1512 // Since flag metrics are recorded every startup, add a tick so that the
1513 // stats can be made meaningful.
1514 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381515 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1516 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541517}
1518
[email protected]e2ddbc92010-10-15 20:02:071519//////////////////////////////////////////////////////////////////////////////
1520// FlagsState implementation.
1521
1522namespace {
1523
1524void FlagsState::ConvertFlagsToSwitches(
1525 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071526 if (command_line->HasSwitch(switches::kNoExperiments))
1527 return;
1528
1529 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001530
[email protected]a314ee5a2010-10-26 21:23:281531 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071532
[email protected]a82744532011-02-11 16:15:531533 typedef std::map<std::string, std::pair<std::string, std::string> >
1534 NameToSwitchAndValueMap;
1535 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191536 for (size_t i = 0; i < num_experiments; ++i) {
1537 const Experiment& e = experiments[i];
1538 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531539 name_to_switch_map[e.internal_name] =
1540 std::pair<std::string, std::string>(e.command_line_switch,
1541 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191542 } else {
1543 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531544 name_to_switch_map[NameForChoice(e, j)] =
1545 std::pair<std::string, std::string>(
1546 e.choices[j].command_line_switch,
1547 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191548 }
1549 }
[email protected]e2ddbc92010-10-15 20:02:071550
1551 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531552 flags_switches_.insert(
1553 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1554 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071555 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1556 it != enabled_experiments.end();
1557 ++it) {
1558 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531559 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191560 name_to_switch_map.find(experiment_name);
1561 if (name_to_switch_it == name_to_switch_map.end()) {
1562 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071563 continue;
[email protected]8a6ff28d2010-12-02 16:35:191564 }
[email protected]e2ddbc92010-10-15 20:02:071565
[email protected]a82744532011-02-11 16:15:531566 const std::pair<std::string, std::string>&
1567 switch_and_value_pair = name_to_switch_it->second;
1568
1569 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1570 switch_and_value_pair.second);
1571 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071572 }
1573 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531574 flags_switches_.insert(
1575 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1576 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071577}
1578
1579bool FlagsState::IsRestartNeededToCommitChanges() {
1580 return needs_restart_;
1581}
1582
1583void FlagsState::SetExperimentEnabled(
1584 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051585 needs_restart_ = true;
1586
[email protected]8a6ff28d2010-12-02 16:35:191587 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1588 if (at_index != std::string::npos) {
1589 DCHECK(enable);
1590 // We're being asked to enable a multi-choice experiment. Disable the
1591 // currently selected choice.
1592 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221593 const std::string experiment_name = internal_name.substr(0, at_index);
1594 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191595
[email protected]28e35af2011-02-09 12:56:221596 // And enable the new choice, if it is not the default first choice.
1597 if (internal_name != experiment_name + "@0") {
1598 std::set<std::string> enabled_experiments;
1599 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1600 enabled_experiments.insert(internal_name);
1601 SetEnabledFlags(prefs, enabled_experiments);
1602 }
[email protected]8a6ff28d2010-12-02 16:35:191603 return;
1604 }
1605
[email protected]ad2a3ded2010-08-27 13:19:051606 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241607 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051608
[email protected]8a6ff28d2010-12-02 16:35:191609 const Experiment* e = NULL;
1610 for (size_t i = 0; i < num_experiments; ++i) {
1611 if (experiments[i].internal_name == internal_name) {
1612 e = experiments + i;
1613 break;
1614 }
1615 }
1616 DCHECK(e);
1617
1618 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591619 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191620 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591621 else
[email protected]8a6ff28d2010-12-02 16:35:191622 enabled_experiments.erase(internal_name);
1623 } else {
1624 if (enable) {
1625 // Enable the first choice.
1626 enabled_experiments.insert(NameForChoice(*e, 0));
1627 } else {
1628 // Find the currently enabled choice and disable it.
1629 for (int i = 0; i < e->num_choices; ++i) {
1630 std::string choice_name = NameForChoice(*e, i);
1631 if (enabled_experiments.find(choice_name) !=
1632 enabled_experiments.end()) {
1633 enabled_experiments.erase(choice_name);
1634 // Continue on just in case there's a bug and more than one
1635 // experiment for this choice was enabled.
1636 }
1637 }
1638 }
1639 }
[email protected]ad2a3ded2010-08-27 13:19:051640
[email protected]1a47d7e2010-10-15 00:37:241641 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051642}
1643
[email protected]e2ddbc92010-10-15 20:02:071644void FlagsState::RemoveFlagsSwitches(
1645 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531646 for (std::map<std::string, std::string>::const_iterator
1647 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1648 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071649 }
1650}
1651
1652void FlagsState::reset() {
1653 needs_restart_ = false;
1654 flags_switches_.clear();
1655}
1656
[email protected]38e46812011-05-09 20:49:221657} // namespace
[email protected]e2ddbc92010-10-15 20:02:071658
1659namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191660
1661// WARNING: '@' is also used in the html file. If you update this constant you
1662// also need to update the html file.
1663const char kMultiSeparator[] = "@";
1664
[email protected]e2ddbc92010-10-15 20:02:071665void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551666 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071667}
[email protected]a314ee5a2010-10-26 21:23:281668
1669void SetExperiments(const Experiment* e, size_t count) {
1670 if (!e) {
1671 experiments = kExperiments;
1672 num_experiments = arraysize(kExperiments);
1673 } else {
1674 experiments = e;
1675 num_experiments = count;
1676 }
1677}
1678
[email protected]8a6ff28d2010-12-02 16:35:191679const Experiment* GetExperiments(size_t* count) {
1680 *count = num_experiments;
1681 return experiments;
1682}
1683
[email protected]e2ddbc92010-10-15 20:02:071684} // namespace testing
1685
[email protected]1a47d7e2010-10-15 00:37:241686} // namespace about_flags