blob: 413ff41cabe28517b13bca46a7ca9aad4974fd86 [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
[email protected]ad2a3ded2010-08-27 13:19:057#include <iterator>
8#include <map>
9#include <set>
[email protected]83e9fa702013-02-25 19:30:4410#include <utility>
[email protected]ad2a3ded2010-08-27 13:19:0511
[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]4b66a7d2014-08-15 17:13:3114#include "base/metrics/sparse_histogram.h"
15#include "base/numerics/safe_conversions.h"
[email protected]09f3fde82014-05-14 15:08:1516#include "base/stl_util.h"
[email protected]3ea1b182013-02-08 22:38:4117#include "base/strings/string_number_conversions.h"
[email protected]4b66a7d2014-08-15 17:13:3118#include "base/strings/string_util.h"
[email protected]135cb802013-06-09 16:44:2019#include "base/strings/utf_string_conversions.h"
[email protected]ad2a3ded2010-08-27 13:19:0520#include "base/values.h"
[email protected]681ccff2013-03-18 06:13:5221#include "cc/base/switches.h"
[email protected]11534552013-12-05 02:09:3022#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
[email protected]e6d1c4f2013-06-12 17:37:4023#include "chrome/browser/flags_storage.h"
[email protected]d208f4d82011-05-23 21:52:0324#include "chrome/common/chrome_content_client.h"
[email protected]ad2a3ded2010-08-27 13:19:0525#include "chrome/common/chrome_switches.h"
[email protected]af39f002014-08-22 10:18:1826#include "chrome/grit/generated_resources.h"
[email protected]58bc1c32013-12-16 22:52:0727#include "components/autofill/core/common/autofill_switches.h"
[email protected]4e6c96e2014-05-17 18:41:1928#include "components/cloud_devices/common/cloud_devices_switches.h"
[email protected]4b66a7d2014-08-15 17:13:3129#include "components/metrics/metrics_hashes.h"
[email protected]cbb22eb2013-06-24 23:53:1030#include "components/nacl/common/nacl_switches.h"
[email protected]720b10492014-07-23 08:48:4031#include "components/search/search_switches.h"
[email protected]7f6f44c2011-12-14 13:23:3832#include "content/public/browser/user_metrics.h"
[email protected]e2e8e322012-09-12 04:37:0233#include "media/base/media_switches.h"
[email protected]c051a1b2011-01-21 23:30:1734#include "ui/base/l10n/l10n_util.h"
[email protected]c9c73ad42012-04-18 03:35:5935#include "ui/base/ui_base_switches.h"
[email protected]bf3f4592014-03-31 19:50:4436#include "ui/display/display_switches.h"
[email protected]a6147a22013-09-26 06:55:0937#include "ui/events/event_switches.h"
[email protected]0d3b9dd2012-11-14 04:14:4838#include "ui/gfx/switches.h"
[email protected]c9e2cbbb2012-05-12 21:17:2739#include "ui/gl/gl_switches.h"
[email protected]86459e2c2013-04-10 13:39:2440#include "ui/keyboard/keyboard_switches.h"
[email protected]e3d512a72014-03-18 20:50:4741#include "ui/native_theme/native_theme_switches.h"
[email protected]c4f51d22013-11-05 03:11:2642#include "ui/views/views_switches.h"
[email protected]9a224572013-05-12 23:08:5643
[email protected]3dfb4012014-06-11 07:33:3844#if defined(OS_ANDROID)
45#include "chrome/common/chrome_version_info.h"
46#include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h"
[email protected]4c583b62014-08-08 10:37:2347#include "components/omnibox/omnibox_switches.h"
juyika7be5192014-08-26 23:01:0448#else
49#include "ui/message_center/message_center_switches.h"
[email protected]3dfb4012014-06-11 07:33:3850#endif
51
[email protected]dc04be7c2012-03-15 23:57:4952#if defined(USE_ASH)
[email protected]b65bdda2011-12-23 23:35:3153#include "ash/ash_switches.h"
[email protected]dc04be7c2012-03-15 23:57:4954#endif
55
[email protected]badba1ad2012-11-16 17:21:4656#if defined(OS_CHROMEOS)
57#include "chromeos/chromeos_switches.h"
[email protected]6d98abf2013-06-17 23:35:5158#include "third_party/cros_system_api/switches/chrome_switches.h"
[email protected]badba1ad2012-11-16 17:21:4659#endif
60
[email protected]fe2b77f62013-11-09 04:30:5161#if defined(ENABLE_APP_LIST)
62#include "ui/app_list/app_list_switches.h"
63#endif
64
thestigb012bc3d2014-09-18 22:57:1365#if defined(ENABLE_EXTENSIONS)
66#include "extensions/common/switches.h"
67#endif
68
[email protected]e6e30ac2014-01-13 21:24:3969using base::UserMetricsAction;
[email protected]7f6f44c2011-12-14 13:23:3870
[email protected]1a47d7e2010-10-15 00:37:2471namespace about_flags {
[email protected]ad2a3ded2010-08-27 13:19:0572
alemate0107c3272014-09-03 04:30:0473const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
[email protected]4b66a7d2014-08-15 17:13:3174
[email protected]8a6ff28d2010-12-02 16:35:1975// Macros to simplify specifying the type.
[email protected]a82744532011-02-11 16:15:5376#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
[email protected]83e9fa702013-02-25 19:30:4477 Experiment::SINGLE_VALUE, \
78 command_line_switch, switch_value, NULL, NULL, NULL, 0
[email protected]a82744532011-02-11 16:15:5379#define SINGLE_VALUE_TYPE(command_line_switch) \
80 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
[email protected]83e9fa702013-02-25 19:30:4481#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
82 disable_switch, disable_value) \
83 Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \
84 disable_switch, disable_value, NULL, 3
85#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
86 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
[email protected]a82744532011-02-11 16:15:5387#define MULTI_VALUE_TYPE(choices) \
[email protected]83e9fa702013-02-25 19:30:4488 Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices)
[email protected]8a6ff28d2010-12-02 16:35:1989
[email protected]e2ddbc92010-10-15 20:02:0790namespace {
91
[email protected]9c7453d2012-01-21 00:45:4092const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
[email protected]f3cd6802013-01-23 20:25:5693const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
[email protected]ad2a3ded2010-08-27 13:19:0594
[email protected]cc3e2052011-12-20 01:01:4095// Adds a |StringValue| to |list| for each platform where |bitmask| indicates
96// whether the experiment is available on that platform.
[email protected]5bcdd99d2013-12-23 18:28:3097void AddOsStrings(unsigned bitmask, base::ListValue* list) {
[email protected]cc3e2052011-12-20 01:01:4098 struct {
99 unsigned bit;
100 const char* const name;
101 } kBitsToOs[] = {
102 {kOsMac, "Mac"},
103 {kOsWin, "Windows"},
104 {kOsLinux, "Linux"},
105 {kOsCrOS, "Chrome OS"},
[email protected]4052d832013-01-16 05:31:01106 {kOsAndroid, "Android"},
[email protected]37736bd2013-04-18 11:53:58107 {kOsCrOSOwnerOnly, "Chrome OS (owner only)"},
[email protected]cc3e2052011-12-20 01:01:40108 };
109 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i)
110 if (bitmask & kBitsToOs[i].bit)
[email protected]5bcdd99d2013-12-23 18:28:30111 list->Append(new base::StringValue(kBitsToOs[i].name));
[email protected]cc3e2052011-12-20 01:01:40112}
113
[email protected]6d98abf2013-06-17 23:35:51114// Convert switch constants to proper CommandLine::StringType strings.
115CommandLine::StringType GetSwitchString(const std::string& flag) {
116 CommandLine cmd_line(CommandLine::NO_PROGRAM);
117 cmd_line.AppendSwitch(flag);
[email protected]4ac579b2014-05-20 06:43:23118 DCHECK_EQ(2U, cmd_line.argv().size());
[email protected]6d98abf2013-06-17 23:35:51119 return cmd_line.argv()[1];
120}
121
122// Scoops flags from a command line.
123std::set<CommandLine::StringType> ExtractFlagsFromCommandLine(
124 const CommandLine& cmdline) {
125 std::set<CommandLine::StringType> flags;
126 // First do the ones between --flag-switches-begin and --flag-switches-end.
127 CommandLine::StringVector::const_iterator first =
128 std::find(cmdline.argv().begin(), cmdline.argv().end(),
129 GetSwitchString(switches::kFlagSwitchesBegin));
130 CommandLine::StringVector::const_iterator last =
131 std::find(cmdline.argv().begin(), cmdline.argv().end(),
132 GetSwitchString(switches::kFlagSwitchesEnd));
133 if (first != cmdline.argv().end() && last != cmdline.argv().end())
134 flags.insert(first + 1, last);
135#if defined(OS_CHROMEOS)
136 // Then add those between --policy-switches-begin and --policy-switches-end.
137 first = std::find(cmdline.argv().begin(), cmdline.argv().end(),
138 GetSwitchString(chromeos::switches::kPolicySwitchesBegin));
139 last = std::find(cmdline.argv().begin(), cmdline.argv().end(),
140 GetSwitchString(chromeos::switches::kPolicySwitchesEnd));
141 if (first != cmdline.argv().end() && last != cmdline.argv().end())
142 flags.insert(first + 1, last);
143#endif
144 return flags;
145}
146
piotaixrbc9cd5f2014-08-26 22:24:14147const Experiment::Choice kEnableDisplayList2DcanvasChoices[] = {
148 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
149 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
150 switches::kEnableDisplayList2dCanvas, ""},
151 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
152 switches::kDisableDisplayList2dCanvas, ""},
153};
154
[email protected]d8221b22013-05-23 05:35:43155const Experiment::Choice kEnableCompositingForTransitionChoices[] = {
156 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
157 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
158 switches::kEnableCompositingForTransition, ""},
159 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
160 switches::kDisableCompositingForTransition, ""},
161};
162
[email protected]d7932532012-11-21 21:10:31163const Experiment::Choice kTouchEventsChoices[] = {
164 { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" },
165 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
166 switches::kTouchEvents,
167 switches::kTouchEventsEnabled },
168 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
169 switches::kTouchEvents,
170 switches::kTouchEventsDisabled }
171};
172
[email protected]c38e9802014-02-18 21:32:12173#if defined(USE_AURA)
174const Experiment::Choice kOverscrollHistoryNavigationChoices[] = {
175 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, "", "" },
176 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
177 switches::kOverscrollHistoryNavigation,
178 "0" },
179 { IDS_OVERSCROLL_HISTORY_NAVIGATION_SIMPLE_UI,
180 switches::kOverscrollHistoryNavigation,
181 "2" }
182};
183#endif
184
[email protected]d33d2222014-06-04 15:39:58185#if !defined(DISABLE_NACL)
[email protected]66f409c2012-10-04 20:59:04186const Experiment::Choice kNaClDebugMaskChoices[] = {
[email protected]66f409c2012-10-04 20:59:04187 // Secure shell can be used on ChromeOS for forwarding the TCP port opened by
[email protected]402bed6e2014-03-07 08:33:09188 // debug stub to a remote machine. Since secure shell uses NaCl, we usually
189 // want to avoid debugging that. The PNaCl translator is also a NaCl module,
190 // so by default we want to avoid debugging that.
191 // NOTE: As the default value must be the empty string, the mask excluding
192 // the PNaCl translator and secure shell is substituted elsewhere.
193 { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS_PNACL, "", "" },
194 { IDS_NACL_DEBUG_MASK_CHOICE_DEBUG_ALL, switches::kNaClDebugMask, "*://*" },
[email protected]66f409c2012-10-04 20:59:04195 { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG,
196 switches::kNaClDebugMask, "*://*/*debug.nmf" }
197};
[email protected]d33d2222014-06-04 15:39:58198#endif
[email protected]66f409c2012-10-04 20:59:04199
[email protected]9323fdd12013-02-23 00:31:36200const Experiment::Choice kImplSidePaintingChoices[] = {
201 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
202 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]a23530d2014-03-11 06:04:14203 switches::kEnableImplSidePainting, ""},
[email protected]9323fdd12013-02-23 00:31:36204 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]a23530d2014-03-11 06:04:14205 switches::kDisableImplSidePainting, ""}
[email protected]9323fdd12013-02-23 00:31:36206};
207
[email protected]7621af22013-09-12 23:06:33208const Experiment::Choice kLCDTextChoices[] = {
209 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]a23530d2014-03-11 06:04:14210 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, switches::kEnableLCDText, ""},
211 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kDisableLCDText, ""}
[email protected]7621af22013-09-12 23:06:33212};
213
[email protected]b242b142014-05-07 14:48:49214const Experiment::Choice kDistanceFieldTextChoices[] = {
215 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
216 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
217 switches::kEnableDistanceFieldText, "" },
218 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
219 switches::kDisableDistanceFieldText, "" }
220};
221
[email protected]758efb02014-04-05 07:53:45222#ifndef USE_AURA
[email protected]0c04d1c2013-07-10 00:02:32223const Experiment::Choice kDelegatedRendererChoices[] = {
224 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
225 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
226 switches::kEnableDelegatedRenderer, ""},
227 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
228 switches::kDisableDelegatedRenderer, ""}
229};
[email protected]758efb02014-04-05 07:53:45230#endif
[email protected]0c04d1c2013-07-10 00:02:32231
[email protected]a42c85f2013-04-04 18:15:12232const Experiment::Choice kMaxTilesForInterestAreaChoices[] = {
233 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
234 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT,
235 cc::switches::kMaxTilesForInterestArea, "64"},
236 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL,
237 cc::switches::kMaxTilesForInterestArea, "128"},
238 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE,
239 cc::switches::kMaxTilesForInterestArea, "256"},
240 { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI,
241 cc::switches::kMaxTilesForInterestArea, "512"}
242};
243
[email protected]a3618122013-04-26 21:15:34244const Experiment::Choice kDefaultTileWidthChoices[] = {
245 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
246 { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT,
247 switches::kDefaultTileWidth, "128"},
248 { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL,
249 switches::kDefaultTileWidth, "256"},
250 { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE,
251 switches::kDefaultTileWidth, "512"},
252 { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI,
253 switches::kDefaultTileWidth, "1024"}
254};
255
256const Experiment::Choice kDefaultTileHeightChoices[] = {
257 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
258 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT,
259 switches::kDefaultTileHeight, "128"},
260 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL,
261 switches::kDefaultTileHeight, "256"},
262 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE,
263 switches::kDefaultTileHeight, "512"},
264 { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI,
265 switches::kDefaultTileHeight, "1024"}
266};
267
[email protected]38484df12013-04-10 16:42:03268const Experiment::Choice kSimpleCacheBackendChoices[] = {
[email protected]9a3de3e32013-04-23 19:05:21269 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
270 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
271 switches::kUseSimpleCacheBackend, "off" },
[email protected]38484df12013-04-10 16:42:03272 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
273 switches::kUseSimpleCacheBackend, "on"}
274};
275
[email protected]9afc14e22013-09-25 22:34:14276#if defined(USE_AURA)
[email protected]910ecfe2013-06-03 23:38:14277const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = {
278 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
279 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
280 switches::kTabCaptureUpscaleQuality, "fast" },
281 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
282 switches::kTabCaptureUpscaleQuality, "good" },
283 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
284 switches::kTabCaptureUpscaleQuality, "best" },
285};
286
287const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = {
288 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
289 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST,
290 switches::kTabCaptureDownscaleQuality, "fast" },
291 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD,
292 switches::kTabCaptureDownscaleQuality, "good" },
293 { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST,
294 switches::kTabCaptureDownscaleQuality, "best" },
295};
[email protected]9afc14e22013-09-25 22:34:14296#endif
[email protected]910ecfe2013-06-03 23:38:14297
[email protected]54c8d282014-01-24 17:31:08298#if defined(USE_AURA) || defined(OS_LINUX)
299const Experiment::Choice kOverlayScrollbarChoices[] = {
300 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
301 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
302 switches::kEnableOverlayScrollbar, ""},
303 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
304 switches::kDisableOverlayScrollbar, ""}
305};
306#endif
307
[email protected]2cccfef2014-05-01 06:05:16308const Experiment::Choice kZeroCopyChoices[] = {
[email protected]be2e40a2013-08-27 02:49:20309 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
310 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
[email protected]2cccfef2014-05-01 06:05:16311 switches::kEnableZeroCopy, ""},
[email protected]be2e40a2013-08-27 02:49:20312 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
[email protected]2cccfef2014-05-01 06:05:16313 switches::kDisableZeroCopy, ""}
[email protected]be2e40a2013-08-27 02:49:20314};
315
[email protected]d5874f12013-12-05 04:30:00316#if defined(OS_ANDROID)
317const Experiment::Choice kZeroSuggestExperimentsChoices[] = {
318 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
319 { IDS_FLAGS_ZERO_SUGGEST_MOST_VISITED,
320 switches::kEnableZeroSuggestMostVisited, ""},
321 { IDS_FLAGS_ZERO_SUGGEST_ETHER_SERP,
322 switches::kEnableZeroSuggestEtherSerp, ""},
323 { IDS_FLAGS_ZERO_SUGGEST_ETHER_NO_SERP,
324 switches::kEnableZeroSuggestEtherNoSerp, ""},
[email protected]162c8d9fa2014-03-18 20:25:41325 { IDS_FLAGS_ZERO_SUGGEST_PERSONALIZED,
326 switches::kEnableZeroSuggestPersonalized, ""},
[email protected]d5874f12013-12-05 04:30:00327 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
328 switches::kDisableZeroSuggest, ""}
329};
330#endif
331
[email protected]1a82f7372013-12-06 12:46:52332const Experiment::Choice kNumRasterThreadsChoices[] = {
333 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
[email protected]00d92d32014-01-23 09:46:50334 { IDS_FLAGS_NUM_RASTER_THREADS_ONE, switches::kNumRasterThreads, "1" },
335 { IDS_FLAGS_NUM_RASTER_THREADS_TWO, switches::kNumRasterThreads, "2" },
336 { IDS_FLAGS_NUM_RASTER_THREADS_THREE, switches::kNumRasterThreads, "3" },
337 { IDS_FLAGS_NUM_RASTER_THREADS_FOUR, switches::kNumRasterThreads, "4" }
[email protected]1a82f7372013-12-06 12:46:52338};
339
[email protected]a23530d2014-03-11 06:04:14340const Experiment::Choice kEnableGpuRasterizationChoices[] = {
341 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
342 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
343 switches::kEnableGpuRasterization, "" },
344 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
345 switches::kDisableGpuRasterization, "" },
346 { IDS_FLAGS_FORCE_GPU_RASTERIZATION,
347 switches::kForceGpuRasterization, "" },
348};
349
[email protected]dc920d62013-12-13 22:12:47350// We're using independent flags here (as opposed to a common flag with
351// different values) to be able to enable/disable the entire experience
352// associated with this feature server-side from the FieldTrial (the complete
353// experience includes other flag changes as well). It is not currently possible
354// to do that with "flag=value" flags.
355const Experiment::Choice kSearchButtonInOmniboxChoices[] = {
356 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
357 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
358 switches::kDisableSearchButtonInOmnibox, ""},
359 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR,
360 switches::kEnableSearchButtonInOmniboxForStr, ""},
361 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLE_FOR_STR_OR_IIP,
362 switches::kEnableSearchButtonInOmniboxForStrOrIip, ""},
363 { IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_ENABLED,
364 switches::kEnableSearchButtonInOmniboxAlways, ""}
365};
366
[email protected]78dd09e2014-01-12 02:41:46367// See comment above for kSearchButtonInOmniboxChoices. The same reasoning
368// applies here.
369const Experiment::Choice kOriginChipChoices[] = {
370 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
371 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kDisableOriginChip, ""},
[email protected]5d58f952014-05-20 21:12:47372 { IDS_FLAGS_ORIGIN_CHIP_ALWAYS, switches::kEnableOriginChipAlways, ""},
373 { IDS_FLAGS_ORIGIN_CHIP_ON_SRP, switches::kEnableOriginChipOnSrp, ""}
[email protected]7a54bf4b2014-02-06 19:21:54374};
[email protected]78dd09e2014-01-12 02:41:46375
[email protected]f42cffb2014-03-08 18:03:25376const Experiment::Choice kTouchScrollingModeChoices[] = {
377 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
378 { IDS_FLAGS_TOUCH_SCROLLING_MODE_TOUCHCANCEL,
379 switches::kTouchScrollingMode,
380 switches::kTouchScrollingModeTouchcancel },
[email protected]372f52e2014-04-28 16:15:49381 { IDS_FLAGS_TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE,
[email protected]f42cffb2014-03-08 18:03:25382 switches::kTouchScrollingMode,
[email protected]372f52e2014-04-28 16:15:49383 switches::kTouchScrollingModeAsyncTouchmove },
[email protected]f42cffb2014-03-08 18:03:25384 { IDS_FLAGS_TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE,
385 switches::kTouchScrollingMode,
386 switches::kTouchScrollingModeSyncTouchmove },
387};
388
[email protected]4734b902014-04-03 16:42:10389#if defined(ENABLE_APP_LIST)
390const Experiment::Choice kEnableSyncAppListChoices[] = {
391 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
392 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
393 app_list::switches::kEnableSyncAppList, "" },
394 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
395 app_list::switches::kDisableSyncAppList, "" },
396};
397#endif
398
[email protected]6f8ede32014-05-09 13:58:45399const Experiment::Choice kExtensionContentVerificationChoices[] = {
400 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
401 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_BOOTSTRAP,
[email protected]8bb62162014-06-23 09:45:50402 switches::kExtensionContentVerification,
403 switches::kExtensionContentVerificationBootstrap },
[email protected]6f8ede32014-05-09 13:58:45404 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE,
[email protected]8bb62162014-06-23 09:45:50405 switches::kExtensionContentVerification,
406 switches::kExtensionContentVerificationEnforce },
[email protected]6f8ede32014-05-09 13:58:45407 { IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_ENFORCE_STRICT,
[email protected]8bb62162014-06-23 09:45:50408 switches::kExtensionContentVerification,
409 switches::kExtensionContentVerificationEnforceStrict },
[email protected]6f8ede32014-05-09 13:58:45410};
411
[email protected]85f710c2014-06-20 17:29:11412#if defined(OS_ANDROID)
413const Experiment::Choice kAnswersInSuggestChoices[] = {
414 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
415 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
416 switches::kEnableAnswersInSuggest, ""},
417 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
418 switches::kDisableAnswersInSuggest, ""}
419};
420#endif
421
[email protected]aae79572014-06-13 00:42:58422const Experiment::Choice kEnableSettingsWindowChoices[] = {
423 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
424 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
425 ::switches::kEnableSettingsWindow, "" },
426 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
427 ::switches::kDisableSettingsWindow, "" },
428};
429
[email protected]c5bbe0e2014-08-01 23:23:30430// Note that the value is specified in seconds (where 0 is equivalent to
431// disabled).
432const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = {
433 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
434 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
435 switches::kRememberCertErrorDecisions,
436 "-1" },
437 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY,
438 switches::kRememberCertErrorDecisions,
439 "86400" },
440 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS,
441 switches::kRememberCertErrorDecisions,
442 "259200" },
443 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK,
444 switches::kRememberCertErrorDecisions,
445 "604800" },
446 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH,
447 switches::kRememberCertErrorDecisions,
448 "2592000" },
449 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS,
450 switches::kRememberCertErrorDecisions,
451 "7776000" },
452};
453
[email protected]bdbf5cb2014-08-07 23:38:08454const Experiment::Choice kEnableDropSyncCredentialChoices[] = {
455 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
456 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
457 password_manager::switches::kEnableDropSyncCredential, "" },
458 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
459 password_manager::switches::kDisableDropSyncCredential, "" },
460};
461
[email protected]469ea5c2014-08-12 20:00:56462#if defined(OS_MACOSX)
463const Experiment::Choice kEnableAVFoundationChoices[] = {
464 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
465 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, switches::kEnableAVFoundation, ""},
466 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, switches::kForceQTKit, ""}
467};
468#endif
469
[email protected]524dd702014-08-16 00:00:45470const Experiment::Choice kAutofillSyncCredentialChoices[] = {
471 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
472 { IDS_ALLOW_AUTOFILL_SYNC_CREDENTIAL,
473 password_manager::switches::kAllowAutofillSyncCredential, ""},
474 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL_FOR_REAUTH,
475 password_manager::switches::kDisallowAutofillSyncCredentialForReauth, ""},
476 { IDS_DISALLOW_AUTOFILL_SYNC_CREDENTIAL,
477 password_manager::switches::kDisallowAutofillSyncCredential, ""},
478};
479
[email protected]4bc5050c2010-11-18 17:55:54480// RECORDING USER METRICS FOR FLAGS:
481// -----------------------------------------------------------------------------
482// The first line of the experiment is the internal name. If you'd like to
483// gather statistics about the usage of your flag, you should append a marker
484// comment to the end of the feature name, like so:
485// "my-special-feature", // FLAGS:RECORD_UMA
486//
[email protected]d8320fb62014-03-22 03:16:37487// After doing that, run
488// tools/metrics/actions/extract_actions.py
489// to add the metric to actions.xml (which will enable UMA to record your
490// feature flag), then update the <owner>s and <description> sections. Make sure
491// to include the actions.xml file when you upload your code for review!
[email protected]4bc5050c2010-11-18 17:55:54492//
[email protected]783d5bb2012-10-24 03:47:14493// After your feature has shipped under a flag, you can locate the metrics under
494// the action name AboutFlags_internal-action-name. Actions are recorded once
495// per startup, so you should divide this number by AboutFlags_StartupTick to
496// get a sense of usage. Note that this will not be the same as number of users
497// with a given feature enabled because users can quit and relaunch the
498// application multiple times over a given time interval. The dashboard also
499// shows you how many (metrics reporting) users have enabled the flag over the
500// last seven days. However, note that this is not the same as the number of
501// users who have the flag enabled, since enabling the flag happens once,
502// whereas running with the flag enabled happens until the user flips the flag
503// again.
[email protected]4bc5050c2010-11-18 17:55:54504
[email protected]8a6ff28d2010-12-02 16:35:19505// To add a new experiment add to the end of kExperiments. There are two
506// distinct types of experiments:
507// . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE
508// macro for this type supplying the command line to the macro.
[email protected]28e35af2011-02-09 12:56:22509// . MULTI_VALUE: a list of choices, the first of which should correspond to a
510// deactivated state for this lab (i.e. no command line option). To specify
511// this type of experiment use the macro MULTI_VALUE_TYPE supplying it the
512// array of choices.
[email protected]8a6ff28d2010-12-02 16:35:19513// See the documentation of Experiment for details on the fields.
514//
[email protected]4b66a7d2014-08-15 17:13:31515// Command-line switches must have entries in enum "LoginCustomFlags" in
516// histograms.xml. See note in histograms.xml and don't forget to run
517// AboutFlagsHistogramTest unit test to calculate and verify checksum.
518//
[email protected]8a6ff28d2010-12-02 16:35:19519// When adding a new choice, add it to the end of the list.
[email protected]ad2a3ded2010-08-27 13:19:05520const Experiment kExperiments[] = {
521 {
[email protected]96c6f4c2011-05-18 19:36:22522 "ignore-gpu-blacklist",
523 IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME,
524 IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION,
525 kOsAll,
526 SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
527 },
528 {
[email protected]85603362014-04-21 16:18:14529 "disable_layer_squashing",
530 IDS_FLAGS_DISABLE_LAYER_SQUASHING_NAME,
531 IDS_FLAGS_DISABLE_LAYER_SQUASHING_DESCRIPTION,
532 kOsAll,
533 SINGLE_VALUE_TYPE(switches::kDisableLayerSquashing)
534 },
[email protected]5b7033fc2013-12-07 22:32:07535#if defined(OS_WIN)
536 {
[email protected]5b263b6a2014-06-09 21:47:34537 "disable-direct-write",
538 IDS_FLAGS_DISABLE_DIRECT_WRITE_NAME,
539 IDS_FLAGS_DISABLE_DIRECT_WRITE_DESCRIPTION,
[email protected]5b7033fc2013-12-07 22:32:07540 kOsWin,
[email protected]5b263b6a2014-06-09 21:47:34541 SINGLE_VALUE_TYPE(switches::kDisableDirectWrite)
[email protected]5b7033fc2013-12-07 22:32:07542 },
543#endif
[email protected]8b1c3c72013-01-25 01:48:43544 {
[email protected]2b608752013-05-01 03:34:36545 "enable-experimental-canvas-features",
546 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME,
547 IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION,
548 kOsAll,
549 SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures)
550 },
551 {
[email protected]81c64af62012-06-06 20:15:52552 "disable-accelerated-2d-canvas",
553 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME,
554 IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION,
555 kOsAll,
556 SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas)
557 },
558 {
[email protected]72d37352014-07-24 02:34:41559 "enable-display-list-2d-canvas",
560 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_NAME,
561 IDS_FLAGS_ENABLE_DISPLAY_LIST_2D_CANVAS_DESCRIPTION,
562 kOsAll,
piotaixrbc9cd5f2014-08-26 22:24:14563 MULTI_VALUE_TYPE(kEnableDisplayList2DcanvasChoices)
[email protected]72d37352014-07-24 02:34:41564 },
565 {
[email protected]5963b772011-02-09 22:55:38566 "composited-layer-borders",
567 IDS_FLAGS_COMPOSITED_LAYER_BORDERS,
568 IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION,
569 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57570 SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders)
[email protected]5963b772011-02-09 22:55:38571 },
572 {
[email protected]a8f1eaa2011-03-07 19:00:58573 "show-fps-counter",
574 IDS_FLAGS_SHOW_FPS_COUNTER,
575 IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION,
576 kOsAll,
[email protected]4d5e6762013-03-19 18:46:57577 SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter)
[email protected]a8f1eaa2011-03-07 19:00:58578 },
[email protected]8ff7f342011-05-25 01:49:47579 {
[email protected]deaba6d52011-09-23 14:47:12580 "disable-webgl",
581 IDS_FLAGS_DISABLE_WEBGL_NAME,
582 IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,
[email protected]6c7784e2013-08-01 22:41:28583 kOsAll,
[email protected]deaba6d52011-09-23 14:47:12584 SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL)
585 },
[email protected]09096e02012-05-24 11:12:04586 {
[email protected]ce585bf2013-03-14 16:25:16587 "disable-webrtc",
588 IDS_FLAGS_DISABLE_WEBRTC_NAME,
589 IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION,
[email protected]d9da9582013-01-31 04:59:05590 kOsAndroid,
591#if defined(OS_ANDROID)
[email protected]ce585bf2013-03-14 16:25:16592 SINGLE_VALUE_TYPE(switches::kDisableWebRTC)
[email protected]d9da9582013-01-31 04:59:05593#else
594 SINGLE_VALUE_TYPE("")
595#endif
596 },
[email protected]5e2bc8c2013-05-28 22:59:57597#if defined(ENABLE_WEBRTC)
[email protected]d816ddc2013-05-23 14:28:30598 {
[email protected]fdf631e2013-09-13 09:06:07599 "disable-webrtc-hw-decoding",
600 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_NAME,
601 IDS_FLAGS_DISABLE_WEBRTC_HW_DECODING_DESCRIPTION,
[email protected]6442b022013-12-05 11:09:05602 kOsAndroid | kOsCrOS,
[email protected]fdf631e2013-09-13 09:06:07603 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)
604 },
605 {
[email protected]96cbf422013-09-11 12:42:22606 "disable-webrtc-hw-encoding",
607 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_NAME,
608 IDS_FLAGS_DISABLE_WEBRTC_HW_ENCODING_DESCRIPTION,
[email protected]6998f01f22013-12-04 09:27:57609 kOsAndroid | kOsCrOS,
[email protected]96cbf422013-09-11 12:42:22610 SINGLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)
611 },
[email protected]5e2bc8c2013-05-28 22:59:57612#endif
[email protected]34cb5292013-04-15 06:06:31613#if defined(OS_ANDROID)
614 {
[email protected]7b8a31632013-06-13 22:42:37615 "disable-webaudio",
616 IDS_FLAGS_DISABLE_WEBAUDIO_NAME,
617 IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION,
[email protected]34cb5292013-04-15 06:06:31618 kOsAndroid,
[email protected]7b8a31632013-06-13 22:42:37619 SINGLE_VALUE_TYPE(switches::kDisableWebAudio)
[email protected]34cb5292013-04-15 06:06:31620 },
621#endif
[email protected]d9da9582013-01-31 04:59:05622 {
[email protected]d8221b22013-05-23 05:35:43623 "enable-compositing-for-transition",
624 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME,
625 IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION,
626 kOsAll,
627 MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices)
628 },
[email protected]d33d2222014-06-04 15:39:58629 // Native client is compiled out when DISABLE_NACL is defined.
630#if !defined(DISABLE_NACL)
[email protected]2fe15fcb2010-10-21 20:39:53631 {
[email protected]e3791ce92011-08-09 01:03:32632 "enable-nacl", // FLAGS:RECORD_UMA
[email protected]4ff87d202010-11-06 01:28:40633 IDS_FLAGS_ENABLE_NACL_NAME,
634 IDS_FLAGS_ENABLE_NACL_DESCRIPTION,
[email protected]d33d2222014-06-04 15:39:58635 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19636 SINGLE_VALUE_TYPE(switches::kEnableNaCl)
[email protected]4ff87d202010-11-06 01:28:40637 },
638 {
[email protected]9addd1c2012-09-15 14:28:24639 "enable-nacl-debug", // FLAGS:RECORD_UMA
640 IDS_FLAGS_ENABLE_NACL_DEBUG_NAME,
641 IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56642 kOsDesktop,
[email protected]9addd1c2012-09-15 14:28:24643 SINGLE_VALUE_TYPE(switches::kEnableNaClDebug)
[email protected]401b90792012-05-30 11:41:13644 },
645 {
[email protected]66f409c2012-10-04 20:59:04646 "nacl-debug-mask", // FLAGS:RECORD_UMA
647 IDS_FLAGS_NACL_DEBUG_MASK_NAME,
648 IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56649 kOsDesktop,
[email protected]66f409c2012-10-04 20:59:04650 MULTI_VALUE_TYPE(kNaClDebugMaskChoices)
651 },
[email protected]d33d2222014-06-04 15:39:58652#endif
thestigb012bc3d2014-09-18 22:57:13653#if defined(ENABLE_EXTENSIONS)
[email protected]66f409c2012-10-04 20:59:04654 {
[email protected]4bc5050c2010-11-18 17:55:54655 "extension-apis", // FLAGS:RECORD_UMA
[email protected]11dd68cd52010-11-12 01:15:32656 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME,
657 IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56658 kOsDesktop,
[email protected]c8d02992013-07-31 22:16:51659 SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis)
[email protected]11dd68cd52010-11-12 01:15:32660 },
[email protected]3627b06d2010-11-12 16:36:16661 {
[email protected]ac2e2acd2013-03-21 12:57:29662 "extensions-on-chrome-urls",
663 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME,
664 IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION,
665 kOsAll,
[email protected]49d9b142013-07-19 08:50:27666 SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs)
[email protected]ac2e2acd2013-03-21 12:57:29667 },
thestigb012bc3d2014-09-18 22:57:13668#endif
[email protected]ac2e2acd2013-03-21 12:57:29669 {
[email protected]88c92012013-07-02 11:56:34670 "enable-fast-unload",
671 IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME,
672 IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION,
673 kOsAll,
674 SINGLE_VALUE_TYPE(switches::kEnableFastUnload)
675 },
thestigb012bc3d2014-09-18 22:57:13676#if defined(ENABLE_EXTENSIONS)
[email protected]88c92012013-07-02 11:56:34677 {
[email protected]1f4da9e2013-06-27 05:23:44678 "enable-app-window-controls",
679 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME,
680 IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION,
681 kOsDesktop,
hashimotof784afd2014-09-05 02:38:31682 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppWindowControls)
[email protected]1f4da9e2013-06-27 05:23:44683 },
thestigb012bc3d2014-09-18 22:57:13684#endif
[email protected]1f4da9e2013-06-27 05:23:44685 {
[email protected]80bd24e2010-11-30 09:34:38686 "disable-hyperlink-auditing",
687 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME,
688 IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION,
689 kOsAll,
[email protected]8a6ff28d2010-12-02 16:35:19690 SINGLE_VALUE_TYPE(switches::kNoPings)
[email protected]feb28fef2010-12-01 10:52:51691 },
[email protected]333bdc52013-07-16 00:37:04692#if defined(OS_ANDROID)
693 {
[email protected]26d1b4d2014-02-08 02:42:17694 "contextual-search",
695 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH,
696 IDS_FLAGS_ENABLE_CONTEXTUAL_SEARCH_DESCRIPTION,
697 kOsAndroid,
[email protected]41d32bb2014-05-30 08:26:05698 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableContextualSearch,
699 switches::kDisableContextualSearch)
[email protected]26d1b4d2014-02-08 02:42:17700 },
[email protected]333bdc52013-07-16 00:37:04701#endif
[email protected]8cc9e532013-05-06 21:01:47702 {
[email protected]3eb5728c2011-06-20 22:32:24703 "show-autofill-type-predictions",
704 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME,
705 IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION,
706 kOsAll,
[email protected]e217c5632013-04-12 19:11:48707 SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions)
[email protected]3eb5728c2011-06-20 22:32:24708 },
[email protected]bff4d3e2011-06-21 23:58:52709 {
[email protected]a22ebd812011-06-23 00:05:39710 "enable-smooth-scrolling", // FLAGS:RECORD_UMA
711 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME,
712 IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION,
713 // Can't expose the switch unless the code is compiled in.
[email protected]554b7062011-09-03 03:09:40714 // On by default for the Mac (different implementation in WebKit).
[email protected]a5a5aaf2013-12-19 02:10:10715 kOsLinux,
[email protected]a22ebd812011-06-23 00:05:39716 SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling)
717 },
[email protected]54c8d282014-01-24 17:31:08718#if defined(USE_AURA) || defined(OS_LINUX)
[email protected]81a6b0b2011-06-24 17:55:40719 {
[email protected]54c8d282014-01-24 17:31:08720 "overlay-scrollbars",
[email protected]23eecbd02013-09-19 18:13:37721 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_NAME,
722 IDS_FLAGS_ENABLE_OVERLAY_SCROLLBARS_DESCRIPTION,
723 // Uses the system preference on Mac (a different implementation).
724 // On Android, this is always enabled.
[email protected]54c8d282014-01-24 17:31:08725 kOsLinux | kOsCrOS | kOsWin,
726 MULTI_VALUE_TYPE(kOverlayScrollbarChoices)
[email protected]23eecbd02013-09-19 18:13:37727 },
[email protected]54c8d282014-01-24 17:31:08728#endif
[email protected]23eecbd02013-09-19 18:13:37729 {
[email protected]7e7a28092011-12-09 22:24:55730 "enable-panels",
731 IDS_FLAGS_ENABLE_PANELS_NAME,
732 IDS_FLAGS_ENABLE_PANELS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56733 kOsDesktop,
[email protected]7e7a28092011-12-09 22:24:55734 SINGLE_VALUE_TYPE(switches::kEnablePanels)
[email protected]73fb1fc52011-07-09 00:06:54735 },
[email protected]e3749d12011-07-25 22:22:12736 {
[email protected]27c14f02012-06-22 17:29:58737 // See http://crbug.com/120416 for how to remove this flag.
[email protected]6474b112012-05-04 19:35:27738 "save-page-as-mhtml", // FLAGS:RECORD_UMA
739 IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME,
740 IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION,
741 kOsMac | kOsWin | kOsLinux,
742 SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML)
743 },
744 {
[email protected]903e63382013-06-01 00:40:58745 "enable-quic",
746 IDS_FLAGS_ENABLE_QUIC_NAME,
747 IDS_FLAGS_ENABLE_QUIC_DESCRIPTION,
748 kOsAll,
749 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic,
750 switches::kDisableQuic)
751 },
752 {
[email protected]d10833bc2014-04-14 17:50:46753 "enable-spdy4",
754 IDS_FLAGS_ENABLE_SPDY4_NAME,
755 IDS_FLAGS_ENABLE_SPDY4_DESCRIPTION,
[email protected]bca09b9982013-06-27 22:30:46756 kOsAll,
[email protected]d10833bc2014-04-14 17:50:46757 SINGLE_VALUE_TYPE(switches::kEnableSpdy4)
[email protected]88a332622013-07-30 07:13:32758 },
759 {
[email protected]27b3fe92012-03-21 05:35:06760 "enable-async-dns",
761 IDS_FLAGS_ENABLE_ASYNC_DNS_NAME,
762 IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION,
[email protected]85594c142012-09-11 18:02:46763 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]83e9fa702013-02-25 19:30:44764 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns,
765 switches::kDisableAsyncDns)
[email protected]27b3fe92012-03-21 05:35:06766 },
767 {
[email protected]c3a47f8d2014-04-15 14:39:28768 "disable-media-source",
769 IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME,
770 IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION,
[email protected]ec9d0532012-03-21 05:55:32771 kOsAll,
[email protected]c3a47f8d2014-04-15 14:39:28772 SINGLE_VALUE_TYPE(switches::kDisableMediaSource)
[email protected]722b4d484f2013-10-08 20:33:59773 },
774 {
[email protected]16c242d2013-05-31 23:56:47775 "enable-encrypted-media",
776 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME,
777 IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]ddb0f262013-07-26 13:16:50778 kOsAll,
[email protected]16c242d2013-05-31 23:56:47779 SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia)
780 },
781 {
[email protected]e76d92f2013-09-26 20:03:35782 "disable-prefixed-encrypted-media",
[email protected]16c242d2013-05-31 23:56:47783 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME,
784 IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION,
[email protected]ddb0f262013-07-26 13:16:50785 kOsAll,
[email protected]e76d92f2013-09-26 20:03:35786 SINGLE_VALUE_TYPE(switches::kDisablePrefixedEncryptedMedia)
[email protected]9f5b7822012-04-18 23:39:03787 },
[email protected]ce3934bb2013-09-10 02:02:56788#if defined(OS_ANDROID)
789 {
[email protected]3c56ec12013-09-25 02:03:42790 "disable-infobar-for-protected-media-identifier",
791 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_NAME,
792 IDS_FLAGS_DISABLE_INFOBAR_FOR_PROTECTED_MEDIA_IDENTIFIER_DESCRIPTION,
793 kOsAndroid,
794 SINGLE_VALUE_TYPE(switches::kDisableInfobarForProtectedMediaIdentifier)
795 },
796 {
[email protected]ce3934bb2013-09-10 02:02:56797 "mediadrm-enable-non-compositing",
798 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_NAME,
799 IDS_FLAGS_MEDIADRM_ENABLE_NON_COMPOSITING_DESCRIPTION,
800 kOsAndroid,
801 SINGLE_VALUE_TYPE(switches::kMediaDrmEnableNonCompositing)
802 },
803#endif // defined(OS_ANDROID)
[email protected]d21ead42013-06-24 06:35:06804 {
[email protected]bf88c032011-12-22 19:05:47805 "enable-javascript-harmony",
806 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME,
807 IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION,
808 kOsAll,
erikcorryb251cb92014-09-25 23:48:51809 SINGLE_VALUE_TYPE(switches::kJavaScriptHarmony)
[email protected]bf88c032011-12-22 19:05:47810 },
[email protected]7e7f378a2012-01-05 14:35:37811 {
[email protected]88864db2012-01-18 20:56:35812 "disable-software-rasterizer",
813 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME,
814 IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION,
815#if defined(ENABLE_SWIFTSHADER)
816 kOsAll,
817#else
818 0,
819#endif
820 SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer)
821 },
[email protected]15a5d722012-01-23 09:11:14822 {
[email protected]d1ddf8c52014-02-06 22:09:31823 "enable-gpu-rasterization",
824 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_NAME,
825 IDS_FLAGS_ENABLE_GPU_RASTERIZATION_DESCRIPTION,
[email protected]96d25e22014-03-04 05:56:18826 kOsAndroid,
[email protected]a23530d2014-03-11 06:04:14827 MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)
[email protected]d1ddf8c52014-02-06 22:09:31828 },
829 {
[email protected]c1b18ea2013-07-10 13:01:16830 "enable-experimental-web-platform-features",
831 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
832 IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION,
[email protected]d2edc6702012-01-30 09:13:16833 kOsAll,
[email protected]c1b18ea2013-07-10 13:01:16834 SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)
[email protected]ca7a3d792012-03-02 15:55:49835 },
836 {
[email protected]3e8befc2012-03-13 01:17:03837 "disable-ntp-other-sessions-menu",
[email protected]156f966332012-02-29 00:03:16838 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME,
839 IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56840 kOsDesktop,
[email protected]3e8befc2012-03-13 01:17:03841 SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu)
[email protected]156f966332012-02-29 00:03:16842 },
[email protected]184ec592012-03-01 11:54:28843 {
[email protected]2b8290d2014-08-02 00:29:36844 "enable-material-design-ntp",
845 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_NAME,
846 IDS_FLAGS_ENABLE_MATERIAL_DESIGN_NTP_DESCRIPTION,
847 kOsDesktop,
848 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMaterialDesignNTP,
849 switches::kDisableMaterialDesignNTP)
850 },
851 {
[email protected]184ec592012-03-01 11:54:28852 "enable-devtools-experiments",
853 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME,
854 IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56855 kOsDesktop,
[email protected]184ec592012-03-01 11:54:28856 SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments)
857 },
[email protected]76d1854e2012-03-02 23:57:44858 {
[email protected]2fefdb32013-02-26 14:28:10859 "silent-debugger-extension-api",
860 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME,
861 IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION,
862 kOsDesktop,
863 SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI)
864 },
865 {
[email protected]1dbaf5e2012-11-30 05:51:32866 "spellcheck-autocorrect",
867 IDS_FLAGS_SPELLCHECK_AUTOCORRECT,
868 IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION,
869 kOsWin | kOsLinux | kOsCrOS,
870 SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect)
871 },
872 {
[email protected]e27137282013-06-20 02:38:35873 "enable-scroll-prediction",
874 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME,
875 IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION,
876 kOsDesktop,
877 SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction)
878 },
879 {
[email protected]d7932532012-11-21 21:10:31880 "touch-events",
881 IDS_TOUCH_EVENTS_NAME,
882 IDS_TOUCH_EVENTS_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56883 kOsDesktop,
[email protected]d7932532012-11-21 21:10:31884 MULTI_VALUE_TYPE(kTouchEventsChoices)
885 },
886 {
[email protected]b9c96ff2012-11-26 22:24:40887 "disable-touch-adjustment",
888 IDS_DISABLE_TOUCH_ADJUSTMENT_NAME,
889 IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION,
zeeshanqcf855b02014-09-25 18:09:49890 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
[email protected]b9c96ff2012-11-26 22:24:40891 SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment)
892 },
[email protected]0b60afa2012-04-19 17:36:39893#if defined(OS_CHROMEOS)
894 {
[email protected]81f89e92014-02-21 14:27:35895 "network-portal-notification",
896 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_NAME,
897 IDS_FLAGS_NETWORK_PORTAL_NOTIFICATION_DESCRIPTION,
898 kOsCrOS,
899 ENABLE_DISABLE_VALUE_TYPE(
900 chromeos::switches::kEnableNetworkPortalNotification,
901 chromeos::switches::kDisableNetworkPortalNotification)
902 },
[email protected]0b60afa2012-04-19 17:36:39903#endif
[email protected]79be6d32012-04-24 20:47:44904 {
[email protected]8d68a3e02013-01-12 15:57:10905 "enable-download-resumption",
906 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME,
907 IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56908 kOsDesktop,
[email protected]8d68a3e02013-01-12 15:57:10909 SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption)
910 },
[email protected]67fe3642014-08-05 00:00:42911#if defined(ENABLE_PLUGINS)
[email protected]8d68a3e02013-01-12 15:57:10912 {
[email protected]9a5940d2012-04-27 19:16:23913 "allow-nacl-socket-api",
914 IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME,
915 IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:56916 kOsDesktop,
[email protected]9a5940d2012-04-27 19:16:23917 SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*")
918 },
[email protected]d33d2222014-06-04 15:39:58919#endif
[email protected]190349fd2012-05-02 00:10:47920#if defined(OS_CHROMEOS)
921 {
922 "allow-touchpad-three-finger-click",
923 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME,
924 IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION,
925 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:24926 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick)
[email protected]190349fd2012-05-02 00:10:47927 },
xiyuana0e92b082014-09-15 22:24:08928 {
xiyuan1958f5a2014-10-01 04:23:30929 "disable-easy-signin",
930 IDS_FLAGS_DISABLE_EASY_SIGNIN_NAME,
931 IDS_FLAGS_DISABLE_EASY_SIGNIN_DESCRIPTION,
xiyuana0e92b082014-09-15 22:24:08932 kOsCrOSOwnerOnly,
xiyuan1958f5a2014-10-01 04:23:30933 SINGLE_VALUE_TYPE(chromeos::switches::kDisableEasySignin),
xiyuana0e92b082014-09-15 22:24:08934 },
[email protected]190349fd2012-05-02 00:10:47935#endif
[email protected]53520b1b2012-05-07 21:43:37936#if defined(USE_ASH)
937 {
[email protected]2ddf37b2013-04-20 01:15:58938 "disable-minimize-on-second-launcher-item-click",
939 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME,
940 IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION,
941 kOsAll,
942 SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick)
943 },
944 {
[email protected]73074742012-05-17 01:44:41945 "show-touch-hud",
946 IDS_FLAGS_SHOW_TOUCH_HUD_NAME,
947 IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION,
948 kOsAll,
949 SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)
950 },
951 {
[email protected]9f0940b62012-05-23 22:56:35952 "enable-pinch",
953 IDS_FLAGS_ENABLE_PINCH_SCALE_NAME,
954 IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION,
[email protected]16ad47f82012-12-05 21:06:06955 kOsLinux | kOsWin | kOsCrOS,
[email protected]e4cd82e2013-04-10 15:20:38956 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch),
957 },
[email protected]adcdcdd02014-04-25 03:30:24958#endif // defined(USE_ASH)
[email protected]e4cd82e2013-04-10 15:20:38959 {
[email protected]de0aaed2013-05-27 18:16:43960 "enable-pinch-virtual-viewport",
961 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME,
962 IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION,
[email protected]fe89d822014-04-28 10:29:00963 kOsLinux | kOsWin | kOsCrOS | kOsAndroid,
964 ENABLE_DISABLE_VALUE_TYPE(
965 cc::switches::kEnablePinchVirtualViewport,
966 cc::switches::kDisablePinchVirtualViewport),
[email protected]de0aaed2013-05-27 18:16:43967 },
[email protected]68bc37c2014-01-07 15:56:48968 {
969 "enable-viewport-meta",
970 IDS_FLAGS_ENABLE_VIEWPORT_META_NAME,
971 IDS_FLAGS_ENABLE_VIEWPORT_META_DESCRIPTION,
972 kOsLinux | kOsWin | kOsCrOS | kOsMac,
973 SINGLE_VALUE_TYPE(switches::kEnableViewportMeta),
974 },
[email protected]ed7b67f32012-05-28 10:12:28975#if defined(OS_CHROMEOS)
976 {
[email protected]8b04a1652012-08-04 02:59:49977 "disable-boot-animation",
978 IDS_FLAGS_DISABLE_BOOT_ANIMATION,
979 IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION,
[email protected]37736bd2013-04-18 11:53:58980 kOsCrOSOwnerOnly,
[email protected]2f2d6c32013-05-10 02:56:24981 SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation),
[email protected]8b04a1652012-08-04 02:59:49982 },
[email protected]95058572012-08-20 14:57:29983 {
[email protected]d739c1db2014-07-08 07:19:59984 "enable-video-player-chromecast-support",
985 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_NAME,
986 IDS_FLAGS_ENABLE_VIDEO_PLAYER_CHROMECAST_SUPPORT_DESCRIPTION,
987 kOsCrOS,
988 SINGLE_VALUE_TYPE(chromeos::switches::kEnableVideoPlayerChromecastSupport)
989 },
990 {
[email protected]f2ad22e2014-07-10 17:52:08991 "disable-office-editing-component-app",
992 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_NAME,
993 IDS_FLAGS_DISABLE_OFFICE_EDITING_COMPONENT_APP_DESCRIPTION,
[email protected]099b890c2013-04-25 19:16:26994 kOsCrOS,
[email protected]f2ad22e2014-07-10 17:52:08995 SINGLE_VALUE_TYPE(chromeos::switches::kDisableOfficeEditingComponentApp),
[email protected]099b890c2013-04-25 19:16:26996 },
[email protected]31cf1472013-09-13 00:36:42997 {
[email protected]bf3f4592014-03-31 19:50:44998 "disable-display-color-calibration",
999 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_NAME,
1000 IDS_FLAGS_DISABLE_DISPLAY_COLOR_CALIBRATION_DESCRIPTION,
1001 kOsCrOS,
1002 SINGLE_VALUE_TYPE(ui::switches::kDisableDisplayColorCalibration),
1003 },
[email protected]62018dc2012-12-13 00:37:351004#endif // defined(OS_CHROMEOS)
[email protected]7db8893a2012-07-26 00:49:401005 { "disable-accelerated-video-decode",
1006 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME,
1007 IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION,
[email protected]33e98a852013-04-26 05:14:191008 kOsWin | kOsCrOS,
[email protected]7db8893a2012-07-26 00:49:401009 SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
[email protected]66dcb0492012-06-18 22:32:151010 },
[email protected]1d9bb9cd2012-08-28 22:02:501011#if defined(USE_ASH)
[email protected]35c9a4e2013-09-14 01:32:381012 {
1013 "ash-debug-shortcuts",
1014 IDS_FLAGS_DEBUG_SHORTCUTS_NAME,
1015 IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION,
1016 kOsAll,
1017 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts),
1018 },
[email protected]b19b09a2014-02-26 05:34:341019 { "ash-enable-touch-view-testing",
1020 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_NAME,
1021 IDS_FLAGS_ASH_ENABLE_TOUCH_VIEW_TESTING_DESCRIPTION,
1022 kOsCrOS,
1023 SINGLE_VALUE_TYPE(ash::switches::kAshEnableTouchViewTesting),
1024 },
jonross367a1bee2014-09-06 12:37:081025 {
jonross37f21b82014-09-29 20:31:351026 "enable-touch-feedback",
1027 IDS_FLAGS_ENABLE_TOUCH_FEEDBACK_NAME,
1028 IDS_FLAGS_ENABLE_TOUCH_FEEDBACK_DESCRIPTION,
jonross367a1bee2014-09-06 12:37:081029 kOsCrOS,
jonross37f21b82014-09-29 20:31:351030 SINGLE_VALUE_TYPE(switches::kEnableTouchFeedback),
jonross367a1bee2014-09-06 12:37:081031 },
[email protected]88474872014-07-04 22:51:061032 { "ash-disable-text-filtering-in-overview-mode",
1033 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_NAME,
1034 IDS_FLAGS_ASH_DISABLE_TEXT_FILTERING_IN_OVERVIEW_MODE_DESCRIPTION,
1035 kOsCrOS,
1036 SINGLE_VALUE_TYPE(ash::switches::kAshDisableTextFilteringInOverviewMode),
1037 },
jonross367a1bee2014-09-06 12:37:081038#endif // defined(USE_ASH)
[email protected]9b7ab882012-09-10 23:46:361039#if defined(OS_CHROMEOS)
1040 {
[email protected]205f07892012-10-16 20:26:221041 "enable-carrier-switching",
1042 IDS_FLAGS_ENABLE_CARRIER_SWITCHING,
1043 IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION,
1044 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241045 SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching)
[email protected]205f07892012-10-16 20:26:221046 },
1047 {
[email protected]9b7ab882012-09-10 23:46:361048 "enable-request-tablet-site",
1049 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME,
1050 IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION,
1051 kOsCrOS,
[email protected]2f2d6c32013-05-10 02:56:241052 SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite)
[email protected]9b7ab882012-09-10 23:46:361053 },
1054#endif
[email protected]dab49c0b2012-10-04 05:55:351055 {
1056 "debug-packed-apps",
1057 IDS_FLAGS_DEBUG_PACKED_APP_NAME,
1058 IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION,
[email protected]f3cd6802013-01-23 20:25:561059 kOsDesktop,
[email protected]dab49c0b2012-10-04 05:55:351060 SINGLE_VALUE_TYPE(switches::kDebugPackedApps)
1061 },
[email protected]d1459ed2012-10-10 01:29:331062 {
1063 "enable-password-generation",
1064 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME,
1065 IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION,
[email protected]d4855d32014-08-22 18:34:531066 kOsWin | kOsLinux | kOsCrOS | kOsMac,
[email protected]c3cc0632013-10-03 21:54:431067 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnablePasswordGeneration,
1068 autofill::switches::kDisablePasswordGeneration)
[email protected]d1459ed2012-10-10 01:29:331069 },
[email protected]26d045f2012-10-18 21:18:431070 {
[email protected]0477c062014-04-30 15:02:181071 "enable-automatic-password-saving",
1072 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_NAME,
1073 IDS_FLAGS_ENABLE_AUTOMATIC_PASSWORD_SAVING_DESCRIPTION,
1074 kOsDesktop,
1075 SINGLE_VALUE_TYPE(
1076 password_manager::switches::kEnableAutomaticPasswordSaving)
1077 },
1078 {
[email protected]f2a394b2013-11-28 20:08:041079 "password-manager-reauthentication",
[email protected]429a6e02013-10-23 18:40:481080 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_NAME,
1081 IDS_FLAGS_PASSWORD_MANAGER_REAUTHENTICATION_DESCRIPTION,
[email protected]48293fb2013-12-04 04:02:031082 kOsMac | kOsWin,
[email protected]f2a394b2013-11-28 20:08:041083 SINGLE_VALUE_TYPE(switches::kDisablePasswordManagerReauthentication)
[email protected]429a6e02013-10-23 18:40:481084 },
1085 {
[email protected]0f1f70852014-08-09 05:56:011086 "enable-android-password-link",
1087 IDS_FLAGS_PASSWORD_MANAGER_ANDROID_LINK_NAME,
1088 IDS_FLAGS_PASSWORD_MANAGER_ANDROID_LINK_DESCRIPTION,
1089 kOsAndroid,
1090 ENABLE_DISABLE_VALUE_TYPE(
1091 password_manager::switches::kEnableAndroidPasswordLink,
1092 password_manager::switches::kDisableAndroidPasswordLink)
1093 },
1094 {
[email protected]76f7d4882012-10-26 21:09:221095 "enable-deferred-image-decoding",
1096 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME,
1097 IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION,
[email protected]76f7d4882012-10-26 21:09:221098 kOsMac | kOsLinux | kOsCrOS,
[email protected]76f7d4882012-10-26 21:09:221099 SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding)
1100 },
1101 {
[email protected]45476982013-10-01 03:22:291102 "wallet-service-use-sandbox",
1103 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_NAME,
1104 IDS_FLAGS_WALLET_SERVICE_USE_SANDBOX_DESCRIPTION,
[email protected]d4d59992014-06-04 23:48:071105 kOsAndroid | kOsDesktop,
[email protected]45476982013-10-01 03:22:291106 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1107 autofill::switches::kWalletServiceUseSandbox, "1",
1108 autofill::switches::kWalletServiceUseSandbox, "0")
[email protected]db3178c2013-03-21 14:54:541109 },
[email protected]177260c2013-04-24 01:47:381110#if defined(USE_AURA)
1111 {
1112 "overscroll-history-navigation",
1113 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME,
1114 IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION,
1115 kOsAll,
[email protected]c38e9802014-02-18 21:32:121116 MULTI_VALUE_TYPE(kOverscrollHistoryNavigationChoices)
[email protected]177260c2013-04-24 01:47:381117 },
1118#endif
[email protected]edbea622012-11-28 20:39:381119 {
[email protected]888878e82013-07-24 22:49:401120 "scroll-end-effect",
1121 IDS_FLAGS_SCROLL_END_EFFECT_NAME,
1122 IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION,
1123 kOsCrOS,
1124 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1125 switches::kScrollEndEffect, "1",
1126 switches::kScrollEndEffect, "0")
1127 },
1128 {
[email protected]cc7c069d2014-08-07 20:42:051129 "enable-renderer-mojo-channel",
1130 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_NAME,
1131 IDS_FLAGS_ENABLE_RENDERER_MOJO_CHANNEL_DESCRIPTION,
1132 kOsAll,
1133 SINGLE_VALUE_TYPE(switches::kEnableRendererMojoChannel)
1134 },
1135 {
[email protected]edbea622012-11-28 20:39:381136 "enable-touch-drag-drop",
1137 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME,
1138 IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION,
1139 kOsWin | kOsCrOS,
[email protected]1400e6dc2013-04-27 02:36:271140 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop,
1141 switches::kDisableTouchDragDrop)
[email protected]edbea622012-11-28 20:39:381142 },
[email protected]0e2f43b62013-02-21 00:47:151143 {
1144 "enable-touch-editing",
1145 IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME,
1146 IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION,
[email protected]877dd942014-06-06 16:02:011147 kOsCrOS | kOsWin | kOsLinux,
[email protected]1400e6dc2013-04-27 02:36:271148 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing,
1149 switches::kDisableTouchEditing)
[email protected]0e2f43b62013-02-21 00:47:151150 },
[email protected]92e12dd92012-12-11 03:33:201151 {
[email protected]06a82ff2014-04-25 02:24:461152 "enable-suggestions-service",
1153 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME,
1154 IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION,
1155 kOsAndroid | kOsCrOS,
1156 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSuggestionsService,
1157 switches::kDisableSuggestionsService)
1158 },
1159 {
treibfd04f152014-09-08 16:31:061160 "enable-supervised-user-blacklist",
1161 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_NAME,
1162 IDS_FLAGS_ENABLE_SUPERVISED_USER_BLACKLIST_DESCRIPTION,
1163 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
treib63b9dc02014-10-02 22:30:151164 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSupervisedUserBlacklist,
1165 switches::kDisableSupervisedUserBlacklist)
treibfd04f152014-09-08 16:31:061166 },
1167 {
[email protected]ddec1aa2013-04-28 23:22:451168 "enable-sync-synced-notifications",
1169 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME,
1170 IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION,
[email protected]43168932013-05-24 06:35:181171 kOsDesktop,
[email protected]ddec1aa2013-04-28 23:22:451172 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications,
1173 switches::kDisableSyncSyncedNotifications)
1174 },
[email protected]630a27a2014-01-15 08:24:091175#if defined(ENABLE_APP_LIST)
1176 {
[email protected]4734b902014-04-03 16:42:101177 "enable-sync-app-list",
1178 IDS_FLAGS_ENABLE_SYNC_APP_LIST_NAME,
1179 IDS_FLAGS_ENABLE_SYNC_APP_LIST_DESCRIPTION,
[email protected]630a27a2014-01-15 08:24:091180 kOsDesktop,
[email protected]4734b902014-04-03 16:42:101181 MULTI_VALUE_TYPE(kEnableSyncAppListChoices)
[email protected]630a27a2014-01-15 08:24:091182 },
1183#endif
[email protected]d41cf1b2014-02-21 01:24:351184#if defined(OS_MACOSX)
1185 {
[email protected]0039b0be2014-03-12 20:24:111186 "enable-avfoundation",
1187 IDS_FLAGS_ENABLE_AVFOUNDATION_NAME,
1188 IDS_FLAGS_ENABLE_AVFOUNDATION_DESCRIPTION,
[email protected]d41cf1b2014-02-21 01:24:351189 kOsMac,
[email protected]469ea5c2014-08-12 20:00:561190 MULTI_VALUE_TYPE(kEnableAVFoundationChoices)
[email protected]d41cf1b2014-02-21 01:24:351191 },
1192#endif
[email protected]5b93e162013-02-19 06:33:091193 {
[email protected]9323fdd12013-02-23 00:31:361194 "impl-side-painting",
1195 IDS_FLAGS_IMPL_SIDE_PAINTING_NAME,
1196 IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION,
[email protected]1a82f7372013-12-06 12:46:521197 kOsAll,
[email protected]9323fdd12013-02-23 00:31:361198 MULTI_VALUE_TYPE(kImplSidePaintingChoices)
1199 },
[email protected]a42c85f2013-04-04 18:15:121200 {
[email protected]7621af22013-09-12 23:06:331201 "lcd-text-aa",
1202 IDS_FLAGS_LCD_TEXT_NAME,
1203 IDS_FLAGS_LCD_TEXT_DESCRIPTION,
1204 kOsDesktop,
1205 MULTI_VALUE_TYPE(kLCDTextChoices)
1206 },
[email protected]4ac579b2014-05-20 06:43:231207#if defined(OS_ANDROID) || defined(OS_MACOSX)
[email protected]7621af22013-09-12 23:06:331208 {
[email protected]0c04d1c2013-07-10 00:02:321209 "delegated-renderer",
1210 IDS_FLAGS_DELEGATED_RENDERER_NAME,
1211 IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION,
[email protected]4ac579b2014-05-20 06:43:231212 kOsAndroid, // TODO(ccameron) Add mac support soon.
[email protected]0c04d1c2013-07-10 00:02:321213 MULTI_VALUE_TYPE(kDelegatedRendererChoices)
1214 },
[email protected]758efb02014-04-05 07:53:451215#endif
[email protected]0c04d1c2013-07-10 00:02:321216 {
[email protected]a42c85f2013-04-04 18:15:121217 "max-tiles-for-interest-area",
1218 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME,
1219 IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION,
[email protected]1a82f7372013-12-06 12:46:521220 kOsAll,
[email protected]a42c85f2013-04-04 18:15:121221 MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices)
1222 },
[email protected]7cf7ccb2013-04-20 02:53:081223 {
[email protected]5676e7482013-12-17 08:05:371224 "enable-offline-auto-reload",
1225 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_NAME,
1226 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_DESCRIPTION,
1227 kOsAll,
[email protected]bd519e32014-05-09 01:33:171228 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReload,
1229 switches::kDisableOfflineAutoReload)
[email protected]5676e7482013-12-17 08:05:371230 },
1231 {
[email protected]d2e1a0a2014-06-16 15:49:371232 "enable-offline-auto-reload-visible-only",
1233 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_NAME,
1234 IDS_FLAGS_ENABLE_OFFLINE_AUTO_RELOAD_VISIBLE_ONLY_DESCRIPTION,
1235 kOsAll,
1236 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineAutoReloadVisibleOnly,
1237 switches::kDisableOfflineAutoReloadVisibleOnly)
1238 },
1239 {
[email protected]d8bc9132014-05-02 15:56:371240 "enable-offline-load-stale-cache",
1241 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_NAME,
1242 IDS_FLAGS_ENABLE_OFFLINE_LOAD_STALE_DESCRIPTION,
1243 kOsLinux | kOsMac | kOsWin | kOsAndroid,
[email protected]e83140a02014-05-07 14:04:581244 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflineLoadStaleCache,
1245 switches::kDisableOfflineLoadStaleCache)
[email protected]d8bc9132014-05-02 15:56:371246 },
1247 {
[email protected]a3618122013-04-26 21:15:341248 "default-tile-width",
1249 IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME,
1250 IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION,
1251 kOsAll,
1252 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)
1253 },
1254 {
1255 "default-tile-height",
1256 IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME,
1257 IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION,
1258 kOsAll,
1259 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)
1260 },
[email protected]2289b432014-08-08 17:52:111261#if defined(OS_ANDROID)
1262 {
1263 "disable-gesture-requirement-for-media-playback",
1264 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME,
1265 IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION,
1266 kOsAndroid,
1267 SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback)
1268 },
1269#endif
[email protected]86459e2c2013-04-10 13:39:241270#if defined(OS_CHROMEOS)
1271 {
1272 "enable-virtual-keyboard",
1273 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME,
1274 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION,
1275 kOsCrOS,
1276 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)
1277 },
[email protected]8b4321e2013-10-25 01:16:181278 {
[email protected]bb6378fe2014-04-28 21:19:441279 "enable-virtual-keyboard-overscroll",
1280 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_NAME,
1281 IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_OVERSCROLL_DESCRIPTION,
1282 kOsCrOS,
1283 ENABLE_DISABLE_VALUE_TYPE(
1284 keyboard::switches::kEnableVirtualKeyboardOverscroll,
1285 keyboard::switches::kDisableVirtualKeyboardOverscroll)
1286 },
1287 {
[email protected]8b4321e2013-10-25 01:16:181288 "enable-swipe-selection",
1289 IDS_FLAGS_ENABLE_SWIPE_SELECTION_NAME,
1290 IDS_FLAGS_ENABLE_SWIPE_SELECTION_DESCRIPTION,
1291 kOsCrOS,
1292 SINGLE_VALUE_TYPE(keyboard::switches::kEnableSwipeSelection)
1293 },
[email protected]0e627fb12014-03-25 18:18:531294 {
1295 "enable-input-view",
1296 IDS_FLAGS_ENABLE_INPUT_VIEW_NAME,
1297 IDS_FLAGS_ENABLE_INPUT_VIEW_DESCRIPTION,
1298 kOsCrOS,
1299 ENABLE_DISABLE_VALUE_TYPE(keyboard::switches::kEnableInputView,
1300 keyboard::switches::kDisableInputView)
1301 },
[email protected]90933412014-06-05 21:11:021302 {
1303 "enable-experimental-input-view-features",
1304 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_NAME,
1305 IDS_FLAGS_ENABLE_EXPERIMENTAL_INPUT_VIEW_FEATURES_DESCRIPTION,
1306 kOsCrOS,
1307 SINGLE_VALUE_TYPE(keyboard::switches::kEnableExperimentalInputViewFeatures)
1308 },
sashab04675aa32014-10-07 03:48:591309#if defined(ENABLE_EXTENSIONS)
1310 {
1311 "enable-extension-info-dialog",
1312 IDS_FLAGS_ENABLE_EXTENSION_INFO_DIALOG_NAME,
1313 IDS_FLAGS_ENABLE_EXTENSION_INFO_DIALOG_DESCRIPTION,
1314 kOsWin | kOsLinux | kOsCrOS,
1315 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionInfoDialog)
1316 },
1317#endif
[email protected]86459e2c2013-04-10 13:39:241318#endif
[email protected]38484df12013-04-10 16:42:031319 {
1320 "enable-simple-cache-backend",
1321 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME,
1322 IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION,
[email protected]957cd5a2014-03-27 19:54:171323 kOsWin | kOsMac | kOsLinux | kOsCrOS,
[email protected]38484df12013-04-10 16:42:031324 MULTI_VALUE_TYPE(kSimpleCacheBackendChoices)
1325 },
[email protected]717e4e22013-04-10 20:52:231326 {
1327 "enable-tcp-fast-open",
1328 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME,
1329 IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION,
[email protected]d0a8a162013-04-13 01:37:111330 kOsLinux | kOsCrOS | kOsAndroid,
[email protected]717e4e22013-04-10 20:52:231331 SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen)
1332 },
[email protected]2188c8d2014-03-21 00:58:561333#if defined(ENABLE_SERVICE_DISCOVERY)
[email protected]a4ed7e12013-05-24 01:00:281334 {
[email protected]d394d9762013-09-22 06:00:251335 "device-discovery-notifications",
1336 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_NAME,
1337 IDS_FLAGS_DEVICE_DISCOVERY_NOTIFICATIONS_DESCRIPTION,
[email protected]4e6c96e2014-05-17 18:41:191338 kOsDesktop,
[email protected]d394d9762013-09-22 06:00:251339 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDeviceDiscoveryNotifications,
1340 switches::kDisableDeviceDiscoveryNotifications)
[email protected]94868922013-09-19 18:00:551341 },
[email protected]53ffe0d2013-10-30 01:20:401342 {
[email protected]4e6c96e2014-05-17 18:41:191343 "enable-cloud-devices",
1344 IDS_FLAGS_ENABLE_CLOUD_DEVICES_NAME,
1345 IDS_FLAGS_ENABLE_CLOUD_DEVICES_DESCRIPTION,
1346 kOsDesktop,
1347 SINGLE_VALUE_TYPE(switches::kEnableCloudDevices)
1348 },
1349 {
[email protected]f0392392014-03-10 20:07:521350 "enable-print-preview-register-promos",
1351 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_NAME,
1352 IDS_FLAGS_ENABLE_PRINT_PREVIEW_REGISTER_PROMOS_DESCRIPTION,
[email protected]4e6c96e2014-05-17 18:41:191353 kOsDesktop,
[email protected]f0392392014-03-10 20:07:521354 SINGLE_VALUE_TYPE(switches::kEnablePrintPreviewRegisterPromos)
1355 },
[email protected]2188c8d2014-03-21 00:58:561356#endif // ENABLE_SERVICE_DISCOVERY
[email protected]ca53b142014-02-25 22:42:231357#if defined(OS_WIN)
1358 {
1359 "enable-cloud-print-xps",
1360 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_NAME,
1361 IDS_FLAGS_ENABLE_CLOUD_PRINT_XPS_DESCRIPTION,
1362 kOsWin,
1363 SINGLE_VALUE_TYPE(switches::kEnableCloudPrintXps)
1364 },
1365#endif
[email protected]910ecfe2013-06-03 23:38:141366#if defined(USE_AURA)
1367 {
1368 "tab-capture-upscale-quality",
1369 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME,
1370 IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION,
1371 kOsAll,
1372 MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices)
1373 },
1374 {
1375 "tab-capture-downscale-quality",
1376 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME,
1377 IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION,
1378 kOsAll,
1379 MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices)
1380 },
1381#endif
[email protected]71d4f602013-06-04 23:21:101382 {
[email protected]ba7993d2013-11-26 23:44:561383 "enable-spelling-feedback-field-trial",
1384 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_NAME,
1385 IDS_FLAGS_ENABLE_SPELLING_FEEDBACK_FIELD_TRIAL_DESCRIPTION,
[email protected]5e099c62013-06-08 05:46:231386 kOsAll,
[email protected]ba7993d2013-11-26 23:44:561387 SINGLE_VALUE_TYPE(switches::kEnableSpellingFeedbackFieldTrial)
[email protected]5e099c62013-06-08 05:46:231388 },
1389 {
[email protected]71d4f602013-06-04 23:21:101390 "enable-webgl-draft-extensions",
1391 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME,
1392 IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION,
1393 kOsAll,
1394 SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions)
1395 },
[email protected]deadc492013-06-07 21:39:281396 {
[email protected]bc1697a82013-06-27 15:48:311397 "enable-web-midi",
1398 IDS_FLAGS_ENABLE_WEB_MIDI_NAME,
1399 IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION,
[email protected]28e56e92014-01-03 07:52:391400 kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
[email protected]bc1697a82013-06-27 15:48:311401 SINGLE_VALUE_TYPE(switches::kEnableWebMIDI)
1402 },
[email protected]020df792013-06-29 14:26:211403 {
1404 "enable-new-profile-management",
1405 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME,
1406 IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION,
[email protected]a3b75bd2014-05-28 17:49:421407 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
[email protected]29896ee2014-06-17 17:20:531408 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewProfileManagement,
1409 switches::kDisableNewProfileManagement)
[email protected]020df792013-06-29 14:26:211410 },
1411 {
[email protected]1017a3212014-05-30 10:34:591412 "enable-account-consistency",
1413 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_NAME,
1414 IDS_FLAGS_ENABLE_ACCOUNT_CONSISTENCY_DESCRIPTION,
1415 kOsAndroid | kOsMac | kOsWin | kOsLinux | kOsCrOS,
[email protected]29896ee2014-06-17 17:20:531416 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAccountConsistency,
1417 switches::kDisableAccountConsistency)
[email protected]1017a3212014-05-30 10:34:591418 },
1419 {
[email protected]8f569882014-03-25 21:12:121420 "enable-fast-user-switching",
1421 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_NAME,
1422 IDS_FLAGS_ENABLE_FAST_USER_SWITCHING_DESCRIPTION,
1423 kOsMac | kOsWin | kOsLinux,
1424 SINGLE_VALUE_TYPE(switches::kFastUserSwitching)
1425 },
1426 {
[email protected]274171e2014-04-11 23:10:081427 "enable-new-avatar-menu",
1428 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_NAME,
1429 IDS_FLAGS_ENABLE_NEW_AVATAR_MENU_DESCRIPTION,
1430 kOsMac | kOsWin | kOsLinux,
[email protected]9152a542014-08-06 05:37:451431 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewAvatarMenu,
1432 switches::kDisableNewAvatarMenu)
[email protected]274171e2014-04-11 23:10:081433 },
1434 {
[email protected]85777bc2013-12-23 00:07:061435 "enable-web-based-signin",
1436 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_NAME,
1437 IDS_FLAGS_ENABLE_WEB_BASED_SIGNIN_DESCRIPTION,
[email protected]2d279f72013-10-21 23:10:161438 kOsMac | kOsWin | kOsLinux,
[email protected]85777bc2013-12-23 00:07:061439 SINGLE_VALUE_TYPE(switches::kEnableWebBasedSignin)
[email protected]2d279f72013-10-21 23:10:161440 },
1441 {
[email protected]115d5728c2013-10-23 18:06:141442 "enable-google-profile-info",
1443 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_NAME,
1444 IDS_FLAGS_ENABLE_GOOGLE_PROFILE_INFO_DESCRIPTION,
[email protected]a9bf7d62013-07-11 22:11:221445 kOsMac | kOsWin | kOsLinux,
[email protected]115d5728c2013-10-23 18:06:141446 SINGLE_VALUE_TYPE(switches::kGoogleProfileInfo)
[email protected]020df792013-06-29 14:26:211447 },
[email protected]dcf6cf32013-07-03 10:53:281448 {
[email protected]056ed7092014-01-09 12:57:211449 "reset-app-list-install-state",
[email protected]a85aa332013-10-22 11:09:591450 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_NAME,
1451 IDS_FLAGS_RESET_APP_LIST_INSTALL_STATE_DESCRIPTION,
[email protected]7199367d2014-01-20 04:06:211452 kOsMac | kOsWin | kOsLinux,
[email protected]a85aa332013-10-22 11:09:591453 SINGLE_VALUE_TYPE(switches::kResetAppListInstallState)
[email protected]dcf6cf32013-07-03 10:53:281454 },
[email protected]919b2f82013-10-04 03:11:261455#if defined(ENABLE_APP_LIST)
[email protected]7199367d2014-01-20 04:06:211456#if defined(OS_LINUX)
1457 {
1458 // This is compiled out on non-Linux platforms because otherwise it would be
1459 // visible on Win/Mac/CrOS but not on Linux GTK, which would be confusing.
1460 // TODO(mgiuca): Remove the #if when Aura is the default on Linux.
1461 "enable-app-list",
1462 IDS_FLAGS_ENABLE_APP_LIST_NAME,
1463 IDS_FLAGS_ENABLE_APP_LIST_DESCRIPTION,
1464 kOsLinux,
1465 SINGLE_VALUE_TYPE(switches::kEnableAppList)
1466 },
1467#endif
thestigb012bc3d2014-09-18 22:57:131468#if defined(ENABLE_EXTENSIONS)
[email protected]fe2b77f62013-11-09 04:30:511469 {
[email protected]97df3be2014-07-03 07:49:101470 "enable-app-view",
1471 IDS_FLAGS_ENABLE_APP_VIEW_NAME,
1472 IDS_FLAGS_ENABLE_APP_VIEW_DESCRIPTION,
fsamuelbb30da92014-08-27 21:20:291473 kOsDesktop,
[email protected]b4ef1212014-08-21 18:31:261474 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppView)
[email protected]97df3be2014-07-03 07:49:101475 },
thestigb012bc3d2014-09-18 22:57:131476#endif
[email protected]97df3be2014-07-03 07:49:101477 {
[email protected]9e0a44c2014-06-07 14:26:211478 "disable-app-list-app-info",
1479 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST,
1480 IDS_FLAGS_DISABLE_APP_INFO_IN_APP_LIST_DESCRIPTION,
1481 kOsLinux | kOsWin | kOsCrOS,
1482 SINGLE_VALUE_TYPE(app_list::switches::kDisableAppInfo)
1483 },
1484 {
xiyuanfde6f252014-09-12 17:23:481485 "disable-drive-apps-in-app-list",
1486 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_NAME,
1487 IDS_FLAGS_DISABLE_DRIVE_APPS_IN_APP_LIST_DESCRIPTION,
1488 kOsCrOS,
1489 SINGLE_VALUE_TYPE(app_list::switches::kDisableDriveAppsInAppList)
[email protected]c30bda262014-06-19 04:10:131490 },
[email protected]919b2f82013-10-04 03:11:261491#endif
[email protected]0e38c3252013-08-14 22:18:511492#if defined(OS_ANDROID)
1493 {
1494 "enable-accessibility-tab-switcher",
1495 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_NAME,
1496 IDS_FLAGS_ENABLE_ACCESSIBILITY_TAB_SWITCHER_DESCRIPTION,
1497 kOsAndroid,
1498 SINGLE_VALUE_TYPE(switches::kEnableAccessibilityTabSwitcher)
[email protected]2e9d79f2013-08-16 05:45:561499 },
[email protected]738384172013-12-05 01:59:561500 {
[email protected]0e174722014-03-31 21:23:271501 // TODO(dmazzoni): remove this flag when native android accessibility
1502 // ships in the stable channel. http://crbug.com/356775
1503 "enable-accessibility-script-injection",
1504 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_NAME,
1505 IDS_FLAGS_ENABLE_ACCESSIBILITY_SCRIPT_INJECTION_DESCRIPTION,
[email protected]738384172013-12-05 01:59:561506 kOsAndroid,
[email protected]0e174722014-03-31 21:23:271507 // Java-only switch: ContentSwitches.ENABLE_ACCESSIBILITY_SCRIPT_INJECTION.
1508 SINGLE_VALUE_TYPE("enable-accessibility-script-injection")
[email protected]738384172013-12-05 01:59:561509 },
[email protected]0e38c3252013-08-14 22:18:511510#endif
[email protected]2e9d79f2013-08-16 05:45:561511 {
[email protected]2cccfef2014-05-01 06:05:161512 "enable-one-copy",
1513 IDS_FLAGS_ONE_COPY_NAME,
1514 IDS_FLAGS_ONE_COPY_DESCRIPTION,
[email protected]be2e40a2013-08-27 02:49:201515 kOsAll,
[email protected]2cccfef2014-05-01 06:05:161516 SINGLE_VALUE_TYPE(switches::kEnableOneCopy)
1517 },
1518 {
1519 "enable-zero-copy",
1520 IDS_FLAGS_ZERO_COPY_NAME,
1521 IDS_FLAGS_ZERO_COPY_DESCRIPTION,
1522 kOsAll,
1523 MULTI_VALUE_TYPE(kZeroCopyChoices)
[email protected]4fdc518f2013-08-28 21:37:271524 },
[email protected]bbb4beae2013-09-27 17:20:311525#if defined(OS_CHROMEOS)
1526 {
[email protected]407d82b2013-12-13 11:50:591527 "enable-first-run-ui-transitions",
1528 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_NAME,
1529 IDS_FLAGS_ENABLE_FIRST_RUN_UI_TRANSITIONS_DESCRIPTION,
1530 kOsCrOS,
1531 SINGLE_VALUE_TYPE(chromeos::switches::kEnableFirstRunUITransitions)
1532 },
[email protected]bbb4beae2013-09-27 17:20:311533#endif
[email protected]ed1aab12013-10-08 14:27:071534 {
[email protected]f95e6df2013-10-11 13:05:171535 "enable-streamlined-hosted-apps",
1536 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME,
1537 IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION,
[email protected]abe7f8722013-12-13 11:38:061538 kOsWin | kOsCrOS | kOsLinux,
[email protected]f95e6df2013-10-11 13:05:171539 SINGLE_VALUE_TYPE(switches::kEnableStreamlinedHostedApps)
1540 },
[email protected]a0ef5212013-10-15 18:08:261541 {
[email protected]912576e2013-10-21 10:33:131542 "enable-ephemeral-apps",
1543 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_NAME,
1544 IDS_FLAGS_ENABLE_EPHEMERAL_APPS_DESCRIPTION,
[email protected]c04b3332014-05-30 10:43:201545 kOsAll,
[email protected]912576e2013-10-21 10:33:131546 SINGLE_VALUE_TYPE(switches::kEnableEphemeralApps)
1547 },
1548 {
[email protected]5ec67052013-12-19 05:40:211549 "enable-linkable-ephemeral-apps",
1550 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_NAME,
1551 IDS_FLAGS_ENABLE_LINKABLE_EPHEMERAL_APPS_DESCRIPTION,
[email protected]c04b3332014-05-30 10:43:201552 kOsAll,
[email protected]5ec67052013-12-19 05:40:211553 SINGLE_VALUE_TYPE(switches::kEnableLinkableEphemeralApps)
1554 },
1555 {
[email protected]7d8056d2014-04-14 15:55:211556 "enable-service-worker-sync",
1557 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_NAME,
1558 IDS_FLAGS_ENABLE_SERVICE_WORKER_SYNC_DESCRIPTION,
1559 kOsAll,
1560 SINGLE_VALUE_TYPE(switches::kEnableServiceWorkerSync)
1561 },
[email protected]dfb66c522013-10-22 19:46:321562#if defined(OS_ANDROID)
1563 {
1564 "disable-click-delay",
1565 IDS_FLAGS_DISABLE_CLICK_DELAY_NAME,
1566 IDS_FLAGS_DISABLE_CLICK_DELAY_DESCRIPTION,
1567 kOsAndroid,
1568 // Java-only switch: CommandLine.DISABLE_CLICK_DELAY
1569 SINGLE_VALUE_TYPE("disable-click-delay")
1570 },
1571#endif
[email protected]5a606592014-01-31 10:32:311572#if defined(OS_MACOSX)
[email protected]c2c84ab2013-11-18 03:05:091573 {
1574 "enable-translate-new-ux",
1575 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_NAME,
1576 IDS_FLAGS_ENABLE_TRANSLATE_NEW_UX_DESCRIPTION,
[email protected]5a606592014-01-31 10:32:311577 kOsMac,
[email protected]c2c84ab2013-11-18 03:05:091578 SINGLE_VALUE_TYPE(switches::kEnableTranslateNewUX)
1579 },
[email protected]5a606592014-01-31 10:32:311580#endif
[email protected]c4f51d22013-11-05 03:11:261581#if defined(TOOLKIT_VIEWS)
1582 {
[email protected]88b47ad72013-11-21 03:34:381583 "disable-views-rect-based-targeting", // FLAGS:RECORD_UMA
1584 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_NAME,
1585 IDS_FLAGS_DISABLE_VIEWS_RECT_BASED_TARGETING_DESCRIPTION,
[email protected]42f5fe542014-07-25 17:59:331586 kOsCrOS | kOsWin | kOsLinux,
[email protected]88b47ad72013-11-21 03:34:381587 SINGLE_VALUE_TYPE(views::switches::kDisableViewsRectBasedTargeting)
[email protected]c4f51d22013-11-05 03:11:261588 },
1589#endif
thestigb012bc3d2014-09-18 22:57:131590#if defined(ENABLE_EXTENSIONS)
[email protected]9f268072013-11-07 00:02:151591 {
1592 "enable-apps-show-on-first-paint",
1593 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_NAME,
1594 IDS_FLAGS_ENABLE_APPS_SHOW_ON_FIRST_PAINT_DESCRIPTION,
1595 kOsDesktop,
[email protected]6fa202452014-08-19 05:34:071596 SINGLE_VALUE_TYPE(extensions::switches::kEnableAppsShowOnFirstPaint)
[email protected]9f268072013-11-07 00:02:151597 },
thestigb012bc3d2014-09-18 22:57:131598#endif
[email protected]12271632013-11-26 03:06:391599 {
[email protected]4d7552f2014-03-04 04:53:331600 "enhanced-bookmarks-experiment",
[email protected]12271632013-11-26 03:06:391601 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1602 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
kkimlabseedd8b82014-09-05 13:01:091603 kOsDesktop | kOsAndroid,
[email protected]4d7552f2014-03-04 04:53:331604 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(
1605 switches::kEnhancedBookmarksExperiment, "1",
1606 switches::kEnhancedBookmarksExperiment, "0")
[email protected]12271632013-11-26 03:06:391607 },
[email protected]cb13d462014-03-14 21:38:581608 {
1609 "manual-enhanced-bookmarks",
1610 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1611 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
kkimlabseedd8b82014-09-05 13:01:091612 kOsDesktop | kOsAndroid,
[email protected]cb13d462014-03-14 21:38:581613 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarks)
1614 },
1615 {
1616 "manual-enhanced-bookmarks-optout",
1617 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_NAME,
1618 IDS_FLAGS_ENABLE_ENHANCED_BOOKMARKS_DESCRIPTION,
kkimlabseedd8b82014-09-05 13:01:091619 kOsDesktop | kOsAndroid,
[email protected]cb13d462014-03-14 21:38:581620 SINGLE_VALUE_TYPE(switches::kManualEnhancedBookmarksOptout)
1621 },
[email protected]d5874f12013-12-05 04:30:001622#if defined(OS_ANDROID)
1623 {
1624 "enable-zero-suggest-experiment",
1625 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_NAME,
1626 IDS_FLAGS_ZERO_SUGGEST_EXPERIMENT_DESCRIPTION,
1627 kOsAndroid,
1628 MULTI_VALUE_TYPE(kZeroSuggestExperimentsChoices)
[email protected]1a82f7372013-12-06 12:46:521629 },
Yaron Friedman7f37900b2014-08-26 16:37:261630 {
1631 "enable-reader-mode-toolbar-icon",
1632 IDS_FLAGS_READER_MODE_EXPERIMENT_NAME,
1633 IDS_FLAGS_READER_MODE_EXPERIMENT_DESCRIPTION,
1634 kOsAndroid,
1635 SINGLE_VALUE_TYPE(switches::kEnableReaderModeToolbarIcon)
1636 },
[email protected]d5874f12013-12-05 04:30:001637#endif
[email protected]1a82f7372013-12-06 12:46:521638 {
1639 "num-raster-threads",
1640 IDS_FLAGS_NUM_RASTER_THREADS_NAME,
1641 IDS_FLAGS_NUM_RASTER_THREADS_DESCRIPTION,
1642 kOsAll,
1643 MULTI_VALUE_TYPE(kNumRasterThreadsChoices)
[email protected]dc920d62013-12-13 22:12:471644 },
1645 {
[email protected]5d58f952014-05-20 21:12:471646 "origin-chip-in-omnibox",
[email protected]dc920d62013-12-13 22:12:471647 IDS_FLAGS_ORIGIN_CHIP_NAME,
1648 IDS_FLAGS_ORIGIN_CHIP_DESCRIPTION,
[email protected]393a6462014-04-28 15:28:271649 kOsCrOS | kOsMac | kOsWin | kOsLinux,
[email protected]5d58f952014-05-20 21:12:471650 MULTI_VALUE_TYPE(kOriginChipChoices)
[email protected]7a54bf4b2014-02-06 19:21:541651 },
1652 {
[email protected]dc920d62013-12-13 22:12:471653 "search-button-in-omnibox",
1654 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_NAME,
1655 IDS_FLAGS_SEARCH_BUTTON_IN_OMNIBOX_DESCRIPTION,
[email protected]266cd0a2014-05-07 19:55:051656 kOsCrOS | kOsMac | kOsWin | kOsLinux,
[email protected]dc920d62013-12-13 22:12:471657 MULTI_VALUE_TYPE(kSearchButtonInOmniboxChoices)
[email protected]58bc1c32013-12-16 22:52:071658 },
1659 {
[email protected]b785898a2014-02-05 06:54:431660 "disable-ignore-autocomplete-off",
1661 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_NAME,
1662 IDS_FLAGS_DISABLE_IGNORE_AUTOCOMPLETE_OFF_DESCRIPTION,
[email protected]58bc1c32013-12-16 22:52:071663 kOsAll,
[email protected]b785898a2014-02-05 06:54:431664 SINGLE_VALUE_TYPE(autofill::switches::kDisableIgnoreAutocompleteOff)
[email protected]7cffac72013-12-20 20:21:501665 },
[email protected]7cffac72013-12-20 20:21:501666 {
[email protected]24ad58782014-01-23 23:43:451667 "enable-permissions-bubbles",
1668 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_NAME,
1669 IDS_FLAGS_ENABLE_PERMISSIONS_BUBBLES_DESCRIPTION,
[email protected]4e6d54a2014-06-27 14:32:121670 kOsCrOS | kOsMac | kOsWin | kOsLinux,
[email protected]7d198222014-06-17 08:24:221671 ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePermissionsBubbles,
1672 switches::kDisablePermissionsBubbles)
[email protected]24ad58782014-01-23 23:43:451673 },
[email protected]4d11b08b2014-01-27 22:19:071674 {
[email protected]546d8d32014-04-30 15:40:461675 "enable-session-crashed-bubble",
1676 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_NAME,
1677 IDS_FLAGS_ENABLE_SESSION_CRASHED_BUBBLE_DESCRIPTION,
1678 kOsWin | kOsLinux,
[email protected]3d990b72014-05-27 21:16:131679 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSessionCrashedBubble,
1680 switches::kDisableSessionCrashedBubble)
[email protected]546d8d32014-04-30 15:40:461681 },
1682 {
[email protected]1231adf2014-01-31 02:22:331683 "out-of-process-pdf",
1684 IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
1685 IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
1686 kOsDesktop,
1687 SINGLE_VALUE_TYPE(switches::kOutOfProcessPdf)
1688 },
[email protected]181624c2014-02-04 17:03:341689#if defined(OS_ANDROID)
1690 {
[email protected]276bdfa52014-02-24 14:03:091691 "disable-cast",
1692 IDS_FLAGS_DISABLE_CAST_NAME,
1693 IDS_FLAGS_DISABLE_CAST_DESCRIPTION,
[email protected]30a8cec92014-02-24 10:09:091694 kOsAndroid,
[email protected]276bdfa52014-02-24 14:03:091695 SINGLE_VALUE_TYPE(switches::kDisableCast)
[email protected]30a8cec92014-02-24 10:09:091696 },
[email protected]99af9382014-02-12 09:02:551697 {
1698 "prefetch-search-results",
1699 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_NAME,
1700 IDS_FLAGS_PREFETCH_SEARCH_RESULTS_DESCRIPTION,
[email protected]8ca7e09c2014-06-17 18:42:031701 kOsAndroid,
[email protected]99af9382014-02-12 09:02:551702 SINGLE_VALUE_TYPE(switches::kPrefetchSearchResults)
1703 },
[email protected]8ca7e09c2014-06-17 18:42:031704#endif
[email protected]9bd76572014-02-17 05:17:311705#if defined(ENABLE_APP_LIST)
1706 {
1707 "enable-experimental-app-list",
1708 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_NAME,
1709 IDS_FLAGS_ENABLE_EXPERIMENTAL_APP_LIST_DESCRIPTION,
1710 kOsWin | kOsLinux | kOsCrOS,
1711 SINGLE_VALUE_TYPE(app_list::switches::kEnableExperimentalAppList)
1712 },
[email protected]b18d51182014-03-13 10:38:271713 {
[email protected]61bce6992014-05-02 17:35:571714 "enable-centered-app-list",
1715 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_NAME,
1716 IDS_FLAGS_ENABLE_CENTERED_APP_LIST_DESCRIPTION,
[email protected]b18d51182014-03-13 10:38:271717 kOsWin | kOsLinux | kOsCrOS,
[email protected]61bce6992014-05-02 17:35:571718 SINGLE_VALUE_TYPE(app_list::switches::kEnableCenteredAppList)
[email protected]b18d51182014-03-13 10:38:271719 },
[email protected]9bd76572014-02-17 05:17:311720#endif
[email protected]f42cffb2014-03-08 18:03:251721 {
1722 "touch-scrolling-mode",
1723 IDS_FLAGS_TOUCH_SCROLLING_MODE_NAME,
1724 IDS_FLAGS_TOUCH_SCROLLING_MODE_DESCRIPTION,
1725 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1726 MULTI_VALUE_TYPE(kTouchScrollingModeChoices)
1727 },
[email protected]67c5a212014-03-17 12:28:001728 {
jdduke2eee6cb2014-09-25 17:02:211729 "disable-threaded-scrolling",
1730 IDS_FLAGS_DISABLE_THREADED_SCROLLING_NAME,
1731 IDS_FLAGS_DISABLE_THREADED_SCROLLING_DESCRIPTION,
1732 kOsWin | kOsLinux | kOsCrOS | kOsAndroid,
1733 SINGLE_VALUE_TYPE(switches::kDisableThreadedScrolling)
1734 },
1735 {
[email protected]67c5a212014-03-17 12:28:001736 "bleeding-edge-renderer-mode",
1737 IDS_FLAGS_BLEEDING_RENDERER_NAME,
1738 IDS_FLAGS_BLEEDING_RENDERER_DESCRIPTION,
[email protected]a8a97512014-03-24 18:28:201739 kOsAndroid,
[email protected]67c5a212014-03-17 12:28:001740 SINGLE_VALUE_TYPE(switches::kEnableBleedingEdgeRenderingFastPaths)
1741 },
[email protected]8a585cb2014-03-21 17:13:521742 {
1743 "enable-settings-window",
1744 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_NAME,
1745 IDS_FLAGS_ENABLE_SETTINGS_WINDOW_DESCRIPTION,
1746 kOsDesktop,
[email protected]aae79572014-06-13 00:42:581747 MULTI_VALUE_TYPE(kEnableSettingsWindowChoices)
[email protected]8a585cb2014-03-21 17:13:521748 },
[email protected]812b82a2014-05-15 19:01:381749#if defined(OS_ANDROID)
1750 {
1751 "enable-instant-search-clicks",
1752 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_NAME,
1753 IDS_FLAGS_ENABLE_INSTANT_SEARCH_CLICKS_DESCRIPTION,
1754 kOsAndroid,
1755 SINGLE_VALUE_TYPE(switches::kEnableInstantSearchClicks)
1756 },
1757#endif
[email protected]4dffb662014-03-31 11:31:221758 {
1759 "enable-save-password-bubble",
1760 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_NAME,
1761 IDS_FLAGS_ENABLE_SAVE_PASSWORD_BUBBLE_DESCRIPTION,
dconnelly35f985b32014-08-29 10:40:551762 kOsWin | kOsLinux | kOsCrOS | kOsMac,
[email protected]ea61c082014-04-07 16:57:241763 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSavePasswordBubble,
1764 switches::kDisableSavePasswordBubble)
[email protected]9804dad9102014-04-01 09:34:181765 },
[email protected]7fe71f02014-04-26 00:47:561766 // TODO(tyoshino): Remove this temporary flag and command line switch. See
1767 // crbug.com/366483 for the target milestone.
1768 {
1769 "allow-insecure-websocket-from-https-origin",
1770 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_NAME,
1771 IDS_FLAGS_ALLOW_INSECURE_WEBSOCKET_FROM_HTTPS_ORIGIN_DESCRIPTION,
1772 kOsAll,
1773 SINGLE_VALUE_TYPE(switches::kAllowInsecureWebSocketFromHttpsOrigin)
1774 },
[email protected]64505f72014-04-29 11:07:521775 {
1776 "enable-apps-file-associations",
1777 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_NAME,
1778 IDS_FLAGS_ENABLE_APPS_FILE_ASSOCIATIONS_DESCRIPTION,
1779 kOsMac,
1780 SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)
1781 },
[email protected]0443e082014-04-30 04:52:501782#if defined(OS_ANDROID)
1783 {
1784 "enable-embeddedsearch-api",
1785 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_NAME,
1786 IDS_FLAGS_ENABLE_EMBEDDEDSEARCH_API_DESCRIPTION,
1787 kOsAndroid,
1788 SINGLE_VALUE_TYPE(switches::kEnableEmbeddedSearchAPI)
1789 },
[email protected]1d1349292014-05-02 05:22:331790 {
1791 "enable-app-install-alerts",
1792 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_NAME,
1793 IDS_FLAGS_ENABLE_APP_INSTALL_ALERTS_DESCRIPTION,
1794 kOsAndroid,
1795 SINGLE_VALUE_TYPE(switches::kEnableAppInstallAlerts)
1796 },
[email protected]0443e082014-04-30 04:52:501797#endif
[email protected]b242b142014-05-07 14:48:491798 {
1799 "distance-field-text",
1800 IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
1801 IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION,
1802 kOsAll,
1803 MULTI_VALUE_TYPE(kDistanceFieldTextChoices)
1804 },
[email protected]6f8ede32014-05-09 13:58:451805 {
1806 "extension-content-verification",
1807 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_NAME,
1808 IDS_FLAGS_EXTENSION_CONTENT_VERIFICATION_DESCRIPTION,
1809 kOsDesktop,
1810 MULTI_VALUE_TYPE(kExtensionContentVerificationChoices)
1811 },
[email protected]8f374ce2014-05-08 23:51:521812#if defined(USE_AURA)
1813 {
1814 "text-input-focus-manager",
1815 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_NAME,
1816 IDS_FLAGS_TEXT_INPUT_FOCUS_MANAGER_DESCRIPTION,
1817 kOsCrOS | kOsLinux | kOsWin,
1818 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTextInputFocusManager,
1819 switches::kDisableTextInputFocusManager)
1820 },
1821#endif
thestigb012bc3d2014-09-18 22:57:131822#if defined(ENABLE_EXTENSIONS)
[email protected]98585412014-05-13 19:01:371823 {
1824 "extension-active-script-permission",
1825 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_NAME,
1826 IDS_FLAGS_USER_CONSENT_FOR_EXTENSION_SCRIPTS_DESCRIPTION,
1827 kOsAll,
1828 SINGLE_VALUE_TYPE(extensions::switches::kEnableScriptsRequireAction)
1829 },
thestigb012bc3d2014-09-18 22:57:131830#endif
[email protected]52848022014-05-22 19:01:071831 {
[email protected]e79cec22014-07-26 16:20:291832 "harfbuzz-rendertext",
1833 IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME,
1834 IDS_FLAGS_HARFBUZZ_RENDERTEXT_DESCRIPTION,
[email protected]52848022014-05-22 19:01:071835 kOsDesktop,
[email protected]e79cec22014-07-26 16:20:291836 ENABLE_DISABLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText,
1837 switches::kDisableHarfBuzzRenderText)
[email protected]52848022014-05-22 19:01:071838 },
[email protected]1c790df2014-06-03 22:51:121839#if defined(OS_ANDROID)
1840 {
[email protected]85f710c2014-06-20 17:29:111841 "answers-in-suggest",
[email protected]1c790df2014-06-03 22:51:121842 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_NAME,
1843 IDS_FLAGS_ENABLE_ANSWERS_IN_SUGGEST_DESCRIPTION,
1844 kOsAndroid,
[email protected]85f710c2014-06-20 17:29:111845 MULTI_VALUE_TYPE(kAnswersInSuggestChoices)
[email protected]1c790df2014-06-03 22:51:121846 },
1847#endif
[email protected]3dfb4012014-06-11 07:33:381848#if defined(OS_ANDROID)
1849 {
1850 "enable-data-reduction-proxy-dev",
1851 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_NAME,
1852 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_DEV_DESCRIPTION,
1853 kOsAndroid,
1854 ENABLE_DISABLE_VALUE_TYPE(
1855 data_reduction_proxy::switches::kEnableDataReductionProxyDev,
1856 data_reduction_proxy::switches::kDisableDataReductionProxyDev)
1857 },
1858#endif
[email protected]48e67ee72014-07-01 06:53:431859 {
[email protected]49b05f82014-08-11 09:16:521860 "enable-experimental-hotwording",
1861 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_NAME,
1862 IDS_FLAGS_ENABLE_EXPERIMENTAL_HOTWORDING_DESCRIPTION,
1863 kOsDesktop,
1864 SINGLE_VALUE_TYPE(switches::kEnableExperimentalHotwording)
[email protected]48e67ee72014-07-01 06:53:431865 },
thestigb012bc3d2014-09-18 22:57:131866#if defined(ENABLE_EXTENSIONS)
[email protected]409d9202014-07-08 01:32:411867 {
Ken Rockot19f0e7f2014-09-15 23:54:271868 "enable-embedded-extension-options",
1869 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
1870 IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
1871 kOsDesktop,
1872 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1873 },
thestigb012bc3d2014-09-18 22:57:131874#endif
Ken Rockot19f0e7f2014-09-15 23:54:271875 {
[email protected]3ba3eb712014-07-16 07:47:191876 "enable-website-settings-manager",
1877 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1878 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1879 kOsDesktop,
1880 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1881 },
[email protected]c5bbe0e2014-08-01 23:23:301882 {
1883 "remember-cert-error-decisions",
1884 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1885 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1886 kOsAll,
1887 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1888 },
[email protected]bdbf5cb2014-08-07 23:38:081889 {
1890 "enable-drop-sync-credential",
1891 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_NAME,
1892 IDS_FLAGS_ENABLE_DROP_SYNC_CREDENTIAL_DESCRIPTION,
1893 kOsAll,
1894 MULTI_VALUE_TYPE(kEnableDropSyncCredentialChoices)
[email protected]2f0b7e0f2014-08-15 02:18:231895 },
thestigb012bc3d2014-09-18 22:57:131896#if defined(ENABLE_EXTENSIONS)
[email protected]2f0b7e0f2014-08-15 02:18:231897 {
1898 "enable-extension-action-redesign",
1899 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_NAME,
1900 IDS_FLAGS_ENABLE_EXTENSION_ACTION_REDESIGN_DESCRIPTION,
1901 kOsWin | kOsLinux | kOsCrOS,
1902 SINGLE_VALUE_TYPE(extensions::switches::kEnableExtensionActionRedesign)
1903 },
thestigb012bc3d2014-09-18 22:57:131904#endif
[email protected]524dd702014-08-16 00:00:451905 {
1906 "autofill-sync-credential",
1907 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_NAME,
1908 IDS_FLAGS_AUTOFILL_SYNC_CREDENTIAL_DESCRIPTION,
1909 kOsAll,
1910 MULTI_VALUE_TYPE(kAutofillSyncCredentialChoices)
1911 },
juyika7be5192014-08-26 23:01:041912#if !defined(OS_ANDROID)
1913 {
1914 "enable-message-center-always-scroll-up-upon-notification-removal",
1915 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_NAME,
1916 IDS_FLAGS_ENABLE_MESSAGE_CENTER_ALWAYS_SCROLL_UP_UPON_REMOVAL_DESCRIPTION,
1917 kOsDesktop,
1918 SINGLE_VALUE_TYPE(
1919 switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval)
1920 },
1921#endif
chirantan6e3f35b2014-09-16 02:06:111922#if defined(OS_CHROMEOS)
1923 {
1924 "wake-on-packets",
1925 IDS_FLAGS_WAKE_ON_PACKETS_NAME,
1926 IDS_FLAGS_WAKE_ON_PACKETS_DESCRIPTION,
1927 kOsCrOSOwnerOnly,
1928 SINGLE_VALUE_TYPE(chromeos::switches::kWakeOnPackets)
1929 },
1930#endif // OS_CHROMEOS
bengr2989fef2014-09-18 21:47:381931 {
1932 "enable-data-reduction-proxy-alt",
1933 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_NAME,
1934 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_ALTERNATIVE_DESCRIPTION,
1935 kOsAndroid,
1936 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
1937 kEnableDataReductionProxyAlt)
1938 },
miu094342f2014-09-26 03:09:461939#if defined(USE_AURA)
1940 {
1941 "enable-tab-audio-muting",
1942 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_NAME,
1943 IDS_FLAGS_ENABLE_TAB_AUDIO_MUTING_DESCRIPTION,
1944 kOsWin | kOsLinux | kOsCrOS,
1945 SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)
1946 },
1947#endif // defined(USE_AURA)
mkwst531d29fa2014-10-02 09:42:071948 {
1949 "enable-credential-manager-api",
1950 IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME,
1951 IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION,
1952 kOsAll,
1953 SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)
1954 },
tommycli3c366b32014-10-06 23:05:461955#if defined(ENABLE_PLUGINS)
1956 {
1957 "enable-plugin-power-saver",
1958 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME,
1959 IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION,
1960 kOsDesktop,
1961 SINGLE_VALUE_TYPE(switches::kEnablePluginPowerSaver)
1962 },
1963#endif
kelvinp3b73f5092014-10-07 21:49:391964#if defined(OS_CHROMEOS)
1965 {
1966 "enable-remote-assistance",
1967 IDS_FLAGS_ENABLE_REMOTE_ASSISTANCE_NAME,
1968 IDS_FLAGS_ENABLE_REMOTE_ASSISTANCE_DESCRIPTION,
1969 kOsCrOS,
1970 SINGLE_VALUE_TYPE(extensions::switches::kEnableRemoteAssistance)
1971 },
1972#endif // defined(OS_CHROMEOS)
[email protected]4b66a7d2014-08-15 17:13:311973 // NOTE: Adding new command-line switches requires adding corresponding
1974 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
1975 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
[email protected]a0e4b072011-08-17 01:47:071976};
[email protected]ad2a3ded2010-08-27 13:19:051977
[email protected]a314ee5a2010-10-26 21:23:281978const Experiment* experiments = kExperiments;
1979size_t num_experiments = arraysize(kExperiments);
1980
[email protected]e2ddbc92010-10-15 20:02:071981// Stores and encapsulates the little state that about:flags has.
1982class FlagsState {
1983 public:
1984 FlagsState() : needs_restart_(false) {}
[email protected]e6d1c4f2013-06-12 17:37:401985 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
[email protected]578f2092013-09-16 17:16:211986 CommandLine* command_line,
1987 SentinelsMode sentinels);
[email protected]e2ddbc92010-10-15 20:02:071988 bool IsRestartNeededToCommitChanges();
1989 void SetExperimentEnabled(
[email protected]e6d1c4f2013-06-12 17:37:401990 FlagsStorage* flags_storage,
1991 const std::string& internal_name,
1992 bool enable);
[email protected]e2ddbc92010-10-15 20:02:071993 void RemoveFlagsSwitches(
1994 std::map<std::string, CommandLine::StringType>* switch_list);
[email protected]e6d1c4f2013-06-12 17:37:401995 void ResetAllFlags(FlagsStorage* flags_storage);
[email protected]e2ddbc92010-10-15 20:02:071996 void reset();
1997
1998 // Returns the singleton instance of this class
[email protected]8e8bb6d2010-12-13 08:18:551999 static FlagsState* GetInstance() {
[email protected]e2ddbc92010-10-15 20:02:072000 return Singleton<FlagsState>::get();
2001 }
2002
2003 private:
2004 bool needs_restart_;
[email protected]a82744532011-02-11 16:15:532005 std::map<std::string, std::string> flags_switches_;
[email protected]e2ddbc92010-10-15 20:02:072006
2007 DISALLOW_COPY_AND_ASSIGN(FlagsState);
2008};
2009
[email protected]8a6ff28d2010-12-02 16:35:192010// Adds the internal names for the specified experiment to |names|.
2011void AddInternalName(const Experiment& e, std::set<std::string>* names) {
2012 if (e.type == Experiment::SINGLE_VALUE) {
2013 names->insert(e.internal_name);
2014 } else {
[email protected]83e9fa702013-02-25 19:30:442015 DCHECK(e.type == Experiment::MULTI_VALUE ||
2016 e.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]8a6ff28d2010-12-02 16:35:192017 for (int i = 0; i < e.num_choices; ++i)
[email protected]83e9fa702013-02-25 19:30:442018 names->insert(e.NameForChoice(i));
[email protected]8a6ff28d2010-12-02 16:35:192019 }
2020}
2021
[email protected]28e35af2011-02-09 12:56:222022// Confirms that an experiment is valid, used in a DCHECK in
2023// SanitizeList below.
2024bool ValidateExperiment(const Experiment& e) {
2025 switch (e.type) {
2026 case Experiment::SINGLE_VALUE:
2027 DCHECK_EQ(0, e.num_choices);
2028 DCHECK(!e.choices);
2029 break;
2030 case Experiment::MULTI_VALUE:
2031 DCHECK_GT(e.num_choices, 0);
2032 DCHECK(e.choices);
[email protected]a82744532011-02-11 16:15:532033 DCHECK(e.choices[0].command_line_switch);
2034 DCHECK_EQ('\0', e.choices[0].command_line_switch[0]);
[email protected]28e35af2011-02-09 12:56:222035 break;
[email protected]83e9fa702013-02-25 19:30:442036 case Experiment::ENABLE_DISABLE_VALUE:
2037 DCHECK_EQ(3, e.num_choices);
2038 DCHECK(!e.choices);
2039 DCHECK(e.command_line_switch);
2040 DCHECK(e.command_line_value);
2041 DCHECK(e.disable_command_line_switch);
2042 DCHECK(e.disable_command_line_value);
2043 break;
[email protected]28e35af2011-02-09 12:56:222044 default:
2045 NOTREACHED();
2046 }
2047 return true;
2048}
2049
[email protected]ad2a3ded2010-08-27 13:19:052050// Removes all experiments from prefs::kEnabledLabsExperiments that are
2051// unknown, to prevent this list to become very long as experiments are added
2052// and removed.
[email protected]e6d1c4f2013-06-12 17:37:402053void SanitizeList(FlagsStorage* flags_storage) {
[email protected]ad2a3ded2010-08-27 13:19:052054 std::set<std::string> known_experiments;
[email protected]28e35af2011-02-09 12:56:222055 for (size_t i = 0; i < num_experiments; ++i) {
2056 DCHECK(ValidateExperiment(experiments[i]));
[email protected]8a6ff28d2010-12-02 16:35:192057 AddInternalName(experiments[i], &known_experiments);
[email protected]28e35af2011-02-09 12:56:222058 }
[email protected]ad2a3ded2010-08-27 13:19:052059
[email protected]07d666d2013-07-21 23:56:262060 std::set<std::string> enabled_experiments = flags_storage->GetFlags();
[email protected]ad2a3ded2010-08-27 13:19:052061
[email protected]09f3fde82014-05-14 15:08:152062 std::set<std::string> new_enabled_experiments =
2063 base::STLSetIntersection<std::set<std::string> >(
2064 known_experiments, enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052065
[email protected]07d666d2013-07-21 23:56:262066 if (new_enabled_experiments != enabled_experiments)
[email protected]e6d1c4f2013-06-12 17:37:402067 flags_storage->SetFlags(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052068}
2069
[email protected]1a47d7e2010-10-15 00:37:242070void GetSanitizedEnabledFlags(
[email protected]e6d1c4f2013-06-12 17:37:402071 FlagsStorage* flags_storage, std::set<std::string>* result) {
2072 SanitizeList(flags_storage);
2073 *result = flags_storage->GetFlags();
[email protected]ad2a3ded2010-08-27 13:19:052074}
2075
yefimff0c52f2014-09-24 20:19:502076bool SkipConditionalExperiment(const Experiment& experiment,
2077 FlagsStorage* flags_storage) {
[email protected]4d7552f2014-03-04 04:53:332078 if (experiment.internal_name ==
2079 std::string("enhanced-bookmarks-experiment")) {
kkimlabsb3558ee2014-09-29 21:28:372080#if defined(OS_ANDROID)
2081 // On Android, user can opt in.
2082 return false;
2083#else
[email protected]4d7552f2014-03-04 04:53:332084 CommandLine* command_line = CommandLine::ForCurrentProcess();
2085 // Dont't skip experiment if it has non default value.
2086 // It means user selected it.
2087 if (command_line->HasSwitch(switches::kEnhancedBookmarksExperiment))
2088 return false;
2089
yefimff0c52f2014-09-24 20:19:502090 return !IsEnhancedBookmarksExperimentEnabled(flags_storage);
kkimlabsb3558ee2014-09-29 21:28:372091#endif
[email protected]12271632013-11-26 03:06:392092 }
kkimlabs948ce92d2014-09-09 09:06:422093
[email protected]cb13d462014-03-14 21:38:582094 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2095 (experiment.internal_name ==
2096 std::string("manual-enhanced-bookmarks-optout"))) {
2097 return true;
2098 }
[email protected]4d7552f2014-03-04 04:53:332099
[email protected]3dfb4012014-06-11 07:33:382100#if defined(OS_ANDROID)
bolian44ee3baf2014-10-01 02:41:542101 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
[email protected]3dfb4012014-06-11 07:33:382102 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
bolian44ee3baf2014-10-01 02:41:542103 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA &&
[email protected]3dfb4012014-06-11 07:33:382104 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2105 return true;
2106 }
2107#endif
2108
[email protected]12271632013-11-26 03:06:392109 return false;
2110}
2111
2112
[email protected]a314ee5a2010-10-26 21:23:282113// Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2114// enabled on the current platform.
2115void GetSanitizedEnabledFlagsForCurrentPlatform(
[email protected]e6d1c4f2013-06-12 17:37:402116 FlagsStorage* flags_storage, std::set<std::string>* result) {
2117 GetSanitizedEnabledFlags(flags_storage, result);
[email protected]a314ee5a2010-10-26 21:23:282118
2119 // Filter out any experiments that aren't enabled on the current platform. We
2120 // don't remove these from prefs else syncing to a platform with a different
2121 // set of experiments would be lossy.
2122 std::set<std::string> platform_experiments;
2123 int current_platform = GetCurrentPlatform();
2124 for (size_t i = 0; i < num_experiments; ++i) {
2125 if (experiments[i].supported_platforms & current_platform)
[email protected]8a6ff28d2010-12-02 16:35:192126 AddInternalName(experiments[i], &platform_experiments);
[email protected]37736bd2013-04-18 11:53:582127#if defined(OS_CHROMEOS)
2128 if (experiments[i].supported_platforms & kOsCrOSOwnerOnly)
2129 AddInternalName(experiments[i], &platform_experiments);
2130#endif
[email protected]a314ee5a2010-10-26 21:23:282131 }
2132
[email protected]09f3fde82014-05-14 15:08:152133 std::set<std::string> new_enabled_experiments =
2134 base::STLSetIntersection<std::set<std::string> >(
2135 platform_experiments, *result);
[email protected]a314ee5a2010-10-26 21:23:282136
2137 result->swap(new_enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052138}
2139
[email protected]8a6ff28d2010-12-02 16:35:192140// Returns the Value representing the choice data in the specified experiment.
[email protected]5bcdd99d2013-12-23 18:28:302141base::Value* CreateChoiceData(
2142 const Experiment& experiment,
2143 const std::set<std::string>& enabled_experiments) {
[email protected]83e9fa702013-02-25 19:30:442144 DCHECK(experiment.type == Experiment::MULTI_VALUE ||
2145 experiment.type == Experiment::ENABLE_DISABLE_VALUE);
[email protected]5bcdd99d2013-12-23 18:28:302146 base::ListValue* result = new base::ListValue;
[email protected]8a6ff28d2010-12-02 16:35:192147 for (int i = 0; i < experiment.num_choices; ++i) {
[email protected]5bcdd99d2013-12-23 18:28:302148 base::DictionaryValue* value = new base::DictionaryValue;
[email protected]83e9fa702013-02-25 19:30:442149 const std::string name = experiment.NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:192150 value->SetString("internal_name", name);
[email protected]83e9fa702013-02-25 19:30:442151 value->SetString("description", experiment.DescriptionForChoice(i));
[email protected]28e35af2011-02-09 12:56:222152 value->SetBoolean("selected", enabled_experiments.count(name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:192153 result->Append(value);
2154 }
2155 return result;
2156}
2157
[email protected]e2ddbc92010-10-15 20:02:072158} // namespace
2159
[email protected]83e9fa702013-02-25 19:30:442160std::string Experiment::NameForChoice(int index) const {
2161 DCHECK(type == Experiment::MULTI_VALUE ||
2162 type == Experiment::ENABLE_DISABLE_VALUE);
2163 DCHECK_LT(index, num_choices);
2164 return std::string(internal_name) + testing::kMultiSeparator +
2165 base::IntToString(index);
2166}
2167
[email protected]96920152013-12-04 21:00:162168base::string16 Experiment::DescriptionForChoice(int index) const {
[email protected]83e9fa702013-02-25 19:30:442169 DCHECK(type == Experiment::MULTI_VALUE ||
2170 type == Experiment::ENABLE_DISABLE_VALUE);
2171 DCHECK_LT(index, num_choices);
2172 int description_id;
2173 if (type == Experiment::ENABLE_DISABLE_VALUE) {
2174 const int kEnableDisableDescriptionIds[] = {
2175 IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT,
2176 IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED,
2177 IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED,
2178 };
2179 description_id = kEnableDisableDescriptionIds[index];
2180 } else {
2181 description_id = choices[index].description_id;
2182 }
2183 return l10n_util::GetStringUTF16(description_id);
2184}
2185
[email protected]e6d1c4f2013-06-12 17:37:402186void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
[email protected]578f2092013-09-16 17:16:212187 CommandLine* command_line,
2188 SentinelsMode sentinels) {
[email protected]e6d1c4f2013-06-12 17:37:402189 FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage,
[email protected]578f2092013-09-16 17:16:212190 command_line,
2191 sentinels);
[email protected]ad2a3ded2010-08-27 13:19:052192}
2193
[email protected]6d98abf2013-06-17 23:35:512194bool AreSwitchesIdenticalToCurrentCommandLine(
[email protected]4b66a7d2014-08-15 17:13:312195 const CommandLine& new_cmdline,
2196 const CommandLine& active_cmdline,
2197 std::set<CommandLine::StringType>* out_difference) {
[email protected]6d98abf2013-06-17 23:35:512198 std::set<CommandLine::StringType> new_flags =
2199 ExtractFlagsFromCommandLine(new_cmdline);
2200 std::set<CommandLine::StringType> active_flags =
2201 ExtractFlagsFromCommandLine(active_cmdline);
2202
[email protected]4b66a7d2014-08-15 17:13:312203 bool result = false;
[email protected]6d98abf2013-06-17 23:35:512204 // Needed because std::equal doesn't check if the 2nd set is empty.
[email protected]4b66a7d2014-08-15 17:13:312205 if (new_flags.size() == active_flags.size()) {
2206 result =
2207 std::equal(new_flags.begin(), new_flags.end(), active_flags.begin());
2208 }
[email protected]6d98abf2013-06-17 23:35:512209
[email protected]4b66a7d2014-08-15 17:13:312210 if (out_difference && !result) {
2211 std::set_symmetric_difference(
2212 new_flags.begin(),
2213 new_flags.end(),
2214 active_flags.begin(),
2215 active_flags.end(),
2216 std::inserter(*out_difference, out_difference->begin()));
2217 }
2218
2219 return result;
[email protected]6d98abf2013-06-17 23:35:512220}
2221
[email protected]e6d1c4f2013-06-12 17:37:402222void GetFlagsExperimentsData(FlagsStorage* flags_storage,
[email protected]ee28495a2013-05-20 04:10:522223 FlagAccess access,
2224 base::ListValue* supported_experiments,
2225 base::ListValue* unsupported_experiments) {
[email protected]ad2a3ded2010-08-27 13:19:052226 std::set<std::string> enabled_experiments;
[email protected]e6d1c4f2013-06-12 17:37:402227 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052228
2229 int current_platform = GetCurrentPlatform();
2230
[email protected]a314ee5a2010-10-26 21:23:282231 for (size_t i = 0; i < num_experiments; ++i) {
2232 const Experiment& experiment = experiments[i];
yefimff0c52f2014-09-24 20:19:502233 if (SkipConditionalExperiment(experiment, flags_storage))
[email protected]12271632013-11-26 03:06:392234 continue;
[email protected]ad2a3ded2010-08-27 13:19:052235
[email protected]5bcdd99d2013-12-23 18:28:302236 base::DictionaryValue* data = new base::DictionaryValue();
[email protected]ad2a3ded2010-08-27 13:19:052237 data->SetString("internal_name", experiment.internal_name);
2238 data->SetString("name",
2239 l10n_util::GetStringUTF16(experiment.visible_name_id));
2240 data->SetString("description",
2241 l10n_util::GetStringUTF16(
2242 experiment.visible_description_id));
[email protected]cc3e2052011-12-20 01:01:402243
[email protected]5bcdd99d2013-12-23 18:28:302244 base::ListValue* supported_platforms = new base::ListValue();
[email protected]cc3e2052011-12-20 01:01:402245 AddOsStrings(experiment.supported_platforms, supported_platforms);
2246 data->Set("supported_platforms", supported_platforms);
[email protected]ad2a3ded2010-08-27 13:19:052247
[email protected]28e35af2011-02-09 12:56:222248 switch (experiment.type) {
2249 case Experiment::SINGLE_VALUE:
2250 data->SetBoolean(
2251 "enabled",
2252 enabled_experiments.count(experiment.internal_name) > 0);
2253 break;
2254 case Experiment::MULTI_VALUE:
[email protected]83e9fa702013-02-25 19:30:442255 case Experiment::ENABLE_DISABLE_VALUE:
[email protected]28e35af2011-02-09 12:56:222256 data->Set("choices", CreateChoiceData(experiment, enabled_experiments));
2257 break;
2258 default:
2259 NOTREACHED();
[email protected]8a6ff28d2010-12-02 16:35:192260 }
2261
[email protected]ee28495a2013-05-20 04:10:522262 bool supported = (experiment.supported_platforms & current_platform) != 0;
2263#if defined(OS_CHROMEOS)
2264 if (access == kOwnerAccessToFlags &&
2265 (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) {
2266 supported = true;
2267 }
2268#endif
2269 if (supported)
2270 supported_experiments->Append(data);
2271 else
2272 unsupported_experiments->Append(data);
[email protected]ad2a3ded2010-08-27 13:19:052273 }
[email protected]ad2a3ded2010-08-27 13:19:052274}
2275
[email protected]ad2a3ded2010-08-27 13:19:052276bool IsRestartNeededToCommitChanges() {
[email protected]8e8bb6d2010-12-13 08:18:552277 return FlagsState::GetInstance()->IsRestartNeededToCommitChanges();
[email protected]ad2a3ded2010-08-27 13:19:052278}
2279
[email protected]e6d1c4f2013-06-12 17:37:402280void SetExperimentEnabled(FlagsStorage* flags_storage,
2281 const std::string& internal_name,
2282 bool enable) {
2283 FlagsState::GetInstance()->SetExperimentEnabled(flags_storage,
2284 internal_name, enable);
[email protected]e2ddbc92010-10-15 20:02:072285}
2286
2287void RemoveFlagsSwitches(
2288 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]8e8bb6d2010-12-13 08:18:552289 FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
[email protected]e2ddbc92010-10-15 20:02:072290}
2291
[email protected]e6d1c4f2013-06-12 17:37:402292void ResetAllFlags(FlagsStorage* flags_storage) {
2293 FlagsState::GetInstance()->ResetAllFlags(flags_storage);
[email protected]cb93bf52013-02-20 01:20:002294}
2295
[email protected]a314ee5a2010-10-26 21:23:282296int GetCurrentPlatform() {
2297#if defined(OS_MACOSX)
2298 return kOsMac;
2299#elif defined(OS_WIN)
2300 return kOsWin;
2301#elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check.
2302 return kOsCrOS;
[email protected]c92f4ed2011-10-21 19:50:212303#elif defined(OS_LINUX) || defined(OS_OPENBSD)
[email protected]a314ee5a2010-10-26 21:23:282304 return kOsLinux;
[email protected]9c7453d2012-01-21 00:45:402305#elif defined(OS_ANDROID)
2306 return kOsAndroid;
[email protected]a314ee5a2010-10-26 21:23:282307#else
2308#error Unknown platform
2309#endif
2310}
2311
[email protected]e6d1c4f2013-06-12 17:37:402312void RecordUMAStatistics(FlagsStorage* flags_storage) {
2313 std::set<std::string> flags = flags_storage->GetFlags();
[email protected]4bc5050c2010-11-18 17:55:542314 for (std::set<std::string>::iterator it = flags.begin(); it != flags.end();
2315 ++it) {
2316 std::string action("AboutFlags_");
2317 action += *it;
[email protected]7f6f44c2011-12-14 13:23:382318 content::RecordComputedAction(action);
[email protected]4bc5050c2010-11-18 17:55:542319 }
2320 // Since flag metrics are recorded every startup, add a tick so that the
2321 // stats can be made meaningful.
2322 if (flags.size())
[email protected]7f6f44c2011-12-14 13:23:382323 content::RecordAction(UserMetricsAction("AboutFlags_StartupTick"));
2324 content::RecordAction(UserMetricsAction("StartupTick"));
[email protected]4bc5050c2010-11-18 17:55:542325}
2326
alemate0107c3272014-09-03 04:30:042327base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name) {
2328 return static_cast<base::HistogramBase::Sample>(
2329 metrics::HashMetricName(switch_name));
[email protected]4b66a7d2014-08-15 17:13:312330}
2331
2332void ReportCustomFlags(const std::string& uma_histogram_hame,
2333 const std::set<std::string>& command_line_difference) {
2334 for (std::set<std::string>::const_iterator it =
2335 command_line_difference.begin();
2336 it != command_line_difference.end();
2337 ++it) {
2338 int uma_id = about_flags::kBadSwitchFormatHistogramId;
2339 if (StartsWithASCII(*it, "--", true /* case_sensitive */)) {
2340 // Skip '--' before switch name.
2341 std::string switch_name(it->substr(2));
2342
2343 // Kill value, if any.
2344 const size_t value_pos = switch_name.find('=');
2345 if (value_pos != std::string::npos)
2346 switch_name.resize(value_pos);
2347
2348 uma_id = GetSwitchUMAId(switch_name);
2349 } else {
2350 NOTREACHED() << "ReportCustomFlags(): flag '" << *it
2351 << "' has incorrect format.";
2352 }
2353 DVLOG(1) << "ReportCustomFlags(): histogram='" << uma_histogram_hame
2354 << "' '" << *it << "', uma_id=" << uma_id;
2355
2356 // Sparse histogram macro does not cache the histogram, so it's safe
2357 // to use macro with non-static histogram name here.
2358 UMA_HISTOGRAM_SPARSE_SLOWLY(uma_histogram_hame, uma_id);
2359 }
2360}
2361
[email protected]e2ddbc92010-10-15 20:02:072362//////////////////////////////////////////////////////////////////////////////
2363// FlagsState implementation.
2364
2365namespace {
2366
[email protected]83e9fa702013-02-25 19:30:442367typedef std::map<std::string, std::pair<std::string, std::string> >
2368 NameToSwitchAndValueMap;
2369
2370void SetFlagToSwitchMapping(const std::string& key,
2371 const std::string& switch_name,
2372 const std::string& switch_value,
2373 NameToSwitchAndValueMap* name_to_switch_map) {
2374 DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key));
2375 (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value);
2376}
2377
[email protected]578f2092013-09-16 17:16:212378void FlagsState::ConvertFlagsToSwitches(FlagsStorage* flags_storage,
2379 CommandLine* command_line,
2380 SentinelsMode sentinels) {
[email protected]e2ddbc92010-10-15 20:02:072381 if (command_line->HasSwitch(switches::kNoExperiments))
2382 return;
2383
2384 std::set<std::string> enabled_experiments;
[email protected]ba8164242010-11-16 21:31:002385
[email protected]e6d1c4f2013-06-12 17:37:402386 GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage,
2387 &enabled_experiments);
[email protected]e2ddbc92010-10-15 20:02:072388
[email protected]a82744532011-02-11 16:15:532389 NameToSwitchAndValueMap name_to_switch_map;
[email protected]8a6ff28d2010-12-02 16:35:192390 for (size_t i = 0; i < num_experiments; ++i) {
2391 const Experiment& e = experiments[i];
2392 if (e.type == Experiment::SINGLE_VALUE) {
[email protected]83e9fa702013-02-25 19:30:442393 SetFlagToSwitchMapping(e.internal_name, e.command_line_switch,
2394 e.command_line_value, &name_to_switch_map);
2395 } else if (e.type == Experiment::MULTI_VALUE) {
2396 for (int j = 0; j < e.num_choices; ++j) {
2397 SetFlagToSwitchMapping(e.NameForChoice(j),
2398 e.choices[j].command_line_switch,
2399 e.choices[j].command_line_value,
2400 &name_to_switch_map);
2401 }
[email protected]8a6ff28d2010-12-02 16:35:192402 } else {
[email protected]83e9fa702013-02-25 19:30:442403 DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE);
2404 SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(),
2405 &name_to_switch_map);
2406 SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch,
2407 e.command_line_value, &name_to_switch_map);
2408 SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch,
2409 e.disable_command_line_value, &name_to_switch_map);
[email protected]8a6ff28d2010-12-02 16:35:192410 }
2411 }
[email protected]e2ddbc92010-10-15 20:02:072412
[email protected]578f2092013-09-16 17:16:212413 if (sentinels == kAddSentinels) {
2414 command_line->AppendSwitch(switches::kFlagSwitchesBegin);
2415 flags_switches_.insert(
2416 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin,
2417 std::string()));
2418 }
[email protected]e2ddbc92010-10-15 20:02:072419 for (std::set<std::string>::iterator it = enabled_experiments.begin();
2420 it != enabled_experiments.end();
2421 ++it) {
2422 const std::string& experiment_name = *it;
[email protected]a82744532011-02-11 16:15:532423 NameToSwitchAndValueMap::const_iterator name_to_switch_it =
[email protected]8a6ff28d2010-12-02 16:35:192424 name_to_switch_map.find(experiment_name);
2425 if (name_to_switch_it == name_to_switch_map.end()) {
2426 NOTREACHED();
[email protected]e2ddbc92010-10-15 20:02:072427 continue;
[email protected]8a6ff28d2010-12-02 16:35:192428 }
[email protected]e2ddbc92010-10-15 20:02:072429
yefimff0c52f2014-09-24 20:19:502430#if defined(OS_CHROMEOS)
2431 // On Chrome OS setting command line flag may make browser to restart on
2432 // user login. As this flag eventually will be set to a significant number
2433 // of users skip manual-enhanced-bookmarks to avoid restart.
2434 if (experiment_name == "manual-enhanced-bookmarks")
2435 continue;
2436#endif
2437
[email protected]a82744532011-02-11 16:15:532438 const std::pair<std::string, std::string>&
2439 switch_and_value_pair = name_to_switch_it->second;
2440
[email protected]9737b3632013-08-26 09:23:232441 CHECK(!switch_and_value_pair.first.empty());
[email protected]a82744532011-02-11 16:15:532442 command_line->AppendSwitchASCII(switch_and_value_pair.first,
2443 switch_and_value_pair.second);
2444 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second;
[email protected]e2ddbc92010-10-15 20:02:072445 }
[email protected]578f2092013-09-16 17:16:212446 if (sentinels == kAddSentinels) {
2447 command_line->AppendSwitch(switches::kFlagSwitchesEnd);
2448 flags_switches_.insert(
2449 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd,
2450 std::string()));
2451 }
[email protected]e2ddbc92010-10-15 20:02:072452}
2453
2454bool FlagsState::IsRestartNeededToCommitChanges() {
2455 return needs_restart_;
2456}
2457
[email protected]e6d1c4f2013-06-12 17:37:402458void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage,
2459 const std::string& internal_name,
2460 bool enable) {
[email protected]83e9fa702013-02-25 19:30:442461 size_t at_index = internal_name.find(testing::kMultiSeparator);
[email protected]8a6ff28d2010-12-02 16:35:192462 if (at_index != std::string::npos) {
2463 DCHECK(enable);
2464 // We're being asked to enable a multi-choice experiment. Disable the
2465 // currently selected choice.
2466 DCHECK_NE(at_index, 0u);
[email protected]28e35af2011-02-09 12:56:222467 const std::string experiment_name = internal_name.substr(0, at_index);
[email protected]e6d1c4f2013-06-12 17:37:402468 SetExperimentEnabled(flags_storage, experiment_name, false);
[email protected]8a6ff28d2010-12-02 16:35:192469
[email protected]28e35af2011-02-09 12:56:222470 // And enable the new choice, if it is not the default first choice.
2471 if (internal_name != experiment_name + "@0") {
2472 std::set<std::string> enabled_experiments;
[email protected]e6d1c4f2013-06-12 17:37:402473 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
[email protected]147492b2013-03-19 23:52:082474 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]e6d1c4f2013-06-12 17:37:402475 flags_storage->SetFlags(enabled_experiments);
[email protected]28e35af2011-02-09 12:56:222476 }
[email protected]8a6ff28d2010-12-02 16:35:192477 return;
2478 }
2479
[email protected]ad2a3ded2010-08-27 13:19:052480 std::set<std::string> enabled_experiments;
[email protected]e6d1c4f2013-06-12 17:37:402481 GetSanitizedEnabledFlags(flags_storage, &enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052482
[email protected]8a6ff28d2010-12-02 16:35:192483 const Experiment* e = NULL;
2484 for (size_t i = 0; i < num_experiments; ++i) {
2485 if (experiments[i].internal_name == internal_name) {
2486 e = experiments + i;
2487 break;
2488 }
2489 }
2490 DCHECK(e);
2491
2492 if (e->type == Experiment::SINGLE_VALUE) {
[email protected]8a2713682011-08-19 10:36:592493 if (enable)
[email protected]147492b2013-03-19 23:52:082494 needs_restart_ |= enabled_experiments.insert(internal_name).second;
[email protected]8a2713682011-08-19 10:36:592495 else
[email protected]147492b2013-03-19 23:52:082496 needs_restart_ |= (enabled_experiments.erase(internal_name) > 0);
[email protected]8a6ff28d2010-12-02 16:35:192497 } else {
2498 if (enable) {
2499 // Enable the first choice.
[email protected]147492b2013-03-19 23:52:082500 needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second;
[email protected]8a6ff28d2010-12-02 16:35:192501 } else {
2502 // Find the currently enabled choice and disable it.
2503 for (int i = 0; i < e->num_choices; ++i) {
[email protected]83e9fa702013-02-25 19:30:442504 std::string choice_name = e->NameForChoice(i);
[email protected]8a6ff28d2010-12-02 16:35:192505 if (enabled_experiments.find(choice_name) !=
2506 enabled_experiments.end()) {
[email protected]147492b2013-03-19 23:52:082507 needs_restart_ = true;
[email protected]8a6ff28d2010-12-02 16:35:192508 enabled_experiments.erase(choice_name);
2509 // Continue on just in case there's a bug and more than one
2510 // experiment for this choice was enabled.
2511 }
2512 }
2513 }
2514 }
[email protected]ad2a3ded2010-08-27 13:19:052515
[email protected]e6d1c4f2013-06-12 17:37:402516 flags_storage->SetFlags(enabled_experiments);
[email protected]ad2a3ded2010-08-27 13:19:052517}
2518
[email protected]e2ddbc92010-10-15 20:02:072519void FlagsState::RemoveFlagsSwitches(
2520 std::map<std::string, CommandLine::StringType>* switch_list) {
[email protected]a82744532011-02-11 16:15:532521 for (std::map<std::string, std::string>::const_iterator
2522 it = flags_switches_.begin(); it != flags_switches_.end(); ++it) {
2523 switch_list->erase(it->first);
[email protected]e2ddbc92010-10-15 20:02:072524 }
2525}
2526
[email protected]e6d1c4f2013-06-12 17:37:402527void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) {
[email protected]cb93bf52013-02-20 01:20:002528 needs_restart_ = true;
2529
2530 std::set<std::string> no_experiments;
[email protected]e6d1c4f2013-06-12 17:37:402531 flags_storage->SetFlags(no_experiments);
[email protected]cb93bf52013-02-20 01:20:002532}
2533
[email protected]e2ddbc92010-10-15 20:02:072534void FlagsState::reset() {
2535 needs_restart_ = false;
2536 flags_switches_.clear();
2537}
2538
[email protected]38e46812011-05-09 20:49:222539} // namespace
[email protected]e2ddbc92010-10-15 20:02:072540
2541namespace testing {
[email protected]8a6ff28d2010-12-02 16:35:192542
2543// WARNING: '@' is also used in the html file. If you update this constant you
2544// also need to update the html file.
2545const char kMultiSeparator[] = "@";
2546
[email protected]e2ddbc92010-10-15 20:02:072547void ClearState() {
[email protected]8e8bb6d2010-12-13 08:18:552548 FlagsState::GetInstance()->reset();
[email protected]e2ddbc92010-10-15 20:02:072549}
[email protected]a314ee5a2010-10-26 21:23:282550
2551void SetExperiments(const Experiment* e, size_t count) {
2552 if (!e) {
2553 experiments = kExperiments;
2554 num_experiments = arraysize(kExperiments);
2555 } else {
2556 experiments = e;
2557 num_experiments = count;
2558 }
2559}
2560
[email protected]8a6ff28d2010-12-02 16:35:192561const Experiment* GetExperiments(size_t* count) {
2562 *count = num_experiments;
2563 return experiments;
2564}
2565
[email protected]e2ddbc92010-10-15 20:02:072566} // namespace testing
2567
[email protected]1a47d7e2010-10-15 00:37:242568} // namespace about_flags