blob: 97aef50d9f2635a03c519be9400a8059f590a606 [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]f3cd6802013-01-23 20:25:5661const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0562
[email protected]cc3e2052011-12-20 01:01:4063// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
64// whether the experiment is available on that platform.
65void AddOsStrings(unsigned bitmask, ListValue* list) {
66 struct {
67 unsigned bit;
68 const char* const name;
69 } kBitsToOs[] = {
70 {kOsMac, "Mac"},
71 {kOsWin, "Windows"},
72 {kOsLinux, "Linux"},
73 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:0174 {kOsAndroid, "Android"},
[email protected]cc3e2052011-12-20 01:01:4075 };
76 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
77 if (bitmask & kBitsToOs[i].bit)
78 list->Append(new StringValue(kBitsToOs[i].name));
79}
80
[email protected]68317802012-06-07 19:13:2381const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = {
82 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" },
83 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED,
84 switches::kOmniboxHistoryQuickProviderNewScoring,
85 switches::kOmniboxHistoryQuickProviderNewScoringEnabled },
86 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED,
87 switches::kOmniboxHistoryQuickProviderNewScoring,
88 switches::kOmniboxHistoryQuickProviderNewScoringDisabled }
89};
90
[email protected]128dc6c2012-06-22 20:30:3591const Experiment::Choice
92 kOmniboxHistoryQuickProviderReorderForInliningChoices[] = {
93 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC,
94 "",
95 "" },
96 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED,
97 switches::kOmniboxHistoryQuickProviderReorderForInlining,
98 switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled },
99 { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED,
100 switches::kOmniboxHistoryQuickProviderReorderForInlining,
101 switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled }
102};
103
[email protected]032d5e6c2012-02-17 17:53:55104const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = {
105 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" },
106 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED,
107 switches::kOmniboxInlineHistoryQuickProvider,
108 switches::kOmniboxInlineHistoryQuickProviderAllowed },
109 { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED,
110 switches::kOmniboxInlineHistoryQuickProvider,
111 switches::kOmniboxInlineHistoryQuickProviderProhibited }
112};
113
[email protected]de023762012-07-26 17:10:17114const Experiment::Choice kFixedPositionCreatesStackingContextChoices[] = {
115 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
116 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
117 switches::kEnableFixedPositionCreatesStackingContext, ""},
118 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
119 switches::kDisableFixedPositionCreatesStackingContext, ""}
120};
121
[email protected]9b19cf82012-06-13 06:23:23122const Experiment::Choice kForceCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20123 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
124 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]9b19cf82012-06-13 06:23:23125 switches::kForceCompositingMode, ""},
[email protected]a45c69402012-06-24 16:32:20126 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]9b19cf82012-06-13 06:23:23127 switches::kDisableForceCompositingMode, ""}
128};
129
[email protected]72787e392012-03-23 05:55:43130const Experiment::Choice kThreadedCompositingModeChoices[] = {
[email protected]a45c69402012-06-24 16:32:20131 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
132 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]72787e392012-03-23 05:55:43133 switches::kDisableThreadedCompositing, ""},
[email protected]a45c69402012-06-24 16:32:20134 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]72787e392012-03-23 05:55:43135 switches::kEnableThreadedCompositing, ""}
136};
137
[email protected]d7932532012-11-21 21:10:31138const Experiment::Choice kTouchEventsChoices[] = {
139 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
140 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
141 switches::kTouchEvents,
142 switches::kTouchEventsEnabled },
143 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
144 switches::kTouchEvents,
145 switches::kTouchEventsDisabled }
146};
147
[email protected]347a0c72012-05-14 20:28:06148const Experiment::Choice kTouchOptimizedUIChoices[] = {
[email protected]d7932532012-11-21 21:10:31149 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
[email protected]a45c69402012-06-24 16:32:20150 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]347a0c72012-05-14 20:28:06151 switches::kTouchOptimizedUI,
152 switches::kTouchOptimizedUIEnabled },
[email protected]a45c69402012-06-24 16:32:20153 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]347a0c72012-05-14 20:28:06154 switches::kTouchOptimizedUI,
155 switches::kTouchOptimizedUIDisabled }
156};
157
[email protected]026876f32012-08-22 23:53:40158const Experiment::Choice kAsyncDnsChoices[] = {
159 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
160 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
161 switches::kDisableAsyncDns, ""},
162 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
163 switches::kEnableAsyncDns, ""}
164};
165
[email protected]66f409c2012-10-04 20:59:04166const Experiment::Choice kNaClDebugMaskChoices[] = {
167 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
168 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
169 // debug stub to a remote machine. Since secure shell uses NaCl, we provide
170 // an option to switch off its debugging.
171 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS,
172 switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" },
173 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
174 switches::kNaClDebugMask, "*://*/*debug.nmf" }
175};
176
[email protected]544471a2012-10-13 05:27:09177const Experiment::Choice kActionBoxChoices[] = {
178 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
179 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
180 switches::kActionBox, "0"},
181 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
182 switches::kActionBox, "1"}
183};
184
185const Experiment::Choice kScriptBubbleChoices[] = {
186 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
187 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
188 switches::kScriptBubble, "0"},
189 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
190 switches::kScriptBubble, "1"}
191};
192
[email protected]0b9383a2012-10-26 00:58:16193const Experiment::Choice kTabCaptureChoices[] = {
194 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
195 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
196 switches::kTabCapture, "0"},
197 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
198 switches::kTabCapture, "1"}
199};
200
[email protected]ea2f3342012-09-21 21:13:36201#if defined(OS_CHROMEOS)
202const Experiment::Choice kAshBootAnimationFunction[] = {
203 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
204 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2,
205 ash::switches::kAshBootAnimationFunction2, ""},
206 { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3,
207 ash::switches::kAshBootAnimationFunction3, ""}
208};
[email protected]d96aef22012-10-30 11:47:02209
210const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = {
[email protected]ad2fe9f2012-11-15 11:03:19211 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
[email protected]d96aef22012-10-30 11:47:02212 { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR,
[email protected]ad2fe9f2012-11-15 11:03:19213 switches::kEnableChromeCaptivePortalDetector, ""},
214 { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR,
215 switches::kDisableChromeCaptivePortalDetector, ""}
[email protected]d96aef22012-10-30 11:47:02216};
[email protected]ea2f3342012-09-21 21:13:36217#endif
218
[email protected]d153e6f2012-12-21 07:38:09219#if defined(USE_ASH)
220const Experiment::Choice kAshImmersiveModeChoices[] = {
221 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
222 { IDS_FLAGS_ASH_IMMERSIVE_HIDE_TAB_INDICATORS,
223 ash::switches::kAshImmersiveHideTabIndicators, ""}
224};
225#endif
[email protected]347a0c72012-05-14 20:28:06226
[email protected]4bc5050c2010-11-18 17:55:54227// RECORDING USER METRICS FOR FLAGS:
228// -----------------------------------------------------------------------------
229// The first line of the experiment is the internal name. If you'd like to
230// gather statistics about the usage of your flag, you should append a marker
231// comment to the end of the feature name, like so:
232// "my-special-feature", // FLAGS:RECORD_UMA
233//
234// After doing that, run //chrome/tools/extract_actions.py (see instructions at
235// the top of that file for details) to update the chromeactions.txt file, which
236// will enable UMA to record your feature flag.
237//
[email protected]783d5bb2012-10-24 03:47:14238// After your feature has shipped under a flag, you can locate the metrics under
239// the action name AboutFlags_internal-action-name. Actions are recorded once
240// per startup, so you should divide this number by AboutFlags_StartupTick to
241// get a sense of usage. Note that this will not be the same as number of users
242// with a given feature enabled because users can quit and relaunch the
243// application multiple times over a given time interval. The dashboard also
244// shows you how many (metrics reporting) users have enabled the flag over the
245// last seven days. However, note that this is not the same as the number of
246// users who have the flag enabled, since enabling the flag happens once,
247// whereas running with the flag enabled happens until the user flips the flag
248// again.
[email protected]4bc5050c2010-11-18 17:55:54249
[email protected]8a6ff28d2010-12-02 16:35:19250// To add a new experiment add to the end of kExperiments. There are two
251// distinct types of experiments:
252// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
253// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22254// . MULTI_VALUE: a list of choices, the first of which should correspond to a
255// deactivated state for this lab (i.e. no command line option). To specify
256// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
257// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19258// See the documentation of Experiment for details on the fields.
259//
260// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05261const Experiment kExperiments[] = {
262 {
[email protected]aac169d2011-03-18 19:53:03263 "expose-for-tabs", // FLAGS:RECORD_UMA
264 IDS_FLAGS_TABPOSE_NAME,
265 IDS_FLAGS_TABPOSE_DESCRIPTION,
266 kOsMac,
267#if defined(OS_MACOSX)
268 // The switch exists only on OS X.
269 SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs)
270#else
271 SINGLE_VALUE_TYPE("")
272#endif
273 },
274 {
[email protected]4bc5050c2010-11-18 17:55:54275 "conflicting-modules-check", // FLAGS:RECORD_UMA
[email protected]c1bbaa82010-11-08 11:17:05276 IDS_FLAGS_CONFLICTS_CHECK_NAME,
277 IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION,
278 kOsWin,
[email protected]8a6ff28d2010-12-02 16:35:19279 SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck)
[email protected]c1bbaa82010-11-08 11:17:05280 },
281 {
[email protected]4bc5050c2010-11-18 17:55:54282 "cloud-print-proxy", // FLAGS:RECORD_UMA
[email protected]dae7325b2011-12-21 20:56:54283 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME,
284 IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION,
[email protected]9f8872b32011-03-04 19:44:45285 // For a Chrome build, we know we have a PDF plug-in on Windows, so it's
[email protected]4fa24bf2011-08-20 02:15:22286 // fully enabled.
[email protected]5d10d57d2011-07-22 22:16:31287 // Otherwise, where we know Windows could be working if a viable PDF
[email protected]4fa24bf2011-08-20 02:15:22288 // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux
289 // always have PDF rasterization available, so no flag needed there.
290#if !defined(GOOGLE_CHROME_BUILD)
291 kOsWin,
292#else
293 0,
[email protected]fa6d2a2f2010-11-30 21:47:19294#endif
[email protected]8a6ff28d2010-12-02 16:35:19295 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy)
[email protected]8b6588a2010-10-12 02:39:42296 },
[email protected]60d77bd2012-08-22 00:10:07297#if defined(OS_WIN)
298 {
299 "print-raster",
300 IDS_FLAGS_PRINT_RASTER_NAME,
301 IDS_FLAGS_PRINT_RASTER_DESCRIPTION,
302 kOsWin,
303 SINGLE_VALUE_TYPE(switches::kPrintRaster)
304 },
305#endif // OS_WIN
[email protected]0209b442012-07-18 00:38:05306 {
[email protected]bb461532010-11-26 21:50:23307 "crxless-web-apps",
308 IDS_FLAGS_CRXLESS_WEB_APPS_NAME,
309 IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56310 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19311 SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps)
[email protected]bb461532010-11-26 21:50:23312 },
313 {
[email protected]96c6f4c2011-05-18 19:36:22314 "ignore-gpu-blacklist",
315 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
316 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
317 kOsAll,
318 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
319 },
320 {
[email protected]0110cf112011-07-02 00:39:43321 "force-compositing-mode-2",
[email protected]96c6f4c2011-05-18 19:36:22322 IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME,
323 IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION,
[email protected]9b19cf82012-06-13 06:23:23324 kOsMac | kOsWin | kOsLinux,
325 MULTI_VALUE_TYPE(kForceCompositingModeChoices)
[email protected]96c6f4c2011-05-18 19:36:22326 },
327 {
[email protected]72787e392012-03-23 05:55:43328 "threaded-compositing-mode",
329 IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
330 IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56331 kOsDesktop & ~kOsCrOS,
[email protected]72787e392012-03-23 05:55:43332 MULTI_VALUE_TYPE(kThreadedCompositingModeChoices)
[email protected]644a1072012-03-16 09:29:59333 },
334 {
[email protected]81c64af62012-06-06 20:15:52335 "disable-accelerated-2d-canvas",
336 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
337 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
338 kOsAll,
339 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
340 },
341 {
[email protected]69cffc82012-08-10 13:27:27342 "disable-deferred-2d-canvas",
343 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME,
344 IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION,
345 kOsAll,
346 SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas)
347 },
348 {
[email protected]efcde132012-05-30 01:05:18349 "disable-threaded-animation",
350 IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
351 IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
[email protected]644a1072012-03-16 09:29:59352 kOsAll,
[email protected]65bfd9972012-10-19 03:39:37353 SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
[email protected]644a1072012-03-16 09:29:59354 },
355 {
[email protected]5963b772011-02-09 22:55:38356 "composited-layer-borders",
357 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
358 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
359 kOsAll,
360 SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders)
361 },
362 {
[email protected]a8f1eaa2011-03-07 19:00:58363 "show-fps-counter",
364 IDS_FLAGS_SHOW_FPS_COUNTER,
365 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
366 kOsAll,
367 SINGLE_VALUE_TYPE(switches::kShowFPSCounter)
368 },
[email protected]8ff7f342011-05-25 01:49:47369 {
[email protected]70c98a332011-12-21 20:51:52370 "accelerated-filters",
371 IDS_FLAGS_ACCELERATED_FILTERS,
372 IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION,
373 kOsAll,
374 SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
375 },
376 {
[email protected]8ff7f342011-05-25 01:49:47377 "disable-gpu-vsync",
378 IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
379 IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56380 kOsDesktop,
[email protected]8ff7f342011-05-25 01:49:47381 SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
382 },
[email protected]deaba6d52011-09-23 14:47:12383 {
[email protected]4052d832013-01-16 05:31:01384 "enable-webgl",
385 IDS_FLAGS_ENABLE_WEBGL_NAME,
386 IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION,
387 kOsAndroid,
388#if defined(OS_ANDROID)
389 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL)
390#else
391 SINGLE_VALUE_TYPE("")
392#endif
393 },
394 {
[email protected]deaba6d52011-09-23 14:47:12395 "disable-webgl",
396 IDS_FLAGS_DISABLE_WEBGL_NAME,
397 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56398 kOsDesktop,
[email protected]4052d832013-01-16 05:31:01399#if defined(OS_ANDROID)
400 SINGLE_VALUE_TYPE("")
401#else
[email protected]deaba6d52011-09-23 14:47:12402 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
[email protected]4052d832013-01-16 05:31:01403#endif
[email protected]deaba6d52011-09-23 14:47:12404 },
[email protected]09096e02012-05-24 11:12:04405 {
[email protected]96bcdc102012-05-24 23:42:10406 "fixed-position-creates-stacking-context",
407 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME,
408 IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION,
409 kOsAll,
[email protected]de023762012-07-26 17:10:17410 MULTI_VALUE_TYPE(kFixedPositionCreatesStackingContextChoices)
[email protected]96bcdc102012-05-24 23:42:10411 },
[email protected]a7640ef22012-10-06 00:52:08412 // TODO(bbudge): When NaCl is on by default, remove this flag entry.
[email protected]2fe15fcb2010-10-21 20:39:53413 {
[email protected]e3791ce92011-08-09 01:03:32414 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40415 IDS_FLAGS_ENABLE_NACL_NAME,
416 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56417 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19418 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40419 },
[email protected]b39c6d92012-01-31 16:38:41420 // TODO(halyavin): When exception handling is on by default, replace this
421 // flag with disable-nacl-exception-handling.
422 {
423 "enable-nacl-exception-handling", // FLAGS:RECORD_UMA
424 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME,
425 IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56426 kOsDesktop,
[email protected]b39c6d92012-01-31 16:38:41427 SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling)
428 },
[email protected]4ff87d202010-11-06 01:28:40429 {
[email protected]9addd1c2012-09-15 14:28:24430 "enable-nacl-debug", // FLAGS:RECORD_UMA
431 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
432 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56433 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24434 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13435 },
436 {
[email protected]66f409c2012-10-04 20:59:04437 "nacl-debug-mask", // FLAGS:RECORD_UMA
438 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
439 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56440 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04441 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
442 },
443 {
[email protected]7babd1c2012-08-08 20:35:29444 "enable-pnacl", // FLAGS:RECORD_UMA
445 IDS_FLAGS_ENABLE_PNACL_NAME,
446 IDS_FLAGS_ENABLE_PNACL_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56447 kOsDesktop,
[email protected]7babd1c2012-08-08 20:35:29448 SINGLE_VALUE_TYPE(switches::kEnablePnacl)
449 },
450 {
[email protected]4bc5050c2010-11-18 17:55:54451 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32452 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
453 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56454 kOsDesktop,
[email protected]8a6ff28d2010-12-02 16:35:19455 SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32456 },
[email protected]3627b06d2010-11-12 16:36:16457 {
[email protected]544471a2012-10-13 05:27:09458 "action-box",
[email protected]cab18ef2012-04-27 07:22:03459 IDS_FLAGS_ACTION_BOX_NAME,
460 IDS_FLAGS_ACTION_BOX_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56461 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09462 MULTI_VALUE_TYPE(kActionBoxChoices),
[email protected]cab18ef2012-04-27 07:22:03463 },
464 {
[email protected]3a362432012-06-18 20:39:51465 "script-badges",
466 IDS_FLAGS_SCRIPT_BADGES_NAME,
467 IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56468 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09469 SINGLE_VALUE_TYPE(switches::kScriptBadges)
470 },
471 {
472 "script-bubble",
473 IDS_FLAGS_SCRIPT_BUBBLE_NAME,
474 IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56475 kOsDesktop,
[email protected]544471a2012-10-13 05:27:09476 MULTI_VALUE_TYPE(kScriptBubbleChoices),
[email protected]3a362432012-06-18 20:39:51477 },
478 {
[email protected]cbe224d2011-08-04 22:12:49479 "apps-new-install-bubble",
480 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME,
481 IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56482 kOsDesktop,
[email protected]cbe224d2011-08-04 22:12:49483 SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble)
484 },
485 {
[email protected]80bd24e2010-11-30 09:34:38486 "disable-hyperlink-auditing",
487 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
488 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
489 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19490 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51491 },
492 {
493 "experimental-location-features", // FLAGS:RECORD_UMA
494 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME,
495 IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION,
496 kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS.
[email protected]8a6ff28d2010-12-02 16:35:19497 SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures)
498 },
499 {
[email protected]5aea1862011-03-23 23:55:39500 "tab-groups-context-menu",
501 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME,
502 IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION,
503 kOsWin,
504 SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu)
505 },
[email protected]c94cebd2012-06-21 00:55:28506 {
507 "enable-instant-extended-api",
508 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API,
509 IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56510 kOsDesktop,
[email protected]c94cebd2012-06-21 00:55:28511 SINGLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI)
512 },
[email protected]e9bf9d92011-03-31 20:57:15513 {
[email protected]354e33b2011-06-15 00:29:10514 "static-ip-config",
515 IDS_FLAGS_STATIC_IP_CONFIG_NAME,
516 IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION,
517 kOsCrOS,
518#if defined(OS_CHROMEOS)
519 // This switch exists only on Chrome OS.
520 SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig)
521#else
522 SINGLE_VALUE_TYPE("")
523#endif
524 },
[email protected]3eb5728c2011-06-20 22:32:24525 {
526 "show-autofill-type-predictions",
527 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
528 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
529 kOsAll,
530 SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions)
531 },
[email protected]bff4d3e2011-06-21 23:58:52532 {
[email protected]fdf4e252012-04-27 00:26:55533 "sync-tab-favicons",
534 IDS_FLAGS_SYNC_TAB_FAVICONS_NAME,
535 IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION,
536 kOsAll,
537 SINGLE_VALUE_TYPE(switches::kSyncTabFavicons)
538 },
539 {
[email protected]aae9eeb12011-10-21 21:59:26540 "sync-app-notifications",
541 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_NAME,
542 IDS_FLAGS_SYNC_APP_NOTIFICATIONS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56543 kOsDesktop,
[email protected]0b6fba82011-11-18 01:31:11544 SINGLE_VALUE_TYPE(switches::kDisableSyncAppNotifications)
[email protected]aae9eeb12011-10-21 21:59:26545 },
546 {
[email protected]5d90a0a2012-11-15 02:43:40547 "sync-keystore-encryption",
548 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME,
549 IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION,
550 kOsAll,
551 SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption)
552 },
553 {
[email protected]e755a382012-09-13 17:16:35554 "enable-gesture-tap-highlight",
555 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME,
556 IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION,
557 kOsLinux | kOsCrOS,
558 SINGLE_VALUE_TYPE(switches::kEnableGestureTapHighlight)
559 },
560 {
[email protected]a22ebd812011-06-23 00:05:39561 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
562 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
563 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
564 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40565 // On by default for the Mac (different implementation in WebKit).
[email protected]2a5e9d02013-01-20 01:09:25566 kOsWin | kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39567 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
568 },
[email protected]81a6b0b2011-06-24 17:55:40569 {
[email protected]68317802012-06-07 19:13:23570 "omnibox-history-quick-provider-new-scoring",
571 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME,
572 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION,
573 kOsAll,
574 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices)
575 },
576 {
[email protected]128dc6c2012-06-22 20:30:35577 "omnibox-history-quick-provider-reorder-for-inlining",
578 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME,
579 IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION,
580 kOsAll,
581 MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices)
582 },
583 {
[email protected]032d5e6c2012-02-17 17:53:55584 "omnibox-inline-history-quick-provider",
585 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME,
586 IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION,
587 kOsAll,
588 MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices)
589 },
590 {
[email protected]7e7a28092011-12-09 22:24:55591 "enable-panels",
592 IDS_FLAGS_ENABLE_PANELS_NAME,
593 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56594 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55595 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54596 },
[email protected]e3749d12011-07-25 22:22:12597 {
[email protected]fd38cc82012-12-19 18:19:29598 "enable-panel-stacking",
599 IDS_FLAGS_ENABLE_PANEL_STACKING_NAME,
600 IDS_FLAGS_ENABLE_PANEL_STACKING_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56601 kOsDesktop,
[email protected]fd38cc82012-12-19 18:19:29602 SINGLE_VALUE_TYPE(switches::kEnablePanelStacking)
603 },
604 {
[email protected]27c14f02012-06-22 17:29:58605 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27606 "save-page-as-mhtml", // FLAGS:RECORD_UMA
607 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
608 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
609 kOsMac | kOsWin | kOsLinux,
610 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
611 },
612 {
[email protected]b7bb44f2011-09-01 05:17:03613 "enable-autologin",
614 IDS_FLAGS_ENABLE_AUTOLOGIN_NAME,
615 IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION,
616 kOsMac | kOsWin | kOsLinux,
617 SINGLE_VALUE_TYPE(switches::kEnableAutologin)
618 },
[email protected]b9841172011-09-26 23:36:09619 {
[email protected]bbadb112011-12-12 16:55:28620 "enable-http-pipelining",
621 IDS_FLAGS_ENABLE_HTTP_PIPELINING_NAME,
622 IDS_FLAGS_ENABLE_HTTP_PIPELINING_DESCRIPTION,
623 kOsAll,
624 SINGLE_VALUE_TYPE(switches::kEnableHttpPipelining)
625 },
[email protected]d411c01d2011-10-18 16:00:27626 {
[email protected]3231b612012-03-23 05:57:54627 "enable-spdy3",
628 IDS_FLAGS_ENABLE_SPDY3_NAME,
629 IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION,
630 kOsAll,
631 SINGLE_VALUE_TYPE(switches::kEnableSpdy3)
632 },
633 {
[email protected]27b3fe92012-03-21 05:35:06634 "enable-async-dns",
635 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
636 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46637 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]026876f32012-08-22 23:53:40638 MULTI_VALUE_TYPE(kAsyncDnsChoices)
[email protected]27b3fe92012-03-21 05:35:06639 },
640 {
[email protected]1eb93802012-09-11 18:57:56641 "disable-media-source",
[email protected]da43c082012-09-07 18:56:11642 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
643 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32644 kOsAll,
[email protected]da43c082012-09-07 18:56:11645 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]6aa03b32011-10-27 21:44:44646 },
[email protected]e4e68dbb2011-11-18 01:50:22647 {
[email protected]9f5b7822012-04-18 23:39:03648 "enable-encrypted-media",
649 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
650 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56651 kOsDesktop,
[email protected]9f5b7822012-04-18 23:39:03652 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
653 },
[email protected]f88628792012-12-18 07:07:50654 {
655 "enable-opus-playback",
656 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME,
657 IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56658 kOsDesktop,
[email protected]f88628792012-12-18 07:07:50659 SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback)
660 },
[email protected]ca6eaa5a2013-01-24 16:16:04661 {
662 "enable-managed-users",
663 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME,
664 IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION,
665 kOsAll,
666 SINGLE_VALUE_TYPE(switches::kEnableManagedUsers)
667 },
[email protected]dc04be7c2012-03-15 23:57:49668#if defined(USE_ASH)
[email protected]8cc10df2011-11-03 23:57:50669 {
[email protected]cda278d2012-10-30 20:31:40670 "ash-disable-auto-window-placement",
671 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME,
672 IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION,
673 kOsWin | kOsLinux | kOsCrOS,
674 SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement)
675 },
[email protected]b4e4ec42012-11-29 21:42:40676 {
677 "ash-enable-per-app-launcher",
678 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_NAME,
679 IDS_FLAGS_ASH_ENABLE_PER_APP_LAUNCHER_DESCRIPTION,
680 kOsWin | kOsLinux | kOsCrOS,
681 SINGLE_VALUE_TYPE(ash::switches::kAshEnablePerAppLauncher)
682 },
[email protected]dc04be7c2012-03-15 23:57:49683#endif
[email protected]eaae8b462012-01-20 22:20:39684 {
[email protected]db543d322011-12-15 20:40:15685 "per-tile-painting",
686 IDS_FLAGS_PER_TILE_PAINTING_NAME,
687 IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION,
688#if defined(USE_SKIA)
[email protected]a5b1b272012-01-06 20:44:37689 kOsMac | kOsLinux | kOsCrOS,
[email protected]db543d322011-12-15 20:40:15690#else
691 0,
692#endif
[email protected]65bfd9972012-10-19 03:39:37693 SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
[email protected]db543d322011-12-15 20:40:15694 },
[email protected]bf88c032011-12-22 19:05:47695 {
696 "enable-javascript-harmony",
697 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
698 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
699 kOsAll,
700 SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony")
701 },
[email protected]7e7f378a2012-01-05 14:35:37702 {
[email protected]85646172012-01-09 22:45:54703 "enable-tab-browser-dragging",
704 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME,
705 IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION,
706 kOsWin,
707 SINGLE_VALUE_TYPE(switches::kTabBrowserDragging)
708 },
709 {
[email protected]068b7b52012-02-27 12:41:44710 "disable-restore-session-state",
711 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME,
712 IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION,
[email protected]7e7f378a2012-01-05 14:35:37713 kOsAll,
[email protected]068b7b52012-02-27 12:41:44714 SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState)
[email protected]7e7f378a2012-01-05 14:35:37715 },
[email protected]88864db2012-01-18 20:56:35716 {
717 "disable-software-rasterizer",
718 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
719 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
720#if defined(ENABLE_SWIFTSHADER)
721 kOsAll,
722#else
723 0,
724#endif
725 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
726 },
[email protected]15a5d722012-01-23 09:11:14727 {
[email protected]ff7b6dd2012-09-15 20:20:03728 "enable-experimental-webkit-features",
729 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME,
730 IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16731 kOsAll,
[email protected]ff7b6dd2012-09-15 20:20:03732 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures)
[email protected]ca7a3d792012-03-02 15:55:49733 },
734 {
[email protected]0f95a252012-09-13 22:30:04735 "enable-css-shaders",
736 IDS_FLAGS_CSS_SHADERS_NAME,
737 IDS_FLAGS_CSS_SHADERS_DESCRIPTION,
738 kOsAll,
739 SINGLE_VALUE_TYPE(switches::kEnableCssShaders)
740 },
741 {
[email protected]9860c68b2012-02-02 01:58:09742 "enable-extension-activity-ui",
743 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME,
744 IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56745 kOsDesktop,
[email protected]9860c68b2012-02-02 01:58:09746 SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI)
[email protected]8bed69d2012-02-02 06:46:00747 },
[email protected]54ae4e92012-02-16 15:19:05748 {
[email protected]3e8befc2012-03-13 01:17:03749 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16750 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
751 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56752 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03753 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16754 },
[email protected]dc04be7c2012-03-15 23:57:49755#if defined(USE_ASH)
[email protected]31cf1c52012-02-29 20:55:01756 {
[email protected]3cd198a22012-03-12 20:38:01757 "enable-ash-oak",
758 IDS_FLAGS_ENABLE_ASH_OAK_NAME,
759 IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION,
760 kOsAll,
761 SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak),
762 },
[email protected]31cf1c52012-02-29 20:55:01763#endif
[email protected]184ec592012-03-01 11:54:28764 {
765 "enable-devtools-experiments",
766 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
767 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56768 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28769 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
770 },
[email protected]76d1854e2012-03-02 23:57:44771 {
772 "enable-suggestions-ntp",
773 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME,
774 IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56775 kOsDesktop,
[email protected]76d1854e2012-03-02 23:57:44776 SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage)
777 },
[email protected]a3d54252012-04-05 20:04:13778 {
[email protected]1dbaf5e2012-11-30 05:51:32779 "spellcheck-autocorrect",
780 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
781 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
782 kOsWin | kOsLinux | kOsCrOS,
783 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
784 },
785 {
[email protected]d7932532012-11-21 21:10:31786 "touch-events",
787 IDS_TOUCH_EVENTS_NAME,
788 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56789 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31790 MULTI_VALUE_TYPE(kTouchEventsChoices)
791 },
792 {
[email protected]c9c73ad42012-04-18 03:35:59793 "touch-optimized-ui",
[email protected]347a0c72012-05-14 20:28:06794 IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
795 IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
[email protected]c71fe6402012-08-15 15:22:55796 kOsWin,
[email protected]347a0c72012-05-14 20:28:06797 MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
[email protected]c9c73ad42012-04-18 03:35:59798 },
[email protected]8a6aaa72012-04-20 20:53:58799 {
[email protected]f6f82832012-09-04 17:12:04800 "enable-webkit-text-subpixel-positioning",
801 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_NAME,
802 IDS_FLAGS_ENABLE_WEBKIT_TEXT_SUBPIXEL_POSITIONING_DESCRIPTION,
803 kOsCrOS,
[email protected]0d3b9dd2012-11-14 04:14:48804 SINGLE_VALUE_TYPE(gfx::switches::kEnableWebkitTextSubpixelPositioning)
[email protected]f6f82832012-09-04 17:12:04805 },
806 {
[email protected]b9c96ff2012-11-26 22:24:40807 "disable-touch-adjustment",
808 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
809 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
810 kOsWin | kOsLinux | kOsCrOS,
811 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
812 },
813 {
[email protected]0b9383a2012-10-26 00:58:16814 "enable-tab-capture",
815 IDS_ENABLE_TAB_CAPTURE_NAME,
816 IDS_ENABLE_TAB_CAPTURE_DESCRIPTION,
[email protected]a692d132012-10-31 05:15:25817 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]0b9383a2012-10-26 00:58:16818 MULTI_VALUE_TYPE(kTabCaptureChoices)
819 },
[email protected]0b60afa2012-04-19 17:36:39820#if defined(OS_CHROMEOS)
821 {
[email protected]7c4a9bc2012-09-11 22:10:05822 "enable-background-loader",
823 IDS_ENABLE_BACKLOADER_NAME,
824 IDS_ENABLE_BACKLOADER_DESCRIPTION,
825 kOsCrOS,
826 SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader)
827 },
828 {
[email protected]c5667b282012-08-31 00:32:50829 "enable-bezel-touch",
830 IDS_ENABLE_BEZEL_TOUCH_NAME,
831 IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION,
[email protected]1995d80d2012-08-23 02:58:47832 kOsCrOS,
[email protected]c5667b282012-08-31 00:32:50833 SINGLE_VALUE_TYPE(switches::kEnableBezelTouch)
[email protected]1995d80d2012-08-23 02:58:47834 },
835 {
[email protected]0b60afa2012-04-19 17:36:39836 "no-discard-tabs",
837 IDS_FLAGS_NO_DISCARD_TABS_NAME,
838 IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION,
839 kOsCrOS,
840 SINGLE_VALUE_TYPE(switches::kNoDiscardTabs)
841 },
842#endif
[email protected]79be6d32012-04-24 20:47:44843 {
[email protected]8d68a3e02013-01-12 15:57:10844 "enable-download-resumption",
845 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
846 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56847 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10848 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
849 },
850 {
[email protected]9a5940d2012-04-27 19:16:23851 "allow-nacl-socket-api",
852 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
853 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56854 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23855 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
856 },
[email protected]85333732012-05-01 19:02:24857 {
[email protected]60673ad72012-05-02 06:16:33858 "stacked-tab-strip",
859 IDS_FLAGS_STACKED_TAB_STRIP_NAME,
860 IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION,
861 kOsWin,
862 SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip)
863 },
864 {
[email protected]4bd20202012-06-14 17:35:01865 "force-device-scale-factor",
[email protected]85333732012-05-01 19:02:24866 IDS_FLAGS_FORCE_HIGH_DPI_NAME,
867 IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION,
868 kOsCrOS,
[email protected]4bd20202012-06-14 17:35:01869 SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2")
[email protected]85333732012-05-01 19:02:24870 },
[email protected]190349fd2012-05-02 00:10:47871#if defined(OS_CHROMEOS)
872 {
873 "allow-touchpad-three-finger-click",
874 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
875 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
876 kOsCrOS,
877 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick)
878 },
[email protected]fbc176b62012-10-27 02:19:58879 {
880 "allow-touchpad-three-finger-swipe",
881 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME,
882 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION,
883 kOsCrOS,
884 SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe)
885 },
[email protected]190349fd2012-05-02 00:10:47886#endif
[email protected]1992a2f42012-10-23 18:32:21887 {
[email protected]3420d9a2012-12-13 02:30:01888 "use-web-based-signin-flow",
889 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_NAME,
890 IDS_FLAGS_USE_WEB_BASED_SIGNIN_FLOW_DESCRIPTION,
[email protected]1992a2f42012-10-23 18:32:21891 kOsMac | kOsWin | kOsLinux,
[email protected]3420d9a2012-12-13 02:30:01892 SINGLE_VALUE_TYPE(switches::kUseWebBasedSigninFlow)
[email protected]1992a2f42012-10-23 18:32:21893 },
[email protected]8ee02242012-12-04 15:23:32894 {
895 "enable-desktop-guest-mode",
896 IDS_FLAGS_DESKTOP_GUEST_MODE_NAME,
897 IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION,
898 kOsMac | kOsWin | kOsLinux,
899 SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode)
900 },
[email protected]53520b1b2012-05-07 21:43:37901#if defined(USE_ASH)
902 {
[email protected]55444502012-05-10 15:43:53903 "show-launcher-alignment-menu",
904 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_NAME,
905 IDS_FLAGS_SHOW_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION,
906 kOsAll,
907 SINGLE_VALUE_TYPE(switches::kShowLauncherAlignmentMenu)
908 },
[email protected]817ecd12012-05-16 18:36:53909 {
[email protected]73074742012-05-17 01:44:41910 "show-touch-hud",
911 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
912 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
913 kOsAll,
914 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
915 },
916 {
[email protected]9f0940b62012-05-23 22:56:35917 "enable-pinch",
918 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
919 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06920 kOsLinux | kOsWin | kOsCrOS,
[email protected]9f0940b62012-05-23 22:56:35921 SINGLE_VALUE_TYPE(switches::kEnablePinch),
922 },
[email protected]a8379312012-06-15 00:20:43923 {
924 "app-list-show-apps-only",
925 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME,
926 IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION,
927 kOsAll,
[email protected]0bc6c272012-07-17 03:32:03928 SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly),
[email protected]a8379312012-06-15 00:20:43929 },
[email protected]73074742012-05-17 01:44:41930#endif // defined(USE_ASH)
[email protected]ed7b67f32012-05-28 10:12:28931#if defined(OS_CHROMEOS)
932 {
[email protected]f9634692013-01-15 06:16:10933 "force-oauth1",
934 IDS_FLAGS_FORCE_OAUTH1_DISPLAY_NAME,
935 IDS_FLAGS_FORCE_OAUTH1_DISPLAY_DESCRIPTION,
936 kOsCrOS,
937 SINGLE_VALUE_TYPE(::switches::kForceOAuth1),
938 },
939 {
[email protected]e03dc78d2012-07-24 08:21:43940 "disable-new-oobe",
941 IDS_FLAGS_DISABLE_NEW_OOBE,
942 IDS_FLAGS_DISABLE_NEW_OOBE_DESCRIPTION,
[email protected]ed7b67f32012-05-28 10:12:28943 kOsCrOS,
[email protected]e03dc78d2012-07-24 08:21:43944 SINGLE_VALUE_TYPE(switches::kDisableNewOobe),
[email protected]ed7b67f32012-05-28 10:12:28945 },
[email protected]8b04a1652012-08-04 02:59:49946 {
[email protected]528ced32012-12-14 00:40:44947 "disable-new-password-changed-dialog",
948 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG,
949 IDS_FLAGS_DISABLE_NEW_PASSWORD_CHANGED_DIALOG_DESCRIPTION,
950 kOsCrOS,
951 SINGLE_VALUE_TYPE(switches::kDisableNewPasswordChangedDialog),
952 },
953 {
[email protected]8b04a1652012-08-04 02:59:49954 "disable-boot-animation",
955 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
956 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
957 kOsCrOS,
958 SINGLE_VALUE_TYPE(switches::kDisableBootAnimation),
959 },
[email protected]95058572012-08-20 14:57:29960 {
[email protected]b4557192012-09-19 11:29:58961 "disable-boot-animation2",
962 IDS_FLAGS_DISABLE_BOOT_ANIMATION2,
963 IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION,
964 kOsCrOS,
965 SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2),
966 },
967 {
[email protected]ea2f3342012-09-21 21:13:36968 "boot-animation-fucntion",
969 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION,
970 IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION,
971 kOsCrOS,
972 MULTI_VALUE_TYPE(kAshBootAnimationFunction),
973 },
[email protected]839667d62012-10-23 19:38:57974 {
[email protected]d96aef22012-10-30 11:47:02975 "captive-portal-detector",
976 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME,
977 IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION,
978 kOsCrOS,
979 MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices),
980 },
981 {
[email protected]c11aa8f12012-12-18 18:43:14982 "disable-new-lock-animations",
[email protected]839667d62012-10-23 19:38:57983 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS,
984 IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION,
985 kOsCrOS,
[email protected]c11aa8f12012-12-18 18:43:14986 SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations),
[email protected]839667d62012-10-23 19:38:57987 },
[email protected]f0280952012-11-06 20:30:50988 {
[email protected]0fb5c4852012-11-08 20:33:23989 "file-manager-packaged",
990 IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME,
991 IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION,
992 kOsCrOS,
993 SINGLE_VALUE_TYPE(switches::kFileManagerPackaged),
994 },
[email protected]3e035e82012-11-27 20:54:32995 {
[email protected]8039e06c2013-01-17 23:34:50996 "disable-launcher-per-display",
997 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME,
998 IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION,
[email protected]62018dc2012-12-13 00:37:35999 kOsCrOS,
[email protected]8039e06c2013-01-17 23:34:501000 SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay),
[email protected]62018dc2012-12-13 00:37:351001 },
1002#endif // defined(OS_CHROMEOS)
[email protected]fc7a93c2012-06-08 20:25:391003 {
1004 "enable-views-textfield",
1005 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_NAME,
1006 IDS_FLAGS_ENABLE_VIEWS_TEXTFIELD_DESCRIPTION,
1007 kOsWin,
1008 SINGLE_VALUE_TYPE(switches::kEnableViewsTextfield),
1009 },
[email protected]bd0cd3bb2012-06-14 03:03:381010 {
[email protected]ef41b7ee2012-07-24 19:10:411011 "old-checkbox-style",
1012 IDS_FLAGS_OLD_CHECKBOX_STYLE,
1013 IDS_FLAGS_OLD_CHECKBOX_STYLE_DESCRIPTION,
1014 kOsLinux | kOsCrOS,
1015 SINGLE_VALUE_TYPE(switches::kOldCheckboxStyle),
1016 },
1017 {
[email protected]2d4817742012-12-17 20:16:181018 "enable-new-dialog-style",
1019 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME,
1020 IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION,
[email protected]fcb88de2012-07-12 22:25:321021 kOsWin | kOsCrOS,
[email protected]2d4817742012-12-17 20:16:181022 SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle),
[email protected]fcb88de2012-07-12 22:25:321023 },
[email protected]7db8893a2012-07-26 00:49:401024 { "disable-accelerated-video-decode",
1025 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1026 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561027 kOsDesktop,
[email protected]7db8893a2012-07-26 00:49:401028 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151029 },
[email protected]66ae9fc2012-06-19 21:33:521030#if defined(USE_ASH)
1031 {
1032 "ash-debug-shortcuts",
1033 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1034 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1035 kOsAll,
1036 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1037 },
1038#endif
[email protected]37fee0942012-08-07 21:07:451039 {
[email protected]e2e8e322012-09-12 04:37:021040 "enable-webaudio-input",
1041 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME,
1042 IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561043 kOsDesktop,
[email protected]e2e8e322012-09-12 04:37:021044 SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput),
1045 },
1046 {
[email protected]ad3f6d22012-08-29 02:34:191047 "enable-contacts",
1048 IDS_FLAGS_ENABLE_CONTACTS_NAME,
1049 IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION,
1050 kOsCrOS,
1051 SINGLE_VALUE_TYPE(switches::kEnableContacts)
1052 },
[email protected]1d9bb9cd2012-08-28 22:02:501053#if defined(USE_ASH)
1054 { "ash-enable-advanced-gestures",
1055 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME,
1056 IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION,
1057 kOsCrOS,
1058 SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures),
1059 },
[email protected]51075f8c2012-11-13 01:48:161060 { "ash-enable-tab-scrubbing",
1061 IDS_FLAGS_ENABLE_TAB_SCRUBBING_NAME,
1062 IDS_FLAGS_ENABLE_TAB_SCRUBBING_DESCRIPTION,
1063 kOsCrOS,
1064 SINGLE_VALUE_TYPE(switches::kAshEnableTabScrubbing),
1065 },
[email protected]83eef802012-12-02 07:43:521066 { "ash-enable-workspace-scrubbing",
1067 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME,
1068 IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION,
1069 kOsCrOS,
1070 SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing),
1071 },
[email protected]d153e6f2012-12-21 07:38:091072 { "ash-immersive-mode",
1073 IDS_FLAGS_ASH_IMMERSIVE_MODE_NAME,
1074 IDS_FLAGS_ASH_IMMERSIVE_MODE_DESCRIPTION,
[email protected]c043df272012-11-21 00:43:241075 kOsCrOS,
[email protected]d153e6f2012-12-21 07:38:091076 MULTI_VALUE_TYPE(kAshImmersiveModeChoices),
[email protected]c043df272012-11-21 00:43:241077 },
[email protected]316708a2012-11-05 22:57:021078#if defined(OS_LINUX)
1079 { "ash-enable-memory-monitor",
1080 IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME,
1081 IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION,
1082 kOsCrOS,
1083 SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor),
1084 },
1085#endif
[email protected]1d9bb9cd2012-08-28 22:02:501086#endif
[email protected]9b7ab882012-09-10 23:46:361087#if defined(OS_CHROMEOS)
[email protected]badba1ad2012-11-16 17:21:461088 { "enable-new-network-handlers",
1089 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_NAME,
1090 IDS_FLAGS_ENABLE_NEW_NETWORK_HANDLERS_DESCRIPTION,
1091 kOsCrOS,
1092 SINGLE_VALUE_TYPE(chromeos::switches::kEnableNewNetworkHandlers),
1093 },
[email protected]9b7ab882012-09-10 23:46:361094 {
[email protected]205f07892012-10-16 20:26:221095 "enable-carrier-switching",
1096 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1097 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1098 kOsCrOS,
1099 SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching)
1100 },
1101 {
[email protected]9b7ab882012-09-10 23:46:361102 "enable-request-tablet-site",
1103 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1104 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1105 kOsCrOS,
1106 SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite)
1107 },
1108#endif
[email protected]dab49c0b2012-10-04 05:55:351109 {
1110 "debug-packed-apps",
1111 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1112 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561113 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351114 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1115 },
[email protected]d1459ed2012-10-10 01:29:331116 {
1117 "enable-password-generation",
1118 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1119 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561120 kOsDesktop,
[email protected]d1459ed2012-10-10 01:29:331121 SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration)
1122 },
[email protected]26d045f2012-10-18 21:18:431123 {
1124 "crash-on-gpu-hang",
1125 IDS_FLAGS_CRASH_ON_GPU_HANG_NAME,
1126 IDS_FLAGS_CRASH_ON_GPU_HANG_DESCRIPTION,
1127 kOsAll,
1128 SINGLE_VALUE_TYPE(switches::kCrashOnGpuHang)
1129 },
[email protected]075543d2012-10-24 01:29:141130 {
[email protected]76f7d4882012-10-26 21:09:221131 "enable-deferred-image-decoding",
1132 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1133 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
1134#if defined(USE_SKIA)
1135 kOsMac | kOsLinux | kOsCrOS,
1136#else
1137 0,
1138#endif
1139 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1140 },
1141 {
[email protected]075543d2012-10-24 01:29:141142 "performance-monitor-gathering",
1143 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME,
1144 IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION,
1145 kOsAll,
1146 SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering)
1147 },
[email protected]783d5bb2012-10-24 03:47:141148 {
[email protected]0572fb2e2012-11-03 00:38:591149 "enable-new-autofill-ui",
1150 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_NAME,
1151 IDS_FLAGS_ENABLE_NEW_AUTOFILL_UI_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561152 kOsDesktop,
[email protected]0572fb2e2012-11-03 00:38:591153 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillUi)
1154 },
1155 {
[email protected]783d5bb2012-10-24 03:47:141156 "enable-new-autofill-heuristics",
1157 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_NAME,
1158 IDS_FLAGS_ENABLE_NEW_AUTOFILL_HEURISTICS_DESCRIPTION,
1159 kOsAll,
1160 SINGLE_VALUE_TYPE(switches::kEnableNewAutofillHeuristics)
1161 },
[email protected]2c273bd2012-10-25 18:55:031162 {
[email protected]99002fd2012-11-06 04:35:521163 "show-app-list-shortcut",
1164 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME,
1165 IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION,
1166 kOsWin,
1167 SINGLE_VALUE_TYPE(switches::kShowAppListShortcut)
1168 },
[email protected]a7259fb2012-11-08 06:22:231169 {
1170 "enable-experimental-form-filling",
1171 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME,
1172 IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION,
1173 kOsWin | kOsCrOS,
1174 SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling)
1175 },
[email protected]aa75e4ed2012-11-08 23:51:511176 {
1177 "enable-interactive-autocomplete",
1178 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
1179 IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
1180 kOsWin | kOsCrOS,
1181 SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
1182 },
[email protected]e42b1f82012-11-16 21:18:461183#if defined(USE_AURA)
1184 {
[email protected]6c83c382013-01-24 20:46:011185 "disable-overscroll-history-navigation",
1186 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1187 IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
[email protected]e42b1f82012-11-16 21:18:461188 kOsAll,
[email protected]6c83c382013-01-24 20:46:011189 SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation)
[email protected]e42b1f82012-11-16 21:18:461190 },
1191#endif
[email protected]edbea622012-11-28 20:39:381192 {
1193 "enable-touch-drag-drop",
1194 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1195 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1196 kOsWin | kOsCrOS,
1197 SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop)
1198 },
[email protected]3a6446f12012-12-08 16:55:291199 {
1200 "load-cloud-policy-on-signin",
1201 IDS_FLAGS_DESKTOP_CLOUD_POLICY_NAME,
1202 IDS_FLAGS_DESKTOP_CLOUD_POLICY_DESCRIPTION,
1203 kOsWin | kOsMac | kOsLinux,
1204 SINGLE_VALUE_TYPE(switches::kLoadCloudPolicyOnSignin)
[email protected]92e12dd92012-12-11 03:33:201205 },
1206 {
1207 "enable-rich-notifications",
1208 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME,
1209 IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION,
1210 kOsWin | kOsCrOS,
1211 SINGLE_VALUE_TYPE(switches::kEnableRichNotifications)
1212 },
[email protected]4d51c682012-12-11 11:34:551213 {
1214 "full-history-sync",
1215 IDS_FLAGS_FULL_HISTORY_SYNC_NAME,
1216 IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION,
1217 kOsAll,
1218 SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync)
1219 },
[email protected]628a69a92012-12-23 04:09:341220 {
1221 "enable-data-channels",
1222 IDS_FLAGS_RTC_DATACHANNELS,
1223 IDS_FLAGS_RTC_DATACHANNELS_DESCRIPTION,
1224 kOsAll,
1225 SINGLE_VALUE_TYPE(switches::kEnableDataChannels)
1226 },
[email protected]4a831542013-01-18 00:21:091227 {
1228 "enable-sync-dictionary",
1229 IDS_FLAGS_ENABLE_SYNC_DICTIONARY_NAME,
1230 IDS_FLAGS_ENABLE_SYNC_DICTIONARY_DESCRIPTION,
1231 kOsWin | kOsCrOS | kOsLinux,
1232 SINGLE_VALUE_TYPE(switches::kEnableSyncDictionary)
1233 },
[email protected]a0e4b072011-08-17 01:47:071234};
[email protected]ad2a3ded2010-08-27 13:19:051235
[email protected]a314ee5a2010-10-26 21:23:281236const Experiment* experiments = kExperiments;
1237size_t num_experiments = arraysize(kExperiments);
1238
[email protected]e2ddbc92010-10-15 20:02:071239// Stores and encapsulates the little state that about:flags has.
1240class FlagsState {
1241 public:
1242 FlagsState() : needs_restart_(false) {}
1243 void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line);
1244 bool IsRestartNeededToCommitChanges();
1245 void SetExperimentEnabled(
[email protected]a314ee5a2010-10-26 21:23:281246 PrefService* prefs, const std::string& internal_name, bool enable);
[email protected]e2ddbc92010-10-15 20:02:071247 void RemoveFlagsSwitches(
1248 std::map<std::string, CommandLine::StringType>* switch_list);
1249 void reset();
1250
1251 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551252 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:071253 return Singleton<FlagsState>::get();
1254 }
1255
1256 private:
1257 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:531258 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:071259
1260 DISALLOW_COPY_AND_ASSIGN(FlagsState);
1261};
1262
[email protected]c7b7800a2010-10-07 18:51:351263// Extracts the list of enabled lab experiments from preferences and stores them
[email protected]ad2a3ded2010-08-27 13:19:051264// in a set.
[email protected]1a47d7e2010-10-15 00:37:241265void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) {
[email protected]ad2a3ded2010-08-27 13:19:051266 const ListValue* enabled_experiments = prefs->GetList(
1267 prefs::kEnabledLabsExperiments);
1268 if (!enabled_experiments)
1269 return;
1270
1271 for (ListValue::const_iterator it = enabled_experiments->begin();
1272 it != enabled_experiments->end();
1273 ++it) {
1274 std::string experiment_name;
1275 if (!(*it)->GetAsString(&experiment_name)) {
1276 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
1277 continue;
1278 }
1279 result->insert(experiment_name);
1280 }
1281}
1282
1283// Takes a set of enabled lab experiments
[email protected]1a47d7e2010-10-15 00:37:241284void SetEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051285 PrefService* prefs, const std::set<std::string>& enabled_experiments) {
[email protected]1bc78422011-03-31 08:41:381286 ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments);
1287 ListValue* experiments_list = update.Get();
[email protected]ad2a3ded2010-08-27 13:19:051288
1289 experiments_list->Clear();
1290 for (std::set<std::string>::const_iterator it = enabled_experiments.begin();
1291 it != enabled_experiments.end();
1292 ++it) {
1293 experiments_list->Append(new StringValue(*it));
1294 }
1295}
1296
[email protected]8a6ff28d2010-12-02 16:35:191297// Returns the name used in prefs for the choice at the specified index.
1298std::string NameForChoice(const Experiment& e, int index) {
[email protected]2ce9c89752011-02-25 18:24:341299 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
1300 DCHECK_LT(index, e.num_choices);
[email protected]8a6ff28d2010-12-02 16:35:191301 return std::string(e.internal_name) + about_flags::testing::kMultiSeparator +
1302 base::IntToString(index);
1303}
1304
1305// Adds the internal names for the specified experiment to |names|.
1306void AddInternalName(const Experiment& e, std::set<std::string>* names) {
1307 if (e.type == Experiment::SINGLE_VALUE) {
1308 names->insert(e.internal_name);
1309 } else {
[email protected]2ce9c89752011-02-25 18:24:341310 DCHECK_EQ(Experiment::MULTI_VALUE, e.type);
[email protected]8a6ff28d2010-12-02 16:35:191311 for (int i = 0; i < e.num_choices; ++i)
1312 names->insert(NameForChoice(e, i));
1313 }
1314}
1315
[email protected]28e35af2011-02-09 12:56:221316// Confirms that an experiment is valid, used in a DCHECK in
1317// SanitizeList below.
1318bool ValidateExperiment(const Experiment& e) {
1319 switch (e.type) {
1320 case Experiment::SINGLE_VALUE:
1321 DCHECK_EQ(0, e.num_choices);
1322 DCHECK(!e.choices);
1323 break;
1324 case Experiment::MULTI_VALUE:
1325 DCHECK_GT(e.num_choices, 0);
1326 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:531327 DCHECK(e.choices[0].command_line_switch);
1328 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:221329 break;
1330 default:
1331 NOTREACHED();
1332 }
1333 return true;
1334}
1335
[email protected]ad2a3ded2010-08-27 13:19:051336// Removes all experiments from prefs::kEnabledLabsExperiments that are
1337// unknown, to prevent this list to become very long as experiments are added
1338// and removed.
1339void SanitizeList(PrefService* prefs) {
1340 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:221341 for (size_t i = 0; i < num_experiments; ++i) {
1342 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:191343 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:221344 }
[email protected]ad2a3ded2010-08-27 13:19:051345
1346 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241347 GetEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051348
1349 std::set<std::string> new_enabled_experiments;
1350 std::set_intersection(
1351 known_experiments.begin(), known_experiments.end(),
1352 enabled_experiments.begin(), enabled_experiments.end(),
1353 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1354
[email protected]4c8853f2012-07-23 01:29:161355 if (new_enabled_experiments != enabled_experiments)
1356 SetEnabledFlags(prefs, new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051357}
1358
[email protected]1a47d7e2010-10-15 00:37:241359void GetSanitizedEnabledFlags(
[email protected]ad2a3ded2010-08-27 13:19:051360 PrefService* prefs, std::set<std::string>* result) {
1361 SanitizeList(prefs);
[email protected]1a47d7e2010-10-15 00:37:241362 GetEnabledFlags(prefs, result);
[email protected]ad2a3ded2010-08-27 13:19:051363}
1364
[email protected]a314ee5a2010-10-26 21:23:281365// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
1366// enabled on the current platform.
1367void GetSanitizedEnabledFlagsForCurrentPlatform(
1368 PrefService* prefs, std::set<std::string>* result) {
1369 GetSanitizedEnabledFlags(prefs, result);
1370
1371 // Filter out any experiments that aren't enabled on the current platform. We
1372 // don't remove these from prefs else syncing to a platform with a different
1373 // set of experiments would be lossy.
1374 std::set<std::string> platform_experiments;
1375 int current_platform = GetCurrentPlatform();
1376 for (size_t i = 0; i < num_experiments; ++i) {
1377 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:191378 AddInternalName(experiments[i], &platform_experiments);
[email protected]a314ee5a2010-10-26 21:23:281379 }
1380
1381 std::set<std::string> new_enabled_experiments;
1382 std::set_intersection(
1383 platform_experiments.begin(), platform_experiments.end(),
1384 result->begin(), result->end(),
1385 std::inserter(new_enabled_experiments, new_enabled_experiments.begin()));
1386
1387 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051388}
1389
[email protected]8a6ff28d2010-12-02 16:35:191390// Returns the Value representing the choice data in the specified experiment.
[email protected]8a6ff28d2010-12-02 16:35:191391Value* CreateChoiceData(const Experiment& experiment,
[email protected]28e35af2011-02-09 12:56:221392 const std::set<std::string>& enabled_experiments) {
[email protected]2ce9c89752011-02-25 18:24:341393 DCHECK_EQ(Experiment::MULTI_VALUE, experiment.type);
[email protected]8a6ff28d2010-12-02 16:35:191394 ListValue* result = new ListValue;
1395 for (int i = 0; i < experiment.num_choices; ++i) {
1396 const Experiment::Choice& choice = experiment.choices[i];
1397 DictionaryValue* value = new DictionaryValue;
1398 std::string name = NameForChoice(experiment, i);
1399 value->SetString("description",
1400 l10n_util::GetStringUTF16(choice.description_id));
1401 value->SetString("internal_name", name);
[email protected]28e35af2011-02-09 12:56:221402 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:191403 result->Append(value);
1404 }
1405 return result;
1406}
1407
[email protected]e2ddbc92010-10-15 20:02:071408} // namespace
1409
[email protected]1a47d7e2010-10-15 00:37:241410void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) {
[email protected]8e8bb6d2010-12-13 08:18:551411 FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line);
[email protected]ad2a3ded2010-08-27 13:19:051412}
1413
[email protected]1a47d7e2010-10-15 00:37:241414ListValue* GetFlagsExperimentsData(PrefService* prefs) {
[email protected]ad2a3ded2010-08-27 13:19:051415 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241416 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051417
1418 int current_platform = GetCurrentPlatform();
1419
1420 ListValue* experiments_data = new ListValue();
[email protected]a314ee5a2010-10-26 21:23:281421 for (size_t i = 0; i < num_experiments; ++i) {
1422 const Experiment& experiment = experiments[i];
[email protected]ad2a3ded2010-08-27 13:19:051423
1424 DictionaryValue* data = new DictionaryValue();
1425 data->SetString("internal_name", experiment.internal_name);
1426 data->SetString("name",
1427 l10n_util::GetStringUTF16(experiment.visible_name_id));
1428 data->SetString("description",
1429 l10n_util::GetStringUTF16(
1430 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:401431 bool supported = !!(experiment.supported_platforms & current_platform);
1432 data->SetBoolean("supported", supported);
1433
1434 ListValue* supported_platforms = new ListValue();
1435 AddOsStrings(experiment.supported_platforms, supported_platforms);
1436 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:051437
[email protected]28e35af2011-02-09 12:56:221438 switch (experiment.type) {
1439 case Experiment::SINGLE_VALUE:
1440 data->SetBoolean(
1441 "enabled",
1442 enabled_experiments.count(experiment.internal_name) > 0);
1443 break;
1444 case Experiment::MULTI_VALUE:
1445 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
1446 break;
1447 default:
1448 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:191449 }
1450
[email protected]ad2a3ded2010-08-27 13:19:051451 experiments_data->Append(data);
1452 }
1453 return experiments_data;
1454}
1455
[email protected]ad2a3ded2010-08-27 13:19:051456bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:551457 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:051458}
1459
1460void SetExperimentEnabled(
[email protected]c7b7800a2010-10-07 18:51:351461 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]8e8bb6d2010-12-13 08:18:551462 FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:071463}
1464
1465void RemoveFlagsSwitches(
1466 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:551467 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:071468}
1469
[email protected]a314ee5a2010-10-26 21:23:281470int GetCurrentPlatform() {
1471#if defined(OS_MACOSX)
1472 return kOsMac;
1473#elif defined(OS_WIN)
1474 return kOsWin;
1475#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
1476 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:211477#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:281478 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:401479#elif defined(OS_ANDROID)
1480 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:281481#else
1482#error Unknown platform
1483#endif
1484}
1485
[email protected]4bc5050c2010-11-18 17:55:541486void RecordUMAStatistics(const PrefService* prefs) {
1487 std::set<std::string> flags;
1488 GetEnabledFlags(prefs, &flags);
1489 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
1490 ++it) {
1491 std::string action("AboutFlags_");
1492 action += *it;
[email protected]7f6f44c2011-12-14 13:23:381493 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:541494 }
1495 // Since flag metrics are recorded every startup, add a tick so that the
1496 // stats can be made meaningful.
1497 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:381498 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
1499 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:541500}
1501
[email protected]e2ddbc92010-10-15 20:02:071502//////////////////////////////////////////////////////////////////////////////
1503// FlagsState implementation.
1504
1505namespace {
1506
1507void FlagsState::ConvertFlagsToSwitches(
1508 PrefService* prefs, CommandLine* command_line) {
[email protected]e2ddbc92010-10-15 20:02:071509 if (command_line->HasSwitch(switches::kNoExperiments))
1510 return;
1511
1512 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:001513
[email protected]a314ee5a2010-10-26 21:23:281514 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:071515
[email protected]a82744532011-02-11 16:15:531516 typedef std::map<std::string, std::pair<std::string, std::string> >
1517 NameToSwitchAndValueMap;
1518 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:191519 for (size_t i = 0; i < num_experiments; ++i) {
1520 const Experiment& e = experiments[i];
1521 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]a82744532011-02-11 16:15:531522 name_to_switch_map[e.internal_name] =
1523 std::pair<std::string, std::string>(e.command_line_switch,
1524 e.command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191525 } else {
1526 for (int j = 0; j < e.num_choices; ++j)
[email protected]a82744532011-02-11 16:15:531527 name_to_switch_map[NameForChoice(e, j)] =
1528 std::pair<std::string, std::string>(
1529 e.choices[j].command_line_switch,
1530 e.choices[j].command_line_value);
[email protected]8a6ff28d2010-12-02 16:35:191531 }
1532 }
[email protected]e2ddbc92010-10-15 20:02:071533
1534 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
[email protected]a82744532011-02-11 16:15:531535 flags_switches_.insert(
1536 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
1537 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071538 for (std::set<std::string>::iterator it = enabled_experiments.begin();
1539 it != enabled_experiments.end();
1540 ++it) {
1541 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:531542 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:191543 name_to_switch_map.find(experiment_name);
1544 if (name_to_switch_it == name_to_switch_map.end()) {
1545 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:071546 continue;
[email protected]8a6ff28d2010-12-02 16:35:191547 }
[email protected]e2ddbc92010-10-15 20:02:071548
[email protected]a82744532011-02-11 16:15:531549 const std::pair<std::string, std::string>&
1550 switch_and_value_pair = name_to_switch_it->second;
1551
1552 command_line->AppendSwitchASCII(switch_and_value_pair.first,
1553 switch_and_value_pair.second);
1554 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:071555 }
1556 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
[email protected]a82744532011-02-11 16:15:531557 flags_switches_.insert(
1558 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
1559 std::string()));
[email protected]e2ddbc92010-10-15 20:02:071560}
1561
1562bool FlagsState::IsRestartNeededToCommitChanges() {
1563 return needs_restart_;
1564}
1565
1566void FlagsState::SetExperimentEnabled(
1567 PrefService* prefs, const std::string& internal_name, bool enable) {
[email protected]ad2a3ded2010-08-27 13:19:051568 needs_restart_ = true;
1569
[email protected]8a6ff28d2010-12-02 16:35:191570 size_t at_index = internal_name.find(about_flags::testing::kMultiSeparator);
1571 if (at_index != std::string::npos) {
1572 DCHECK(enable);
1573 // We're being asked to enable a multi-choice experiment. Disable the
1574 // currently selected choice.
1575 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:221576 const std::string experiment_name = internal_name.substr(0, at_index);
1577 SetExperimentEnabled(prefs, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:191578
[email protected]28e35af2011-02-09 12:56:221579 // And enable the new choice, if it is not the default first choice.
1580 if (internal_name != experiment_name + "@0") {
1581 std::set<std::string> enabled_experiments;
1582 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
1583 enabled_experiments.insert(internal_name);
1584 SetEnabledFlags(prefs, enabled_experiments);
1585 }
[email protected]8a6ff28d2010-12-02 16:35:191586 return;
1587 }
1588
[email protected]ad2a3ded2010-08-27 13:19:051589 std::set<std::string> enabled_experiments;
[email protected]1a47d7e2010-10-15 00:37:241590 GetSanitizedEnabledFlags(prefs, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051591
[email protected]8a6ff28d2010-12-02 16:35:191592 const Experiment* e = NULL;
1593 for (size_t i = 0; i < num_experiments; ++i) {
1594 if (experiments[i].internal_name == internal_name) {
1595 e = experiments + i;
1596 break;
1597 }
1598 }
1599 DCHECK(e);
1600
1601 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:591602 if (enable)
[email protected]8a6ff28d2010-12-02 16:35:191603 enabled_experiments.insert(internal_name);
[email protected]8a2713682011-08-19 10:36:591604 else
[email protected]8a6ff28d2010-12-02 16:35:191605 enabled_experiments.erase(internal_name);
1606 } else {
1607 if (enable) {
1608 // Enable the first choice.
1609 enabled_experiments.insert(NameForChoice(*e, 0));
1610 } else {
1611 // Find the currently enabled choice and disable it.
1612 for (int i = 0; i < e->num_choices; ++i) {
1613 std::string choice_name = NameForChoice(*e, i);
1614 if (enabled_experiments.find(choice_name) !=
1615 enabled_experiments.end()) {
1616 enabled_experiments.erase(choice_name);
1617 // Continue on just in case there's a bug and more than one
1618 // experiment for this choice was enabled.
1619 }
1620 }
1621 }
1622 }
[email protected]ad2a3ded2010-08-27 13:19:051623
[email protected]1a47d7e2010-10-15 00:37:241624 SetEnabledFlags(prefs, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:051625}
1626
[email protected]e2ddbc92010-10-15 20:02:071627void FlagsState::RemoveFlagsSwitches(
1628 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:531629 for (std::map<std::string, std::string>::const_iterator
1630 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
1631 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:071632 }
1633}
1634
1635void FlagsState::reset() {
1636 needs_restart_ = false;
1637 flags_switches_.clear();
1638}
1639
[email protected]38e46812011-05-09 20:49:221640} // namespace
[email protected]e2ddbc92010-10-15 20:02:071641
1642namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:191643
1644// WARNING: '@' is also used in the html file. If you update this constant you
1645// also need to update the html file.
1646const char kMultiSeparator[] = "@";
1647
[email protected]e2ddbc92010-10-15 20:02:071648void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:551649 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:071650}
[email protected]a314ee5a2010-10-26 21:23:281651
1652void SetExperiments(const Experiment* e, size_t count) {
1653 if (!e) {
1654 experiments = kExperiments;
1655 num_experiments = arraysize(kExperiments);
1656 } else {
1657 experiments = e;
1658 num_experiments = count;
1659 }
1660}
1661
[email protected]8a6ff28d2010-12-02 16:35:191662const Experiment* GetExperiments(size_t* count) {
1663 *count = num_experiments;
1664 return experiments;
1665}
1666
[email protected]e2ddbc92010-10-15 20:02:071667} // namespace testing
1668
[email protected]1a47d7e2010-10-15 00:37:241669} // namespace about_flags