Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/about_flags.h" |
| 6 | |
| 7 | #include <algorithm> |
| 8 | #include <iterator> |
| 9 | #include <map> |
| 10 | #include <set> |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 11 | #include <utility> |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 12 | |
| 13 | #include "base/command_line.h" |
| 14 | #include "base/memory/singleton.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 15 | #include "base/strings/string_number_conversions.h" |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 16 | #include "base/strings/utf_string_conversions.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 17 | #include "base/values.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 18 | #include "cc/base/switches.h" |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 19 | #include "chrome/browser/flags_storage.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 20 | #include "chrome/common/chrome_content_client.h" |
| 21 | #include "chrome/common/chrome_switches.h" |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 22 | #include "components/nacl/common/nacl_switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 23 | #include "content/public/browser/user_metrics.h" |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 24 | #include "extensions/common/switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 25 | #include "grit/chromium_strings.h" |
| 26 | #include "grit/generated_resources.h" |
| 27 | #include "grit/google_chrome_strings.h" |
| 28 | #include "media/base/media_switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 29 | #include "ui/base/l10n/l10n_util.h" |
| 30 | #include "ui/base/ui_base_switches.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 31 | #include "ui/gfx/switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 32 | #include "ui/gl/gl_switches.h" |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 33 | #include "ui/keyboard/keyboard_switches.h" |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 34 | #include "ui/message_center/message_center_switches.h" |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 35 | #include "ui/surface/surface_switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 36 | |
| 37 | #if defined(USE_ASH) |
| 38 | #include "ash/ash_switches.h" |
| 39 | #endif |
| 40 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 41 | #if defined(OS_CHROMEOS) |
| 42 | #include "chromeos/chromeos_switches.h" |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 43 | #include "third_party/cros_system_api/switches/chrome_switches.h" |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 44 | #endif |
| 45 | |
| 46 | using content::UserMetricsAction; |
| 47 | |
| 48 | namespace about_flags { |
| 49 | |
| 50 | // Macros to simplify specifying the type. |
| 51 | #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 52 | Experiment::SINGLE_VALUE, \ |
| 53 | command_line_switch, switch_value, NULL, NULL, NULL, 0 |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 54 | #define SINGLE_VALUE_TYPE(command_line_switch) \ |
| 55 | SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 56 | #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \ |
| 57 | disable_switch, disable_value) \ |
| 58 | Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \ |
| 59 | disable_switch, disable_value, NULL, 3 |
| 60 | #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \ |
| 61 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "") |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 62 | #define MULTI_VALUE_TYPE(choices) \ |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 63 | Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 64 | |
| 65 | namespace { |
| 66 | |
| 67 | const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 68 | const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 69 | |
| 70 | // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
| 71 | // whether the experiment is available on that platform. |
| 72 | void AddOsStrings(unsigned bitmask, ListValue* list) { |
| 73 | struct { |
| 74 | unsigned bit; |
| 75 | const char* const name; |
| 76 | } kBitsToOs[] = { |
| 77 | {kOsMac, "Mac"}, |
| 78 | {kOsWin, "Windows"}, |
| 79 | {kOsLinux, "Linux"}, |
| 80 | {kOsCrOS, "Chrome OS"}, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 81 | {kOsAndroid, "Android"}, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 82 | {kOsCrOSOwnerOnly, "Chrome OS (owner only)"}, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 83 | }; |
| 84 | for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
| 85 | if (bitmask & kBitsToOs[i].bit) |
| 86 | list->Append(new StringValue(kBitsToOs[i].name)); |
| 87 | } |
| 88 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 89 | // Convert switch constants to proper CommandLine::StringType strings. |
| 90 | CommandLine::StringType GetSwitchString(const std::string& flag) { |
| 91 | CommandLine cmd_line(CommandLine::NO_PROGRAM); |
| 92 | cmd_line.AppendSwitch(flag); |
| 93 | DCHECK(cmd_line.argv().size() == 2); |
| 94 | return cmd_line.argv()[1]; |
| 95 | } |
| 96 | |
| 97 | // Scoops flags from a command line. |
| 98 | std::set<CommandLine::StringType> ExtractFlagsFromCommandLine( |
| 99 | const CommandLine& cmdline) { |
| 100 | std::set<CommandLine::StringType> flags; |
| 101 | // First do the ones between --flag-switches-begin and --flag-switches-end. |
| 102 | CommandLine::StringVector::const_iterator first = |
| 103 | std::find(cmdline.argv().begin(), cmdline.argv().end(), |
| 104 | GetSwitchString(switches::kFlagSwitchesBegin)); |
| 105 | CommandLine::StringVector::const_iterator last = |
| 106 | std::find(cmdline.argv().begin(), cmdline.argv().end(), |
| 107 | GetSwitchString(switches::kFlagSwitchesEnd)); |
| 108 | if (first != cmdline.argv().end() && last != cmdline.argv().end()) |
| 109 | flags.insert(first + 1, last); |
| 110 | #if defined(OS_CHROMEOS) |
| 111 | // Then add those between --policy-switches-begin and --policy-switches-end. |
| 112 | first = std::find(cmdline.argv().begin(), cmdline.argv().end(), |
| 113 | GetSwitchString(chromeos::switches::kPolicySwitchesBegin)); |
| 114 | last = std::find(cmdline.argv().begin(), cmdline.argv().end(), |
| 115 | GetSwitchString(chromeos::switches::kPolicySwitchesEnd)); |
| 116 | if (first != cmdline.argv().end() && last != cmdline.argv().end()) |
| 117 | flags.insert(first + 1, last); |
| 118 | #endif |
| 119 | return flags; |
| 120 | } |
| 121 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 122 | const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 123 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 124 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 125 | switches::kEnableCompositingForFixedPosition, ""}, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 126 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 127 | switches::kDisableCompositingForFixedPosition, ""}, |
| 128 | { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI, |
| 129 | switches::kEnableHighDpiCompositingForFixedPosition, ""} |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 130 | }; |
| 131 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 132 | const Experiment::Choice kEnableCompositingForTransitionChoices[] = { |
| 133 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 134 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 135 | switches::kEnableCompositingForTransition, ""}, |
| 136 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 137 | switches::kDisableCompositingForTransition, ""}, |
| 138 | }; |
| 139 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 140 | const Experiment::Choice kEnableAcceleratedFixedRootBackgroundChoices[] = { |
| 141 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 142 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 143 | switches::kEnableAcceleratedFixedRootBackground, ""}, |
| 144 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 145 | switches::kDisableAcceleratedFixedRootBackground, ""}, |
| 146 | }; |
| 147 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 148 | const Experiment::Choice kGDIPresentChoices[] = { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 149 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 150 | { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW, |
| 151 | switches::kDoFirstShowPresentWithGDI, ""}, |
| 152 | { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW, |
| 153 | switches::kDoAllShowPresentWithGDI, ""} |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 154 | }; |
| 155 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 156 | const Experiment::Choice kTouchEventsChoices[] = { |
| 157 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 158 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 159 | switches::kTouchEvents, |
| 160 | switches::kTouchEventsEnabled }, |
| 161 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 162 | switches::kTouchEvents, |
| 163 | switches::kTouchEventsDisabled } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 164 | }; |
| 165 | |
| 166 | const Experiment::Choice kTouchOptimizedUIChoices[] = { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 167 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 168 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 169 | switches::kTouchOptimizedUI, |
| 170 | switches::kTouchOptimizedUIEnabled }, |
| 171 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 172 | switches::kTouchOptimizedUI, |
| 173 | switches::kTouchOptimizedUIDisabled } |
| 174 | }; |
| 175 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 176 | const Experiment::Choice kNaClDebugMaskChoices[] = { |
| 177 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 178 | // Secure shell can be used on ChromeOS for forwarding the TCP port opened by |
| 179 | // debug stub to a remote machine. Since secure shell uses NaCl, we provide |
| 180 | // an option to switch off its debugging. |
| 181 | { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS, |
| 182 | switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" }, |
| 183 | { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG, |
| 184 | switches::kNaClDebugMask, "*://*/*debug.nmf" } |
| 185 | }; |
| 186 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 187 | #if defined(OS_CHROMEOS) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 188 | |
| 189 | const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = { |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 190 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 191 | { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 192 | chromeos::switches::kEnableChromeCaptivePortalDetector, "" }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 193 | { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 194 | chromeos::switches::kDisableChromeCaptivePortalDetector, "" } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 195 | }; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 196 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 197 | #endif |
| 198 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 199 | const Experiment::Choice kImplSidePaintingChoices[] = { |
| 200 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 201 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 202 | cc::switches::kEnableImplSidePainting, ""}, |
| 203 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 204 | cc::switches::kDisableImplSidePainting, ""} |
| 205 | }; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 206 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 207 | const Experiment::Choice kDelegatedRendererChoices[] = { |
| 208 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 209 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 210 | switches::kEnableDelegatedRenderer, ""}, |
| 211 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 212 | switches::kDisableDelegatedRenderer, ""} |
| 213 | }; |
| 214 | |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 215 | const Experiment::Choice kMaxTilesForInterestAreaChoices[] = { |
| 216 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 217 | { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_SHORT, |
| 218 | cc::switches::kMaxTilesForInterestArea, "64"}, |
| 219 | { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_TALL, |
| 220 | cc::switches::kMaxTilesForInterestArea, "128"}, |
| 221 | { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_GRANDE, |
| 222 | cc::switches::kMaxTilesForInterestArea, "256"}, |
| 223 | { IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_VENTI, |
| 224 | cc::switches::kMaxTilesForInterestArea, "512"} |
| 225 | }; |
| 226 | |
| 227 | const Experiment::Choice kDefaultTileWidthChoices[] = { |
| 228 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 229 | { IDS_FLAGS_DEFAULT_TILE_WIDTH_SHORT, |
| 230 | switches::kDefaultTileWidth, "128"}, |
| 231 | { IDS_FLAGS_DEFAULT_TILE_WIDTH_TALL, |
| 232 | switches::kDefaultTileWidth, "256"}, |
| 233 | { IDS_FLAGS_DEFAULT_TILE_WIDTH_GRANDE, |
| 234 | switches::kDefaultTileWidth, "512"}, |
| 235 | { IDS_FLAGS_DEFAULT_TILE_WIDTH_VENTI, |
| 236 | switches::kDefaultTileWidth, "1024"} |
| 237 | }; |
| 238 | |
| 239 | const Experiment::Choice kDefaultTileHeightChoices[] = { |
| 240 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 241 | { IDS_FLAGS_DEFAULT_TILE_HEIGHT_SHORT, |
| 242 | switches::kDefaultTileHeight, "128"}, |
| 243 | { IDS_FLAGS_DEFAULT_TILE_HEIGHT_TALL, |
| 244 | switches::kDefaultTileHeight, "256"}, |
| 245 | { IDS_FLAGS_DEFAULT_TILE_HEIGHT_GRANDE, |
| 246 | switches::kDefaultTileHeight, "512"}, |
| 247 | { IDS_FLAGS_DEFAULT_TILE_HEIGHT_VENTI, |
| 248 | switches::kDefaultTileHeight, "1024"} |
| 249 | }; |
| 250 | |
| 251 | const Experiment::Choice kSimpleCacheBackendChoices[] = { |
| 252 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 253 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 254 | switches::kUseSimpleCacheBackend, "off" }, |
| 255 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 256 | switches::kUseSimpleCacheBackend, "on"} |
| 257 | }; |
| 258 | |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 259 | const Experiment::Choice kTabCaptureUpscaleQualityChoices[] = { |
| 260 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 261 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST, |
| 262 | switches::kTabCaptureUpscaleQuality, "fast" }, |
| 263 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD, |
| 264 | switches::kTabCaptureUpscaleQuality, "good" }, |
| 265 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST, |
| 266 | switches::kTabCaptureUpscaleQuality, "best" }, |
| 267 | }; |
| 268 | |
| 269 | const Experiment::Choice kTabCaptureDownscaleQualityChoices[] = { |
| 270 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 271 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_FAST, |
| 272 | switches::kTabCaptureDownscaleQuality, "fast" }, |
| 273 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_GOOD, |
| 274 | switches::kTabCaptureDownscaleQuality, "good" }, |
| 275 | { IDS_FLAGS_TAB_CAPTURE_SCALE_QUALITY_BEST, |
| 276 | switches::kTabCaptureDownscaleQuality, "best" }, |
| 277 | }; |
| 278 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 279 | // RECORDING USER METRICS FOR FLAGS: |
| 280 | // ----------------------------------------------------------------------------- |
| 281 | // The first line of the experiment is the internal name. If you'd like to |
| 282 | // gather statistics about the usage of your flag, you should append a marker |
| 283 | // comment to the end of the feature name, like so: |
| 284 | // "my-special-feature", // FLAGS:RECORD_UMA |
| 285 | // |
| 286 | // After doing that, run //chrome/tools/extract_actions.py (see instructions at |
| 287 | // the top of that file for details) to update the chromeactions.txt file, which |
| 288 | // will enable UMA to record your feature flag. |
| 289 | // |
| 290 | // After your feature has shipped under a flag, you can locate the metrics under |
| 291 | // the action name AboutFlags_internal-action-name. Actions are recorded once |
| 292 | // per startup, so you should divide this number by AboutFlags_StartupTick to |
| 293 | // get a sense of usage. Note that this will not be the same as number of users |
| 294 | // with a given feature enabled because users can quit and relaunch the |
| 295 | // application multiple times over a given time interval. The dashboard also |
| 296 | // shows you how many (metrics reporting) users have enabled the flag over the |
| 297 | // last seven days. However, note that this is not the same as the number of |
| 298 | // users who have the flag enabled, since enabling the flag happens once, |
| 299 | // whereas running with the flag enabled happens until the user flips the flag |
| 300 | // again. |
| 301 | |
| 302 | // To add a new experiment add to the end of kExperiments. There are two |
| 303 | // distinct types of experiments: |
| 304 | // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE |
| 305 | // macro for this type supplying the command line to the macro. |
| 306 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 307 | // deactivated state for this lab (i.e. no command line option). To specify |
| 308 | // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the |
| 309 | // array of choices. |
| 310 | // See the documentation of Experiment for details on the fields. |
| 311 | // |
| 312 | // When adding a new choice, add it to the end of the list. |
| 313 | const Experiment kExperiments[] = { |
| 314 | { |
| 315 | "expose-for-tabs", // FLAGS:RECORD_UMA |
| 316 | IDS_FLAGS_TABPOSE_NAME, |
| 317 | IDS_FLAGS_TABPOSE_DESCRIPTION, |
| 318 | kOsMac, |
| 319 | #if defined(OS_MACOSX) |
| 320 | // The switch exists only on OS X. |
| 321 | SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs) |
| 322 | #else |
| 323 | SINGLE_VALUE_TYPE("") |
| 324 | #endif |
| 325 | }, |
| 326 | { |
| 327 | "conflicting-modules-check", // FLAGS:RECORD_UMA |
| 328 | IDS_FLAGS_CONFLICTS_CHECK_NAME, |
| 329 | IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION, |
| 330 | kOsWin, |
| 331 | SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck) |
| 332 | }, |
| 333 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 334 | "ignore-gpu-blacklist", |
| 335 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME, |
| 336 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION, |
| 337 | kOsAll, |
| 338 | SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist) |
| 339 | }, |
| 340 | { |
| 341 | "force-compositing-mode-2", |
| 342 | IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME, |
| 343 | IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION, |
| 344 | kOsMac | kOsWin | kOsLinux, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 345 | ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode, |
| 346 | switches::kDisableForceCompositingMode) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 347 | }, |
| 348 | { |
| 349 | "threaded-compositing-mode", |
| 350 | IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME, |
| 351 | IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 352 | kOsMac | kOsWin | kOsLinux, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 353 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing, |
| 354 | switches::kDisableThreadedCompositing) |
| 355 | }, |
| 356 | { |
| 357 | "force-accelerated-composited-scrolling", |
| 358 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME, |
| 359 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION, |
| 360 | kOsAll, |
| 361 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll, |
| 362 | switches::kDisableAcceleratedOverflowScroll) |
| 363 | }, |
| 364 | { |
| 365 | "present-with-GDI", |
| 366 | IDS_FLAGS_PRESENT_WITH_GDI_NAME, |
| 367 | IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION, |
| 368 | kOsWin, |
| 369 | MULTI_VALUE_TYPE(kGDIPresentChoices) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 370 | }, |
| 371 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 372 | "enable-experimental-canvas-features", |
| 373 | IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_NAME, |
| 374 | IDS_FLAGS_ENABLE_EXPERIMENTAL_CANVAS_FEATURES_DESCRIPTION, |
| 375 | kOsAll, |
| 376 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalCanvasFeatures) |
| 377 | }, |
| 378 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 379 | "disable-accelerated-2d-canvas", |
| 380 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME, |
| 381 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION, |
| 382 | kOsAll, |
| 383 | SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas) |
| 384 | }, |
| 385 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 386 | "disable-threaded-animation", |
| 387 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME, |
| 388 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION, |
| 389 | kOsAll, |
| 390 | SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation) |
| 391 | }, |
| 392 | { |
| 393 | "composited-layer-borders", |
| 394 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS, |
| 395 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION, |
| 396 | kOsAll, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 397 | SINGLE_VALUE_TYPE(cc::switches::kShowCompositedLayerBorders) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 398 | }, |
| 399 | { |
| 400 | "show-fps-counter", |
| 401 | IDS_FLAGS_SHOW_FPS_COUNTER, |
| 402 | IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION, |
| 403 | kOsAll, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 404 | SINGLE_VALUE_TYPE(cc::switches::kShowFPSCounter) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 405 | }, |
| 406 | { |
| 407 | "accelerated-filters", |
| 408 | IDS_FLAGS_ACCELERATED_FILTERS, |
| 409 | IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION, |
| 410 | kOsAll, |
| 411 | SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters) |
| 412 | }, |
| 413 | { |
| 414 | "disable-gpu-vsync", |
| 415 | IDS_FLAGS_DISABLE_GPU_VSYNC_NAME, |
| 416 | IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 417 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 418 | SINGLE_VALUE_TYPE(switches::kDisableGpuVsync) |
| 419 | }, |
| 420 | { |
| 421 | "disable-webgl", |
| 422 | IDS_FLAGS_DISABLE_WEBGL_NAME, |
| 423 | IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 424 | kOsAll, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 425 | SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 426 | }, |
| 427 | { |
| 428 | "disable-webrtc", |
| 429 | IDS_FLAGS_DISABLE_WEBRTC_NAME, |
| 430 | IDS_FLAGS_DISABLE_WEBRTC_DESCRIPTION, |
| 431 | kOsAndroid, |
| 432 | #if defined(OS_ANDROID) |
| 433 | SINGLE_VALUE_TYPE(switches::kDisableWebRTC) |
| 434 | #else |
| 435 | SINGLE_VALUE_TYPE("") |
| 436 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 437 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 438 | #if defined(ENABLE_WEBRTC) |
| 439 | { |
| 440 | "enable-sctp-data-channels", |
| 441 | IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_NAME, |
| 442 | IDS_FLAGS_ENABLE_SCTP_DATA_CHANNELS_DESCRIPTION, |
| 443 | kOsAll, |
| 444 | SINGLE_VALUE_TYPE(switches::kEnableSCTPDataChannels) |
| 445 | }, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 446 | { |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 447 | "disable-device-enumeration", |
| 448 | IDS_FLAGS_DISABLE_DEVICE_ENUMERATION_NAME, |
| 449 | IDS_FLAGS_DISABLE_DEVICE_ENUMERATION_DESCRIPTION, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 450 | kOsAll, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 451 | SINGLE_VALUE_TYPE(switches::kDisableDeviceEnumeration) |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 452 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 453 | #endif |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 454 | #if defined(OS_ANDROID) |
| 455 | { |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 456 | "disable-webaudio", |
| 457 | IDS_FLAGS_DISABLE_WEBAUDIO_NAME, |
| 458 | IDS_FLAGS_DISABLE_WEBAUDIO_DESCRIPTION, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 459 | kOsAndroid, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 460 | SINGLE_VALUE_TYPE(switches::kDisableWebAudio) |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 461 | }, |
| 462 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 463 | { |
| 464 | "fixed-position-creates-stacking-context", |
| 465 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME, |
| 466 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION, |
| 467 | kOsAll, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 468 | ENABLE_DISABLE_VALUE_TYPE( |
| 469 | switches::kEnableFixedPositionCreatesStackingContext, |
| 470 | switches::kDisableFixedPositionCreatesStackingContext) |
| 471 | }, |
| 472 | { |
| 473 | "enable-compositing-for-fixed-position", |
| 474 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME, |
| 475 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION, |
| 476 | kOsAll, |
| 477 | MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 478 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 479 | { |
| 480 | "enable-compositing-for-transition", |
| 481 | IDS_FLAGS_COMPOSITING_FOR_TRANSITION_NAME, |
| 482 | IDS_FLAGS_COMPOSITING_FOR_TRANSITION_DESCRIPTION, |
| 483 | kOsAll, |
| 484 | MULTI_VALUE_TYPE(kEnableCompositingForTransitionChoices) |
| 485 | }, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 486 | { |
| 487 | "enable-accelerated-fixed-root-background", |
| 488 | IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_NAME, |
| 489 | IDS_FLAGS_ACCELERATED_FIXED_ROOT_BACKGROUND_DESCRIPTION, |
| 490 | kOsAll, |
| 491 | MULTI_VALUE_TYPE(kEnableAcceleratedFixedRootBackgroundChoices) |
| 492 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 493 | // TODO(bbudge): When NaCl is on by default, remove this flag entry. |
| 494 | { |
| 495 | "enable-nacl", // FLAGS:RECORD_UMA |
| 496 | IDS_FLAGS_ENABLE_NACL_NAME, |
| 497 | IDS_FLAGS_ENABLE_NACL_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 498 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 499 | SINGLE_VALUE_TYPE(switches::kEnableNaCl) |
| 500 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 501 | { |
| 502 | "enable-nacl-debug", // FLAGS:RECORD_UMA |
| 503 | IDS_FLAGS_ENABLE_NACL_DEBUG_NAME, |
| 504 | IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 505 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 506 | SINGLE_VALUE_TYPE(switches::kEnableNaClDebug) |
| 507 | }, |
| 508 | { |
| 509 | "nacl-debug-mask", // FLAGS:RECORD_UMA |
| 510 | IDS_FLAGS_NACL_DEBUG_MASK_NAME, |
| 511 | IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 512 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 513 | MULTI_VALUE_TYPE(kNaClDebugMaskChoices) |
| 514 | }, |
| 515 | { |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 516 | "disable-pnacl", // FLAGS:RECORD_UMA |
| 517 | IDS_FLAGS_PNACL_NAME, |
| 518 | IDS_FLAGS_PNACL_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 519 | kOsDesktop, |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 520 | ENABLE_DISABLE_VALUE_TYPE("", switches::kDisablePnacl) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 521 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 522 | { |
| 523 | "extension-apis", // FLAGS:RECORD_UMA |
| 524 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME, |
| 525 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 526 | kOsDesktop, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 527 | SINGLE_VALUE_TYPE(extensions::switches::kEnableExperimentalExtensionApis) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 528 | }, |
| 529 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 530 | "extensions-on-chrome-urls", |
| 531 | IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_NAME, |
| 532 | IDS_FLAGS_EXTENSIONS_ON_CHROME_URLS_DESCRIPTION, |
| 533 | kOsAll, |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 534 | SINGLE_VALUE_TYPE(extensions::switches::kExtensionsOnChromeURLs) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 535 | }, |
| 536 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 537 | "enable-fast-unload", |
| 538 | IDS_FLAGS_ENABLE_FAST_UNLOAD_NAME, |
| 539 | IDS_FLAGS_ENABLE_FAST_UNLOAD_DESCRIPTION, |
| 540 | kOsAll, |
| 541 | SINGLE_VALUE_TYPE(switches::kEnableFastUnload) |
| 542 | }, |
| 543 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 544 | "enable-adview", |
| 545 | IDS_FLAGS_ENABLE_ADVIEW_NAME, |
| 546 | IDS_FLAGS_ENABLE_ADVIEW_DESCRIPTION, |
| 547 | kOsDesktop, |
| 548 | SINGLE_VALUE_TYPE(switches::kEnableAdview) |
| 549 | }, |
| 550 | { |
| 551 | "enable-adview-src-attribute", |
| 552 | IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_NAME, |
| 553 | IDS_FLAGS_ENABLE_ADVIEW_SRC_ATTRIBUTE_DESCRIPTION, |
| 554 | kOsDesktop, |
| 555 | SINGLE_VALUE_TYPE(switches::kEnableAdviewSrcAttribute) |
| 556 | }, |
| 557 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 558 | "enable-app-window-controls", |
| 559 | IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_NAME, |
| 560 | IDS_FLAGS_ENABLE_APP_WINDOW_CONTROLS_DESCRIPTION, |
| 561 | kOsDesktop, |
| 562 | SINGLE_VALUE_TYPE(switches::kEnableAppWindowControls) |
| 563 | }, |
| 564 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 565 | "script-badges", |
| 566 | IDS_FLAGS_SCRIPT_BADGES_NAME, |
| 567 | IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 568 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 569 | SINGLE_VALUE_TYPE(switches::kScriptBadges) |
| 570 | }, |
| 571 | { |
| 572 | "script-bubble", |
| 573 | IDS_FLAGS_SCRIPT_BUBBLE_NAME, |
| 574 | IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 575 | kOsDesktop, |
| 576 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1", |
| 577 | switches::kScriptBubble, "0") |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 578 | }, |
| 579 | { |
| 580 | "apps-new-install-bubble", |
| 581 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME, |
| 582 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 583 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 584 | SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble) |
| 585 | }, |
| 586 | { |
| 587 | "disable-hyperlink-auditing", |
| 588 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME, |
| 589 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION, |
| 590 | kOsAll, |
| 591 | SINGLE_VALUE_TYPE(switches::kNoPings) |
| 592 | }, |
| 593 | { |
| 594 | "experimental-location-features", // FLAGS:RECORD_UMA |
| 595 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME, |
| 596 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION, |
| 597 | kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS. |
| 598 | SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures) |
| 599 | }, |
| 600 | { |
| 601 | "tab-groups-context-menu", |
| 602 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME, |
| 603 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION, |
| 604 | kOsWin, |
| 605 | SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu) |
| 606 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 607 | { |
| 608 | "enable-instant-extended-api", |
| 609 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API, |
| 610 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 611 | kOsMac | kOsWin | kOsCrOS, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 612 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI, |
| 613 | switches::kDisableInstantExtendedAPI) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 614 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 615 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 616 | "enable-local-first-load-ntp", |
| 617 | IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP, |
| 618 | IDS_FLAGS_ENABLE_LOCAL_FIRST_LOAD_NTP_DESCRIPTION, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 619 | kOsMac | kOsWin | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 620 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableLocalFirstLoadNTP, |
| 621 | switches::kDisableLocalFirstLoadNTP) |
| 622 | }, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 623 | #if defined(OS_ANDROID) |
| 624 | { |
| 625 | "enable-new-ntp", |
| 626 | IDS_FLAGS_ENABLE_NEW_NTP, |
| 627 | IDS_FLAGS_ENABLE_NEW_NTP_DESCRIPTION, |
| 628 | kOsAndroid, |
| 629 | SINGLE_VALUE_TYPE(switches::kEnableNewNTP) |
| 630 | }, |
| 631 | #endif |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 632 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 633 | "static-ip-config", |
| 634 | IDS_FLAGS_STATIC_IP_CONFIG_NAME, |
| 635 | IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION, |
| 636 | kOsCrOS, |
| 637 | #if defined(OS_CHROMEOS) |
| 638 | // This switch exists only on Chrome OS. |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 639 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableStaticIPConfig) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 640 | #else |
| 641 | SINGLE_VALUE_TYPE("") |
| 642 | #endif |
| 643 | }, |
| 644 | { |
| 645 | "show-autofill-type-predictions", |
| 646 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME, |
| 647 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION, |
| 648 | kOsAll, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 649 | SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillTypePredictions) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 650 | }, |
| 651 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 652 | "enable-gesture-tap-highlight", |
| 653 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME, |
| 654 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION, |
| 655 | kOsLinux | kOsCrOS, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 656 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight, |
| 657 | switches::kDisableGestureTapHighlight) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 658 | }, |
| 659 | { |
| 660 | "enable-smooth-scrolling", // FLAGS:RECORD_UMA |
| 661 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME, |
| 662 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION, |
| 663 | // Can't expose the switch unless the code is compiled in. |
| 664 | // On by default for the Mac (different implementation in WebKit). |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 665 | kOsWin | kOsLinux, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 666 | SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling) |
| 667 | }, |
| 668 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 669 | "enable-panels", |
| 670 | IDS_FLAGS_ENABLE_PANELS_NAME, |
| 671 | IDS_FLAGS_ENABLE_PANELS_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 672 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 673 | SINGLE_VALUE_TYPE(switches::kEnablePanels) |
| 674 | }, |
| 675 | { |
| 676 | // See http://crbug.com/120416 for how to remove this flag. |
| 677 | "save-page-as-mhtml", // FLAGS:RECORD_UMA |
| 678 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME, |
| 679 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION, |
| 680 | kOsMac | kOsWin | kOsLinux, |
| 681 | SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML) |
| 682 | }, |
| 683 | { |
| 684 | "enable-autologin", |
| 685 | IDS_FLAGS_ENABLE_AUTOLOGIN_NAME, |
| 686 | IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION, |
| 687 | kOsMac | kOsWin | kOsLinux, |
| 688 | SINGLE_VALUE_TYPE(switches::kEnableAutologin) |
| 689 | }, |
| 690 | { |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 691 | "enable-quic", |
| 692 | IDS_FLAGS_ENABLE_QUIC_NAME, |
| 693 | IDS_FLAGS_ENABLE_QUIC_DESCRIPTION, |
| 694 | kOsAll, |
| 695 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuic, |
| 696 | switches::kDisableQuic) |
| 697 | }, |
| 698 | { |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 699 | "enable-quic-https", |
| 700 | IDS_FLAGS_ENABLE_QUIC_HTTPS_NAME, |
| 701 | IDS_FLAGS_ENABLE_QUIC_HTTPS_DESCRIPTION, |
| 702 | kOsAll, |
Ben Murdoch | bbcdd45 | 2013-07-25 10:06:34 +0100 | [diff] [blame] | 703 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableQuicHttps, |
| 704 | switches::kDisableQuicHttps) |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 705 | }, |
| 706 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 707 | "enable-spdy4a2", |
| 708 | IDS_FLAGS_ENABLE_SPDY4A2_NAME, |
| 709 | IDS_FLAGS_ENABLE_SPDY4A2_DESCRIPTION, |
| 710 | kOsAll, |
| 711 | SINGLE_VALUE_TYPE(switches::kEnableSpdy4a2) |
| 712 | }, |
| 713 | { |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 714 | "enable-http2-draft-04", |
| 715 | IDS_FLAGS_ENABLE_HTTP2_DRAFT_04_NAME, |
| 716 | IDS_FLAGS_ENABLE_HTTP2_DRAFT_04_DESCRIPTION, |
| 717 | kOsAll, |
| 718 | SINGLE_VALUE_TYPE(switches::kEnableHttp2Draft04) |
| 719 | }, |
| 720 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 721 | "enable-async-dns", |
| 722 | IDS_FLAGS_ENABLE_ASYNC_DNS_NAME, |
| 723 | IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION, |
| 724 | kOsWin | kOsMac | kOsLinux | kOsCrOS, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 725 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns, |
| 726 | switches::kDisableAsyncDns) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 727 | }, |
| 728 | { |
| 729 | "disable-media-source", |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 730 | IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_NAME, |
| 731 | IDS_FLAGS_DISABLE_WEBKIT_MEDIA_SOURCE_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 732 | kOsAll, |
Torne (Richard Coles) | a93a17c | 2013-05-15 11:34:50 +0100 | [diff] [blame] | 733 | SINGLE_VALUE_TYPE(switches::kDisableWebKitMediaSource) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 734 | }, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 735 | { |
| 736 | "enable-encrypted-media", |
| 737 | IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_NAME, |
| 738 | IDS_FLAGS_ENABLE_ENCRYPTED_MEDIA_DESCRIPTION, |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 739 | kOsAll, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 740 | SINGLE_VALUE_TYPE(switches::kEnableEncryptedMedia) |
| 741 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 742 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 743 | "disable-encrypted-media", |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 744 | IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_NAME, |
| 745 | IDS_FLAGS_DISABLE_PREFIXED_ENCRYPTED_MEDIA_DESCRIPTION, |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 746 | kOsAll, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 747 | SINGLE_VALUE_TYPE(switches::kDisableLegacyEncryptedMedia) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 748 | }, |
| 749 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 750 | "override-encrypted-media-canplaytype", |
| 751 | IDS_FLAGS_ENCRYPTED_MEDIA_CANPLAYTYPE_OVERRIDE_NAME, |
| 752 | IDS_FLAGS_ENCRYPTED_MEDIA_CANPLAYTYPE_OVERRIDE_DESCRIPTION, |
| 753 | kOsMac | kOsWin, |
| 754 | SINGLE_VALUE_TYPE(switches::kOverrideEncryptedMediaCanPlayType) |
| 755 | }, |
| 756 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 757 | "enable-opus-playback", |
| 758 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME, |
| 759 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION, |
| 760 | kOsDesktop, |
| 761 | SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback) |
| 762 | }, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 763 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 764 | "enable-vp8-alpha-playback", |
| 765 | IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_NAME, |
| 766 | IDS_FLAGS_ENABLE_VP8_ALPHA_PLAYBACK_DESCRIPTION, |
| 767 | kOsDesktop, |
| 768 | SINGLE_VALUE_TYPE(switches::kEnableVp8AlphaPlayback) |
| 769 | }, |
| 770 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 771 | "enable-managed-users", |
| 772 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME, |
| 773 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 774 | kOsMac | kOsWin | kOsLinux | kOsCrOSOwnerOnly, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 775 | SINGLE_VALUE_TYPE(switches::kEnableManagedUsers) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 776 | }, |
| 777 | #if defined(USE_ASH) |
| 778 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 779 | "ash-disable-auto-maximizing", |
| 780 | IDS_FLAGS_ASH_AUTO_MAXIMIZING_NAME, |
| 781 | IDS_FLAGS_ASH_AUTO_MAXIMIZING_DESCRIPTION, |
| 782 | kOsWin | kOsLinux | kOsCrOS, |
| 783 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoMaximizing) |
| 784 | }, |
| 785 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 786 | "ash-disable-auto-window-placement", |
| 787 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME, |
| 788 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION, |
| 789 | kOsWin | kOsLinux | kOsCrOS, |
| 790 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement) |
| 791 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 792 | { |
| 793 | "ash-disable-per-app-launcher", |
| 794 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME, |
| 795 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION, |
| 796 | kOsWin | kOsLinux | kOsCrOS, |
| 797 | SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher) |
| 798 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 799 | #endif |
| 800 | { |
| 801 | "per-tile-painting", |
| 802 | IDS_FLAGS_PER_TILE_PAINTING_NAME, |
| 803 | IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 804 | kOsMac | kOsLinux | kOsCrOS, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 805 | SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting) |
| 806 | }, |
| 807 | { |
| 808 | "enable-javascript-harmony", |
| 809 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME, |
| 810 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION, |
| 811 | kOsAll, |
| 812 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony") |
| 813 | }, |
| 814 | { |
| 815 | "enable-tab-browser-dragging", |
| 816 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME, |
| 817 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION, |
| 818 | kOsWin, |
| 819 | SINGLE_VALUE_TYPE(switches::kTabBrowserDragging) |
| 820 | }, |
| 821 | { |
| 822 | "disable-restore-session-state", |
| 823 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME, |
| 824 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION, |
| 825 | kOsAll, |
| 826 | SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState) |
| 827 | }, |
| 828 | { |
| 829 | "disable-software-rasterizer", |
| 830 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME, |
| 831 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION, |
| 832 | #if defined(ENABLE_SWIFTSHADER) |
| 833 | kOsAll, |
| 834 | #else |
| 835 | 0, |
| 836 | #endif |
| 837 | SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer) |
| 838 | }, |
| 839 | { |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 840 | "enable-experimental-web-platform-features", |
| 841 | IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME, |
| 842 | IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 843 | kOsAll, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 844 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 845 | }, |
| 846 | { |
| 847 | "enable-css-shaders", |
| 848 | IDS_FLAGS_CSS_SHADERS_NAME, |
| 849 | IDS_FLAGS_CSS_SHADERS_DESCRIPTION, |
| 850 | kOsAll, |
| 851 | SINGLE_VALUE_TYPE(switches::kEnableCssShaders) |
| 852 | }, |
| 853 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 854 | "disable-ntp-other-sessions-menu", |
| 855 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME, |
| 856 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 857 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 858 | SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu) |
| 859 | }, |
| 860 | #if defined(USE_ASH) |
| 861 | { |
| 862 | "enable-ash-oak", |
| 863 | IDS_FLAGS_ENABLE_ASH_OAK_NAME, |
| 864 | IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION, |
| 865 | kOsAll, |
| 866 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak), |
| 867 | }, |
| 868 | #endif |
| 869 | { |
| 870 | "enable-devtools-experiments", |
| 871 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME, |
| 872 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 873 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 874 | SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments) |
| 875 | }, |
| 876 | { |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 877 | "remote-debugging-raw-usb", |
| 878 | IDS_FLAGS_REMOTE_DEBUGGING_RAW_USB_NAME, |
| 879 | IDS_FLAGS_REMOTE_DEBUGGING_RAW_USB_DESCRIPTION, |
| 880 | kOsDesktop, |
| 881 | SINGLE_VALUE_TYPE(switches::kRemoteDebuggingRawUSB) |
| 882 | }, |
| 883 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 884 | "silent-debugger-extension-api", |
| 885 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME, |
| 886 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION, |
| 887 | kOsDesktop, |
| 888 | SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI) |
| 889 | }, |
| 890 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 891 | "enable-suggestions-ntp", |
| 892 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME, |
| 893 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 894 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 895 | SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage) |
| 896 | }, |
| 897 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 898 | "spellcheck-autocorrect", |
| 899 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT, |
| 900 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 901 | kOsWin | kOsLinux | kOsCrOS, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 902 | SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect) |
| 903 | }, |
| 904 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 905 | "enable-scroll-prediction", |
| 906 | IDS_FLAGS_ENABLE_SCROLL_PREDICTION_NAME, |
| 907 | IDS_FLAGS_ENABLE_SCROLL_PREDICTION_DESCRIPTION, |
| 908 | kOsDesktop, |
| 909 | SINGLE_VALUE_TYPE(switches::kEnableScrollPrediction) |
| 910 | }, |
| 911 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 912 | "touch-events", |
| 913 | IDS_TOUCH_EVENTS_NAME, |
| 914 | IDS_TOUCH_EVENTS_DESCRIPTION, |
| 915 | kOsDesktop, |
| 916 | MULTI_VALUE_TYPE(kTouchEventsChoices) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 917 | }, |
| 918 | { |
| 919 | "touch-optimized-ui", |
| 920 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME, |
| 921 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION, |
| 922 | kOsWin, |
| 923 | MULTI_VALUE_TYPE(kTouchOptimizedUIChoices) |
| 924 | }, |
| 925 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 926 | "disable-touch-adjustment", |
| 927 | IDS_DISABLE_TOUCH_ADJUSTMENT_NAME, |
| 928 | IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION, |
| 929 | kOsWin | kOsLinux | kOsCrOS, |
| 930 | SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 931 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 932 | #if defined(OS_CHROMEOS) |
| 933 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 934 | "ash-use-alternate-shelf", |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 935 | IDS_FLAGS_ALTERNATE_SHELF_LAYOUT_NAME, |
| 936 | IDS_FLAGS_ALTERNATE_SHELF_LAYOUT_DESCRIPTION, |
| 937 | kOsCrOS, |
| 938 | SINGLE_VALUE_TYPE(ash::switches::kAshUseAlternateShelfLayout) |
| 939 | }, |
| 940 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 941 | "enable-background-loader", |
| 942 | IDS_ENABLE_BACKLOADER_NAME, |
| 943 | IDS_ENABLE_BACKLOADER_DESCRIPTION, |
| 944 | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 945 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableBackgroundLoader) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 946 | }, |
| 947 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 948 | "enable-screensaver-extension", |
| 949 | IDS_ENABLE_SCREENSAVER_EXTENSION_NAME, |
| 950 | IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION, |
| 951 | kOsCrOS, |
| 952 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions) |
| 953 | }, |
| 954 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 955 | "no-discard-tabs", |
| 956 | IDS_FLAGS_NO_DISCARD_TABS_NAME, |
| 957 | IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION, |
| 958 | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 959 | SINGLE_VALUE_TYPE(chromeos::switches::kNoDiscardTabs) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 960 | }, |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 961 | { |
| 962 | "ash-enable-docked-windows", |
| 963 | IDS_FLAGS_DOCKED_WINDOWS_NAME, |
| 964 | IDS_FLAGS_DOCKED_WINDOWS_DESCRIPTION, |
| 965 | kOsCrOS, |
| 966 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableDockedWindows) |
| 967 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 968 | #endif |
| 969 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 970 | "enable-download-resumption", |
| 971 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME, |
| 972 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION, |
| 973 | kOsDesktop, |
| 974 | SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption) |
| 975 | }, |
| 976 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 977 | "allow-nacl-socket-api", |
| 978 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME, |
| 979 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 980 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 981 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*") |
| 982 | }, |
| 983 | { |
| 984 | "stacked-tab-strip", |
| 985 | IDS_FLAGS_STACKED_TAB_STRIP_NAME, |
| 986 | IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION, |
| 987 | kOsWin, |
| 988 | SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip) |
| 989 | }, |
| 990 | { |
| 991 | "force-device-scale-factor", |
| 992 | IDS_FLAGS_FORCE_HIGH_DPI_NAME, |
| 993 | IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION, |
| 994 | kOsCrOS, |
| 995 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2") |
| 996 | }, |
| 997 | #if defined(OS_CHROMEOS) |
| 998 | { |
| 999 | "allow-touchpad-three-finger-click", |
| 1000 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME, |
| 1001 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION, |
| 1002 | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1003 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableTouchpadThreeFingerClick) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1004 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1005 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1006 | #if defined(USE_ASH) |
| 1007 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1008 | "show-launcher-alignment-menu", |
Ben Murdoch | 2385ea3 | 2013-08-06 11:01:04 +0100 | [diff] [blame] | 1009 | IDS_FLAGS_SHOW_SHELF_ALIGNMENT_MENU_NAME, |
| 1010 | IDS_FLAGS_SHOW_SHELF_ALIGNMENT_MENU_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1011 | kOsAll, |
Ben Murdoch | 2385ea3 | 2013-08-06 11:01:04 +0100 | [diff] [blame] | 1012 | SINGLE_VALUE_TYPE(switches::kShowShelfAlignmentMenu) |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1013 | }, |
| 1014 | { |
| 1015 | "disable-minimize-on-second-launcher-item-click", |
| 1016 | IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_NAME, |
| 1017 | IDS_FLAGS_DISABLE_MINIMIZE_ON_SECOND_LAUNCHER_ITEM_CLICK_DESCRIPTION, |
| 1018 | kOsAll, |
| 1019 | SINGLE_VALUE_TYPE(switches::kDisableMinimizeOnSecondLauncherItemClick) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1020 | }, |
| 1021 | { |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 1022 | "enable-overview-mode", |
| 1023 | IDS_FLAGS_OVERVIEW_MODE_NAME, |
| 1024 | IDS_FLAGS_OVERVIEW_MODE_DESCRIPTION, |
| 1025 | kOsCrOS, |
| 1026 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableOverviewMode) |
| 1027 | }, |
| 1028 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1029 | "show-touch-hud", |
| 1030 | IDS_FLAGS_SHOW_TOUCH_HUD_NAME, |
| 1031 | IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION, |
| 1032 | kOsAll, |
| 1033 | SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud) |
| 1034 | }, |
| 1035 | { |
| 1036 | "enable-pinch", |
| 1037 | IDS_FLAGS_ENABLE_PINCH_SCALE_NAME, |
| 1038 | IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1039 | kOsLinux | kOsWin | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1040 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnablePinch, switches::kDisablePinch), |
| 1041 | }, |
| 1042 | { |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1043 | "enable-pinch-virtual-viewport", |
| 1044 | IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_NAME, |
| 1045 | IDS_FLAGS_ENABLE_PINCH_VIRTUAL_VIEWPORT_DESCRIPTION, |
| 1046 | kOsLinux | kOsWin | kOsCrOS, |
| 1047 | SINGLE_VALUE_TYPE(cc::switches::kEnablePinchVirtualViewport), |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1048 | }, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1049 | { |
| 1050 | "forced-maximize-mode", |
| 1051 | IDS_FLAGS_FORCE_MAXIMIZE_MODE_NAME, |
| 1052 | IDS_FLAGS_FORCE_MAXIMIZE_MODE_DESCRIPTION, |
| 1053 | kOsLinux | kOsWin | kOsCrOS, |
| 1054 | SINGLE_VALUE_TYPE(ash::switches::kForcedMaximizeMode), |
| 1055 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1056 | #endif // defined(USE_ASH) |
| 1057 | #if defined(OS_CHROMEOS) |
| 1058 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1059 | "disable-boot-animation", |
| 1060 | IDS_FLAGS_DISABLE_BOOT_ANIMATION, |
| 1061 | IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1062 | kOsCrOSOwnerOnly, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1063 | SINGLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation), |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1064 | }, |
| 1065 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1066 | "captive-portal-detector", |
| 1067 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME, |
| 1068 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1069 | kOsCrOSOwnerOnly, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1070 | MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices), |
| 1071 | }, |
| 1072 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1073 | "disable-new-lock-animations", |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1074 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS, |
| 1075 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION, |
| 1076 | kOsCrOS, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1077 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations), |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1078 | }, |
| 1079 | { |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1080 | "file-manager-show-checkboxes", |
| 1081 | IDS_FLAGS_FILE_MANAGER_SHOW_CHECKBOXES_NAME, |
| 1082 | IDS_FLAGS_FILE_MANAGER_SHOW_CHECKBOXES_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1083 | kOsCrOS, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1084 | SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerShowCheckboxes) |
| 1085 | }, |
| 1086 | { |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 1087 | "file-manager-enable-webstore-integration", |
| 1088 | IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION, |
| 1089 | IDS_FLAGS_FILE_MANAGER_ENABLE_WEBSTORE_INTEGRATION_DESCRIPTION, |
| 1090 | kOsCrOS, |
| 1091 | SINGLE_VALUE_TYPE(chromeos::switches::kFileManagerEnableWebstoreIntegration) |
| 1092 | }, |
| 1093 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1094 | "disable-quickoffice-component-app", |
| 1095 | IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_NAME, |
| 1096 | IDS_FLAGS_DISABLE_QUICKOFFICE_COMPONENT_APP_DESCRIPTION, |
| 1097 | kOsCrOS, |
| 1098 | SINGLE_VALUE_TYPE(chromeos::switches::kDisableQuickofficeComponentApp), |
| 1099 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1100 | #endif // defined(OS_CHROMEOS) |
| 1101 | { |
| 1102 | "views-textfield", |
| 1103 | IDS_FLAGS_VIEWS_TEXTFIELD_NAME, |
| 1104 | IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1105 | kOsWin, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1106 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield, |
| 1107 | switches::kDisableViewsTextfield), |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1108 | }, |
| 1109 | { |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1110 | "new-dialog-style", |
| 1111 | IDS_FLAGS_NEW_DIALOG_STYLE_NAME, |
| 1112 | IDS_FLAGS_NEW_DIALOG_STYLE_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1113 | kOsWin | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1114 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableNewDialogStyle, |
| 1115 | switches::kDisableNewDialogStyle), |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1116 | }, |
| 1117 | { "disable-accelerated-video-decode", |
| 1118 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, |
| 1119 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1120 | kOsWin | kOsCrOS, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1121 | SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), |
| 1122 | }, |
| 1123 | #if defined(USE_ASH) |
| 1124 | { |
| 1125 | "ash-debug-shortcuts", |
| 1126 | IDS_FLAGS_DEBUG_SHORTCUTS_NAME, |
| 1127 | IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION, |
| 1128 | kOsAll, |
| 1129 | SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), |
| 1130 | }, |
| 1131 | #endif |
| 1132 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1133 | "enable-contacts", |
| 1134 | IDS_FLAGS_ENABLE_CONTACTS_NAME, |
| 1135 | IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION, |
| 1136 | kOsCrOS, |
| 1137 | SINGLE_VALUE_TYPE(switches::kEnableContacts) |
| 1138 | }, |
| 1139 | #if defined(USE_ASH) |
| 1140 | { "ash-enable-advanced-gestures", |
| 1141 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME, |
| 1142 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION, |
| 1143 | kOsCrOS, |
| 1144 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures), |
| 1145 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1146 | { "ash-disable-tab-scrubbing", |
| 1147 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME, |
| 1148 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION, |
| 1149 | kOsCrOS, |
| 1150 | SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing), |
| 1151 | }, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1152 | { "ash-disable-drag-and-drop-applist-to-launcher", |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1153 | IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_NAME, |
| 1154 | IDS_FLAGS_DND_APPLIST_TO_LAUNCHER_DESCRIPTION, |
| 1155 | kOsCrOS, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1156 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableDragAndDropAppListToLauncher), |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1157 | }, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1158 | { "ash-immersive-fullscreen-2", |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1159 | IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_NAME, |
| 1160 | IDS_FLAGS_ASH_IMMERSIVE_FULLSCREEN_DESCRIPTION, |
| 1161 | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1162 | ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableImmersiveFullscreen, |
| 1163 | ash::switches::kAshDisableImmersiveFullscreen), |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1164 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1165 | #if defined(OS_LINUX) |
| 1166 | { "ash-enable-memory-monitor", |
| 1167 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME, |
| 1168 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION, |
| 1169 | kOsCrOS, |
| 1170 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor), |
| 1171 | }, |
| 1172 | #endif |
| 1173 | #endif |
| 1174 | #if defined(OS_CHROMEOS) |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1175 | { "use-new-network-configuration-handlers", |
| 1176 | IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_NAME, |
| 1177 | IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONFIGURATION_HANDLERS_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1178 | kOsCrOS, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1179 | SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConfigurationHandlers), |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1180 | }, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1181 | { "use-new-network-connection-handler", |
| 1182 | IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_NAME, |
| 1183 | IDS_FLAGS_CHROMEOS_USE_NEW_NETWORK_CONNECTION_HANDLER_DESCRIPTION, |
| 1184 | kOsCrOS, |
| 1185 | SINGLE_VALUE_TYPE(chromeos::switches::kUseNewNetworkConnectionHandler), |
| 1186 | }, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1187 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1188 | "ash-audio-device-menu", |
| 1189 | IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_NAME, |
| 1190 | IDS_FLAGS_ASH_AUDIO_DEVICE_MENU_DESCRIPTION, |
| 1191 | kOsCrOS, |
Ben Murdoch | 58e6fbe | 2013-07-26 10:20:38 +0100 | [diff] [blame] | 1192 | ENABLE_DISABLE_VALUE_TYPE(ash::switches::kAshEnableAudioDeviceMenu, |
| 1193 | ash::switches::kAshDisableAudioDeviceMenu) |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1194 | }, |
| 1195 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1196 | "enable-carrier-switching", |
| 1197 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING, |
| 1198 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION, |
| 1199 | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1200 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableCarrierSwitching) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1201 | }, |
| 1202 | { |
| 1203 | "enable-request-tablet-site", |
| 1204 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME, |
| 1205 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION, |
| 1206 | kOsCrOS, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1207 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableRequestTabletSite) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1208 | }, |
| 1209 | #endif |
| 1210 | { |
| 1211 | "debug-packed-apps", |
| 1212 | IDS_FLAGS_DEBUG_PACKED_APP_NAME, |
| 1213 | IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1214 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1215 | SINGLE_VALUE_TYPE(switches::kDebugPackedApps) |
| 1216 | }, |
| 1217 | { |
| 1218 | "enable-password-generation", |
| 1219 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME, |
| 1220 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1221 | kOsDesktop, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1222 | SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration) |
| 1223 | }, |
| 1224 | { |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 1225 | "password-autofill-public-suffix-domain-matching", |
| 1226 | IDS_FLAGS_PASSWORD_AUTOFILL_PUBLIC_SUFFIX_DOMAIN_MATCHING_NAME, |
| 1227 | IDS_FLAGS_PASSWORD_AUTOFILL_PUBLIC_SUFFIX_DOMAIN_MATCHING_DESCRIPTION, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1228 | kOsAndroid, |
Ben Murdoch | ca12bfa | 2013-07-23 11:17:05 +0100 | [diff] [blame] | 1229 | ENABLE_DISABLE_VALUE_TYPE( |
| 1230 | switches::kEnablePasswordAutofillPublicSuffixDomainMatching, |
| 1231 | switches::kDisablePasswordAutofillPublicSuffixDomainMatching) |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1232 | }, |
| 1233 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1234 | "enable-deferred-image-decoding", |
| 1235 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME, |
| 1236 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1237 | kOsMac | kOsLinux | kOsCrOS, |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1238 | SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding) |
| 1239 | }, |
| 1240 | { |
| 1241 | "performance-monitor-gathering", |
| 1242 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME, |
| 1243 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION, |
| 1244 | kOsAll, |
| 1245 | SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering) |
| 1246 | }, |
| 1247 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1248 | "enable-experimental-form-filling", |
| 1249 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME, |
| 1250 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION, |
| 1251 | kOsWin | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1252 | SINGLE_VALUE_TYPE(autofill::switches::kEnableExperimentalFormFilling) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1253 | }, |
| 1254 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1255 | "wallet-service-use-prod", |
| 1256 | IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_NAME, |
| 1257 | IDS_FLAGS_ENABLE_WALLET_PRODUCTION_SERVICE_DESCRIPTION, |
| 1258 | kOsCrOS | kOsWin, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1259 | SINGLE_VALUE_TYPE(autofill::switches::kWalletServiceUseProd) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1260 | }, |
| 1261 | { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1262 | "enable-interactive-autocomplete", |
| 1263 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME, |
| 1264 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 1265 | kOsWin | kOsCrOS | kOsMac, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1266 | ENABLE_DISABLE_VALUE_TYPE( |
| 1267 | autofill::switches::kEnableInteractiveAutocomplete, |
| 1268 | autofill::switches::kDisableInteractiveAutocomplete) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1269 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1270 | #if defined(USE_AURA) |
| 1271 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1272 | "overscroll-history-navigation", |
| 1273 | IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_NAME, |
| 1274 | IDS_FLAGS_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1275 | kOsAll, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1276 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 1277 | switches::kOverscrollHistoryNavigation, "1", |
| 1278 | switches::kOverscrollHistoryNavigation, "0") |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1279 | }, |
| 1280 | #endif |
| 1281 | { |
Ben Murdoch | bbcdd45 | 2013-07-25 10:06:34 +0100 | [diff] [blame] | 1282 | "scroll-end-effect", |
| 1283 | IDS_FLAGS_SCROLL_END_EFFECT_NAME, |
| 1284 | IDS_FLAGS_SCROLL_END_EFFECT_DESCRIPTION, |
| 1285 | kOsCrOS, |
| 1286 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 1287 | switches::kScrollEndEffect, "1", |
| 1288 | switches::kScrollEndEffect, "0") |
| 1289 | }, |
| 1290 | { |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 1291 | "enable-touch-side-bezels", |
| 1292 | IDS_FLAGS_ENABLE_TOUCH_SIDE_BEZELS_NAME, |
| 1293 | IDS_FLAGS_ENABLE_TOUCH_SIDE_BEZELS_DESCRIPTION, |
| 1294 | kOsCrOS, |
| 1295 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( |
| 1296 | switches::kTouchSideBezels, "1", |
| 1297 | switches::kTouchSideBezels, "0") |
| 1298 | }, |
| 1299 | { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1300 | "enable-touch-drag-drop", |
| 1301 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME, |
| 1302 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION, |
| 1303 | kOsWin | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1304 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchDragDrop, |
| 1305 | switches::kDisableTouchDragDrop) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1306 | }, |
| 1307 | { |
| 1308 | "enable-touch-editing", |
| 1309 | IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME, |
| 1310 | IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION, |
| 1311 | kOsCrOS, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1312 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchEditing, |
| 1313 | switches::kDisableTouchEditing) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1314 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1315 | { |
| 1316 | "enable-rich-notifications", |
| 1317 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME, |
| 1318 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1319 | kOsWin | kOsMac, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1320 | ENABLE_DISABLE_VALUE_TYPE( |
| 1321 | message_center::switches::kEnableRichNotifications, |
| 1322 | message_center::switches::kDisableRichNotifications) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1323 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1324 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1325 | "enable-sync-synced-notifications", |
| 1326 | IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_NAME, |
| 1327 | IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1328 | kOsDesktop, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1329 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableSyncSyncedNotifications, |
| 1330 | switches::kDisableSyncSyncedNotifications) |
| 1331 | }, |
| 1332 | { |
| 1333 | "disable-full-history-sync", |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1334 | IDS_FLAGS_FULL_HISTORY_SYNC_NAME, |
| 1335 | IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION, |
| 1336 | kOsAll, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1337 | SINGLE_VALUE_TYPE(switches::kHistoryDisableFullHistorySync) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1338 | }, |
| 1339 | { |
| 1340 | "enable-usermedia-screen-capture", |
| 1341 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME, |
| 1342 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION, |
| 1343 | kOsDesktop, |
| 1344 | SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing) |
| 1345 | }, |
| 1346 | { |
| 1347 | "enable-apps-devtool-app", |
| 1348 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME, |
| 1349 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION, |
| 1350 | kOsDesktop, |
| 1351 | SINGLE_VALUE_TYPE(switches::kAppsDevtool) |
| 1352 | }, |
| 1353 | { |
| 1354 | "impl-side-painting", |
| 1355 | IDS_FLAGS_IMPL_SIDE_PAINTING_NAME, |
| 1356 | IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION, |
| 1357 | kOsAndroid | kOsLinux | kOsCrOS, |
| 1358 | MULTI_VALUE_TYPE(kImplSidePaintingChoices) |
| 1359 | }, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1360 | { |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 1361 | "delegated-renderer", |
| 1362 | IDS_FLAGS_DELEGATED_RENDERER_NAME, |
| 1363 | IDS_FLAGS_DELEGATED_RENDERER_DESCRIPTION, |
| 1364 | #ifdef USE_AURA |
| 1365 | kOsWin | kOsLinux | |
| 1366 | #endif |
| 1367 | kOsAndroid | kOsCrOS, |
| 1368 | MULTI_VALUE_TYPE(kDelegatedRendererChoices) |
| 1369 | }, |
| 1370 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1371 | "enable-websocket-experimental-implementation", |
| 1372 | IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_NAME, |
| 1373 | IDS_FLAGS_ENABLE_EXPERIMENTAL_WEBSOCKET_DESCRIPTION, |
| 1374 | kOsAll, |
| 1375 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebSocket) |
| 1376 | }, |
| 1377 | { |
| 1378 | "max-tiles-for-interest-area", |
| 1379 | IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_NAME, |
| 1380 | IDS_FLAGS_MAX_TILES_FOR_INTEREST_AREA_DESCRIPTION, |
| 1381 | kOsAndroid | kOsLinux | kOsCrOS, |
| 1382 | MULTI_VALUE_TYPE(kMaxTilesForInterestAreaChoices) |
| 1383 | }, |
| 1384 | { |
| 1385 | "enable-offline-mode", |
| 1386 | IDS_FLAGS_ENABLE_OFFLINE_MODE_NAME, |
| 1387 | IDS_FLAGS_ENABLE_OFFLINE_MODE_DESCRIPTION, |
| 1388 | kOsAll, |
| 1389 | SINGLE_VALUE_TYPE(switches::kEnableOfflineCacheAccess) |
| 1390 | }, |
| 1391 | { |
| 1392 | "default-tile-width", |
| 1393 | IDS_FLAGS_DEFAULT_TILE_WIDTH_NAME, |
| 1394 | IDS_FLAGS_DEFAULT_TILE_WIDTH_DESCRIPTION, |
| 1395 | kOsAll, |
| 1396 | MULTI_VALUE_TYPE(kDefaultTileWidthChoices) |
| 1397 | }, |
| 1398 | { |
| 1399 | "default-tile-height", |
| 1400 | IDS_FLAGS_DEFAULT_TILE_HEIGHT_NAME, |
| 1401 | IDS_FLAGS_DEFAULT_TILE_HEIGHT_DESCRIPTION, |
| 1402 | kOsAll, |
| 1403 | MULTI_VALUE_TYPE(kDefaultTileHeightChoices) |
| 1404 | }, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1405 | // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura. |
| 1406 | #if !defined(USE_AURA) |
| 1407 | { |
| 1408 | "track-active-visit-time", |
| 1409 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME, |
| 1410 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION, |
| 1411 | kOsWin, |
| 1412 | SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime) |
| 1413 | }, |
| 1414 | #endif |
| 1415 | #if defined(OS_ANDROID) |
| 1416 | { |
| 1417 | "disable-gesture-requirement-for-media-playback", |
| 1418 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME, |
| 1419 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION, |
| 1420 | kOsAndroid, |
| 1421 | SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback) |
| 1422 | }, |
| 1423 | #endif |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1424 | #if defined(ENABLE_GOOGLE_NOW) |
| 1425 | { |
| 1426 | "enable-google-now", |
| 1427 | IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME, |
| 1428 | IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1429 | kOsWin | kOsCrOS | kOsMac, |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1430 | SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration) |
| 1431 | }, |
| 1432 | #endif |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1433 | #if defined(OS_CHROMEOS) |
| 1434 | { |
| 1435 | "enable-virtual-keyboard", |
| 1436 | IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_NAME, |
| 1437 | IDS_FLAGS_ENABLE_VIRTUAL_KEYBOARD_DESCRIPTION, |
| 1438 | kOsCrOS, |
| 1439 | SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard) |
| 1440 | }, |
| 1441 | #endif |
| 1442 | { |
| 1443 | "enable-simple-cache-backend", |
| 1444 | IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME, |
| 1445 | IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_DESCRIPTION, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1446 | kOsAll, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1447 | MULTI_VALUE_TYPE(kSimpleCacheBackendChoices) |
| 1448 | }, |
| 1449 | { |
| 1450 | "enable-tcp-fast-open", |
| 1451 | IDS_FLAGS_ENABLE_TCP_FAST_OPEN_NAME, |
| 1452 | IDS_FLAGS_ENABLE_TCP_FAST_OPEN_DESCRIPTION, |
| 1453 | kOsLinux | kOsCrOS | kOsAndroid, |
| 1454 | SINGLE_VALUE_TYPE(switches::kEnableTcpFastOpen) |
| 1455 | }, |
| 1456 | { |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1457 | "apps-use-native-frame", |
| 1458 | IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_NAME, |
| 1459 | IDS_FLAGS_ENABLE_NATIVE_FRAMES_FOR_APPS_DESCRIPTION, |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1460 | kOsMac | kOsWin, |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1461 | SINGLE_VALUE_TYPE(switches::kAppsUseNativeFrame) |
| 1462 | }, |
Torne (Richard Coles) | b2df76e | 2013-05-13 16:52:09 +0100 | [diff] [blame] | 1463 | { |
| 1464 | "enable-syncfs-directory-operation", |
| 1465 | IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_NAME, |
| 1466 | IDS_FLAGS_ENABLE_SYNC_DIRECTORY_OPERATION_DESCRIPTION, |
| 1467 | kOsAll, |
| 1468 | SINGLE_VALUE_TYPE(switches::kSyncfsEnableDirectoryOperation), |
| 1469 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1470 | { |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1471 | "enable-reset-profile-settings", |
| 1472 | IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_NAME, |
| 1473 | IDS_FLAGS_ENABLE_RESET_PROFILE_SETTINGS_DESCRIPTION, |
| 1474 | kOsAll, |
| 1475 | SINGLE_VALUE_TYPE(switches::kEnableResetProfileSettings) |
| 1476 | }, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 1477 | { |
| 1478 | "enable-device-discovery", |
| 1479 | IDS_FLAGS_ENABLE_DEVICE_DISCOVERY_NAME, |
| 1480 | IDS_FLAGS_ENABLE_DEVICE_DISCOVERY_DESCRIPTION, |
| 1481 | kOsDesktop, |
| 1482 | SINGLE_VALUE_TYPE(switches::kEnableDeviceDiscovery) |
| 1483 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1484 | #if defined(OS_MACOSX) |
| 1485 | { |
| 1486 | "enable-app-list-shim", |
| 1487 | IDS_FLAGS_ENABLE_APP_LIST_SHIM_NAME, |
| 1488 | IDS_FLAGS_ENABLE_APP_LIST_SHIM_DESCRIPTION, |
| 1489 | kOsMac, |
| 1490 | SINGLE_VALUE_TYPE(switches::kEnableAppListShim) |
| 1491 | }, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1492 | { |
| 1493 | "enable-app-shims", |
| 1494 | IDS_FLAGS_ENABLE_APP_SHIMS_NAME, |
| 1495 | IDS_FLAGS_ENABLE_APP_SHIMS_DESCRIPTION, |
| 1496 | kOsMac, |
| 1497 | SINGLE_VALUE_TYPE(switches::kEnableAppShims) |
| 1498 | }, |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1499 | { |
| 1500 | "enable-simplified-fullscreen", |
| 1501 | IDS_FLAGS_ENABLE_SIMPLIFIED_FULLSCREEN_NAME, |
| 1502 | IDS_FLAGS_ENABLE_SIMPLIFIED_FULLSCREEN_DESCRIPTION, |
| 1503 | kOsMac, |
| 1504 | SINGLE_VALUE_TYPE(switches::kEnableSimplifiedFullscreen) |
| 1505 | }, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1506 | #endif |
| 1507 | #if defined(OS_CHROMEOS) || defined(OS_WIN) |
| 1508 | { |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 1509 | "omnibox-auto-completion-for-ime", |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1510 | IDS_FLAGS_ENABLE_OMNIBOX_AUTO_COMPLETION_FOR_IME_NAME, |
| 1511 | IDS_FLAGS_ENABLE_OMNIBOX_AUTO_COMPLETION_FOR_IME_DESCRIPTION, |
Ben Murdoch | 558790d | 2013-07-30 15:19:42 +0100 | [diff] [blame] | 1512 | kOsCrOS | kOsWin, |
| 1513 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOmniboxAutoCompletionForIme, |
| 1514 | switches::kDisableOmniboxAutoCompletionForIme) |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1515 | }, |
| 1516 | #endif |
| 1517 | #if defined(USE_AURA) |
| 1518 | { |
| 1519 | "tab-capture-upscale-quality", |
| 1520 | IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_NAME, |
| 1521 | IDS_FLAGS_TAB_CAPTURE_UPSCALE_QUALITY_DESCRIPTION, |
| 1522 | kOsAll, |
| 1523 | MULTI_VALUE_TYPE(kTabCaptureUpscaleQualityChoices) |
| 1524 | }, |
| 1525 | { |
| 1526 | "tab-capture-downscale-quality", |
| 1527 | IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_NAME, |
| 1528 | IDS_FLAGS_TAB_CAPTURE_DOWNSCALE_QUALITY_DESCRIPTION, |
| 1529 | kOsAll, |
| 1530 | MULTI_VALUE_TYPE(kTabCaptureDownscaleQualityChoices) |
| 1531 | }, |
| 1532 | #endif |
| 1533 | { |
| 1534 | "enable-spelling-service-feedback", |
| 1535 | IDS_FLAGS_ENABLE_SPELLING_SERVICE_FEEDBACK_NAME, |
| 1536 | IDS_FLAGS_ENABLE_SPELLING_SERVICE_FEEDBACK_DESCRIPTION, |
| 1537 | kOsAll, |
| 1538 | SINGLE_VALUE_TYPE(switches::kEnableSpellingServiceFeedback) |
| 1539 | }, |
| 1540 | { |
| 1541 | "enable-webgl-draft-extensions", |
| 1542 | IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_NAME, |
| 1543 | IDS_FLAGS_ENABLE_WEBGL_DRAFT_EXTENSIONS_DESCRIPTION, |
| 1544 | kOsAll, |
| 1545 | SINGLE_VALUE_TYPE(switches::kEnableWebGLDraftExtensions) |
| 1546 | }, |
| 1547 | { |
| 1548 | "high-dpi-support", |
| 1549 | IDS_FLAGS_HIDPI_NAME, |
| 1550 | IDS_FLAGS_HIDPI_DESCRIPTION, |
| 1551 | kOsWin, |
| 1552 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kHighDPISupport,"1", |
| 1553 | switches::kHighDPISupport,"0") |
| 1554 | }, |
| 1555 | #if defined(OS_CHROMEOS) |
| 1556 | { |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1557 | "enable-quickoffice-viewing", |
| 1558 | IDS_FLAGS_ENABLE_QUICKOFFICE_DESKTOP_VIEWING_NAME, |
| 1559 | IDS_FLAGS_ENABLE_QUICKOFFICE_DESKTOP_VIEWING_DESCRIPTION, |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1560 | kOsCrOS, |
Ben Murdoch | 3240926 | 2013-08-07 11:04:47 +0100 | [diff] [blame] | 1561 | SINGLE_VALUE_TYPE(switches::kEnableQuickofficeViewing), |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 1562 | }, |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 1563 | { |
| 1564 | "enable-sticky-keys", |
| 1565 | IDS_FLAGS_ENABLE_STICKY_KEYS_NAME, |
| 1566 | IDS_FLAGS_ENABLE_STICKY_KEYS_DESCRIPTION, |
| 1567 | kOsCrOS, |
Torne (Richard Coles) | a36e592 | 2013-08-05 13:57:33 +0100 | [diff] [blame] | 1568 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableStickyKeys, |
| 1569 | switches::kDisableStickyKeys) |
Ben Murdoch | a3f7b4e | 2013-07-24 10:36:34 +0100 | [diff] [blame] | 1570 | }, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1571 | #endif |
Torne (Richard Coles) | 5e3f23d | 2013-06-11 16:24:11 +0100 | [diff] [blame] | 1572 | { |
| 1573 | "enable-translate-settings", |
| 1574 | IDS_FLAGS_ENABLE_TRANSLATE_SETTINGS_NAME, |
| 1575 | IDS_FLAGS_ENABLE_TRANSLATE_SETTINGS_DESCRIPTION, |
| 1576 | kOsAll, |
| 1577 | SINGLE_VALUE_TYPE(switches::kEnableTranslateSettings) |
| 1578 | }, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1579 | { |
| 1580 | "enable-web-midi", |
| 1581 | IDS_FLAGS_ENABLE_WEB_MIDI_NAME, |
| 1582 | IDS_FLAGS_ENABLE_WEB_MIDI_DESCRIPTION, |
| 1583 | kOsMac, |
| 1584 | SINGLE_VALUE_TYPE(switches::kEnableWebMIDI) |
| 1585 | }, |
| 1586 | { |
| 1587 | "enable-new-profile-management", |
| 1588 | IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_NAME, |
| 1589 | IDS_FLAGS_ENABLE_NEW_PROFILE_MANAGEMENT_DESCRIPTION, |
| 1590 | kOsWin, |
| 1591 | SINGLE_VALUE_TYPE(switches::kNewProfileManagement) |
| 1592 | }, |
| 1593 | { |
| 1594 | "enable-gaia-profile-info", |
| 1595 | IDS_FLAGS_ENABLE_GAIA_PROFILE_INFO_NAME, |
| 1596 | IDS_FLAGS_ENABLE_GAIA_PROFILE_INFO_DESCRIPTION, |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 1597 | kOsMac | kOsWin | kOsLinux, |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 1598 | SINGLE_VALUE_TYPE(switches::kGaiaProfileInfo) |
| 1599 | }, |
| 1600 | #if defined(OS_WIN) |
| 1601 | { |
| 1602 | "disable-app-launcher", |
| 1603 | IDS_FLAGS_DISABLE_APP_LIST_NAME, |
| 1604 | IDS_FLAGS_DISABLE_APP_LIST_DESCRIPTION, |
| 1605 | kOsAll, |
| 1606 | SINGLE_VALUE_TYPE(switches::kDisableAppList) |
| 1607 | }, |
| 1608 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1609 | }; |
| 1610 | |
| 1611 | const Experiment* experiments = kExperiments; |
| 1612 | size_t num_experiments = arraysize(kExperiments); |
| 1613 | |
| 1614 | // Stores and encapsulates the little state that about:flags has. |
| 1615 | class FlagsState { |
| 1616 | public: |
| 1617 | FlagsState() : needs_restart_(false) {} |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1618 | void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| 1619 | CommandLine* command_line); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1620 | bool IsRestartNeededToCommitChanges(); |
| 1621 | void SetExperimentEnabled( |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1622 | FlagsStorage* flags_storage, |
| 1623 | const std::string& internal_name, |
| 1624 | bool enable); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1625 | void RemoveFlagsSwitches( |
| 1626 | std::map<std::string, CommandLine::StringType>* switch_list); |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1627 | void ResetAllFlags(FlagsStorage* flags_storage); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1628 | void reset(); |
| 1629 | |
| 1630 | // Returns the singleton instance of this class |
| 1631 | static FlagsState* GetInstance() { |
| 1632 | return Singleton<FlagsState>::get(); |
| 1633 | } |
| 1634 | |
| 1635 | private: |
| 1636 | bool needs_restart_; |
| 1637 | std::map<std::string, std::string> flags_switches_; |
| 1638 | |
| 1639 | DISALLOW_COPY_AND_ASSIGN(FlagsState); |
| 1640 | }; |
| 1641 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1642 | // Adds the internal names for the specified experiment to |names|. |
| 1643 | void AddInternalName(const Experiment& e, std::set<std::string>* names) { |
| 1644 | if (e.type == Experiment::SINGLE_VALUE) { |
| 1645 | names->insert(e.internal_name); |
| 1646 | } else { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1647 | DCHECK(e.type == Experiment::MULTI_VALUE || |
| 1648 | e.type == Experiment::ENABLE_DISABLE_VALUE); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1649 | for (int i = 0; i < e.num_choices; ++i) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1650 | names->insert(e.NameForChoice(i)); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1651 | } |
| 1652 | } |
| 1653 | |
| 1654 | // Confirms that an experiment is valid, used in a DCHECK in |
| 1655 | // SanitizeList below. |
| 1656 | bool ValidateExperiment(const Experiment& e) { |
| 1657 | switch (e.type) { |
| 1658 | case Experiment::SINGLE_VALUE: |
| 1659 | DCHECK_EQ(0, e.num_choices); |
| 1660 | DCHECK(!e.choices); |
| 1661 | break; |
| 1662 | case Experiment::MULTI_VALUE: |
| 1663 | DCHECK_GT(e.num_choices, 0); |
| 1664 | DCHECK(e.choices); |
| 1665 | DCHECK(e.choices[0].command_line_switch); |
| 1666 | DCHECK_EQ('\0', e.choices[0].command_line_switch[0]); |
| 1667 | break; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1668 | case Experiment::ENABLE_DISABLE_VALUE: |
| 1669 | DCHECK_EQ(3, e.num_choices); |
| 1670 | DCHECK(!e.choices); |
| 1671 | DCHECK(e.command_line_switch); |
| 1672 | DCHECK(e.command_line_value); |
| 1673 | DCHECK(e.disable_command_line_switch); |
| 1674 | DCHECK(e.disable_command_line_value); |
| 1675 | break; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1676 | default: |
| 1677 | NOTREACHED(); |
| 1678 | } |
| 1679 | return true; |
| 1680 | } |
| 1681 | |
| 1682 | // Removes all experiments from prefs::kEnabledLabsExperiments that are |
| 1683 | // unknown, to prevent this list to become very long as experiments are added |
| 1684 | // and removed. |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1685 | void SanitizeList(FlagsStorage* flags_storage) { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1686 | std::set<std::string> known_experiments; |
| 1687 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1688 | DCHECK(ValidateExperiment(experiments[i])); |
| 1689 | AddInternalName(experiments[i], &known_experiments); |
| 1690 | } |
| 1691 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1692 | std::set<std::string> enabled_experiments = flags_storage->GetFlags(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1693 | |
| 1694 | std::set<std::string> new_enabled_experiments; |
| 1695 | std::set_intersection( |
| 1696 | known_experiments.begin(), known_experiments.end(), |
| 1697 | enabled_experiments.begin(), enabled_experiments.end(), |
| 1698 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1699 | |
| 1700 | if (new_enabled_experiments != enabled_experiments) |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1701 | flags_storage->SetFlags(new_enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1702 | } |
| 1703 | |
| 1704 | void GetSanitizedEnabledFlags( |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1705 | FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 1706 | SanitizeList(flags_storage); |
| 1707 | *result = flags_storage->GetFlags(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1708 | } |
| 1709 | |
| 1710 | // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 1711 | // enabled on the current platform. |
| 1712 | void GetSanitizedEnabledFlagsForCurrentPlatform( |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1713 | FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 1714 | GetSanitizedEnabledFlags(flags_storage, result); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1715 | |
| 1716 | // Filter out any experiments that aren't enabled on the current platform. We |
| 1717 | // don't remove these from prefs else syncing to a platform with a different |
| 1718 | // set of experiments would be lossy. |
| 1719 | std::set<std::string> platform_experiments; |
| 1720 | int current_platform = GetCurrentPlatform(); |
| 1721 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1722 | if (experiments[i].supported_platforms & current_platform) |
| 1723 | AddInternalName(experiments[i], &platform_experiments); |
Torne (Richard Coles) | c2e0dbd | 2013-05-09 18:35:53 +0100 | [diff] [blame] | 1724 | #if defined(OS_CHROMEOS) |
| 1725 | if (experiments[i].supported_platforms & kOsCrOSOwnerOnly) |
| 1726 | AddInternalName(experiments[i], &platform_experiments); |
| 1727 | #endif |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1728 | } |
| 1729 | |
| 1730 | std::set<std::string> new_enabled_experiments; |
| 1731 | std::set_intersection( |
| 1732 | platform_experiments.begin(), platform_experiments.end(), |
| 1733 | result->begin(), result->end(), |
| 1734 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1735 | |
| 1736 | result->swap(new_enabled_experiments); |
| 1737 | } |
| 1738 | |
| 1739 | // Returns the Value representing the choice data in the specified experiment. |
| 1740 | Value* CreateChoiceData(const Experiment& experiment, |
| 1741 | const std::set<std::string>& enabled_experiments) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1742 | DCHECK(experiment.type == Experiment::MULTI_VALUE || |
| 1743 | experiment.type == Experiment::ENABLE_DISABLE_VALUE); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1744 | ListValue* result = new ListValue; |
| 1745 | for (int i = 0; i < experiment.num_choices; ++i) { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1746 | DictionaryValue* value = new DictionaryValue; |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1747 | const std::string name = experiment.NameForChoice(i); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1748 | value->SetString("internal_name", name); |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1749 | value->SetString("description", experiment.DescriptionForChoice(i)); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1750 | value->SetBoolean("selected", enabled_experiments.count(name) > 0); |
| 1751 | result->Append(value); |
| 1752 | } |
| 1753 | return result; |
| 1754 | } |
| 1755 | |
| 1756 | } // namespace |
| 1757 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1758 | std::string Experiment::NameForChoice(int index) const { |
| 1759 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1760 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1761 | DCHECK_LT(index, num_choices); |
| 1762 | return std::string(internal_name) + testing::kMultiSeparator + |
| 1763 | base::IntToString(index); |
| 1764 | } |
| 1765 | |
| 1766 | string16 Experiment::DescriptionForChoice(int index) const { |
| 1767 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1768 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1769 | DCHECK_LT(index, num_choices); |
| 1770 | int description_id; |
| 1771 | if (type == Experiment::ENABLE_DISABLE_VALUE) { |
| 1772 | const int kEnableDisableDescriptionIds[] = { |
| 1773 | IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, |
| 1774 | IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 1775 | IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 1776 | }; |
| 1777 | description_id = kEnableDisableDescriptionIds[index]; |
| 1778 | } else { |
| 1779 | description_id = choices[index].description_id; |
| 1780 | } |
| 1781 | return l10n_util::GetStringUTF16(description_id); |
| 1782 | } |
| 1783 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1784 | void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| 1785 | CommandLine* command_line) { |
| 1786 | FlagsState::GetInstance()->ConvertFlagsToSwitches(flags_storage, |
| 1787 | command_line); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1788 | } |
| 1789 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1790 | bool AreSwitchesIdenticalToCurrentCommandLine( |
| 1791 | const CommandLine& new_cmdline, const CommandLine& active_cmdline) { |
| 1792 | std::set<CommandLine::StringType> new_flags = |
| 1793 | ExtractFlagsFromCommandLine(new_cmdline); |
| 1794 | std::set<CommandLine::StringType> active_flags = |
| 1795 | ExtractFlagsFromCommandLine(active_cmdline); |
| 1796 | |
| 1797 | // Needed because std::equal doesn't check if the 2nd set is empty. |
| 1798 | if (new_flags.size() != active_flags.size()) |
| 1799 | return false; |
| 1800 | |
| 1801 | return std::equal(new_flags.begin(), new_flags.end(), active_flags.begin()); |
| 1802 | } |
| 1803 | |
| 1804 | void GetFlagsExperimentsData(FlagsStorage* flags_storage, |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1805 | FlagAccess access, |
| 1806 | base::ListValue* supported_experiments, |
| 1807 | base::ListValue* unsupported_experiments) { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1808 | std::set<std::string> enabled_experiments; |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1809 | GetSanitizedEnabledFlags(flags_storage, &enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1810 | |
| 1811 | int current_platform = GetCurrentPlatform(); |
| 1812 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1813 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1814 | const Experiment& experiment = experiments[i]; |
| 1815 | |
| 1816 | DictionaryValue* data = new DictionaryValue(); |
| 1817 | data->SetString("internal_name", experiment.internal_name); |
| 1818 | data->SetString("name", |
| 1819 | l10n_util::GetStringUTF16(experiment.visible_name_id)); |
| 1820 | data->SetString("description", |
| 1821 | l10n_util::GetStringUTF16( |
| 1822 | experiment.visible_description_id)); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1823 | |
| 1824 | ListValue* supported_platforms = new ListValue(); |
| 1825 | AddOsStrings(experiment.supported_platforms, supported_platforms); |
| 1826 | data->Set("supported_platforms", supported_platforms); |
| 1827 | |
| 1828 | switch (experiment.type) { |
| 1829 | case Experiment::SINGLE_VALUE: |
| 1830 | data->SetBoolean( |
| 1831 | "enabled", |
| 1832 | enabled_experiments.count(experiment.internal_name) > 0); |
| 1833 | break; |
| 1834 | case Experiment::MULTI_VALUE: |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1835 | case Experiment::ENABLE_DISABLE_VALUE: |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1836 | data->Set("choices", CreateChoiceData(experiment, enabled_experiments)); |
| 1837 | break; |
| 1838 | default: |
| 1839 | NOTREACHED(); |
| 1840 | } |
| 1841 | |
Torne (Richard Coles) | 90dce4d | 2013-05-29 14:40:03 +0100 | [diff] [blame] | 1842 | bool supported = (experiment.supported_platforms & current_platform) != 0; |
| 1843 | #if defined(OS_CHROMEOS) |
| 1844 | if (access == kOwnerAccessToFlags && |
| 1845 | (experiment.supported_platforms & kOsCrOSOwnerOnly) != 0) { |
| 1846 | supported = true; |
| 1847 | } |
| 1848 | #endif |
| 1849 | if (supported) |
| 1850 | supported_experiments->Append(data); |
| 1851 | else |
| 1852 | unsupported_experiments->Append(data); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1853 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1854 | } |
| 1855 | |
| 1856 | bool IsRestartNeededToCommitChanges() { |
| 1857 | return FlagsState::GetInstance()->IsRestartNeededToCommitChanges(); |
| 1858 | } |
| 1859 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1860 | void SetExperimentEnabled(FlagsStorage* flags_storage, |
| 1861 | const std::string& internal_name, |
| 1862 | bool enable) { |
| 1863 | FlagsState::GetInstance()->SetExperimentEnabled(flags_storage, |
| 1864 | internal_name, enable); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1865 | } |
| 1866 | |
| 1867 | void RemoveFlagsSwitches( |
| 1868 | std::map<std::string, CommandLine::StringType>* switch_list) { |
| 1869 | FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list); |
| 1870 | } |
| 1871 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1872 | void ResetAllFlags(FlagsStorage* flags_storage) { |
| 1873 | FlagsState::GetInstance()->ResetAllFlags(flags_storage); |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1874 | } |
| 1875 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1876 | int GetCurrentPlatform() { |
| 1877 | #if defined(OS_MACOSX) |
| 1878 | return kOsMac; |
| 1879 | #elif defined(OS_WIN) |
| 1880 | return kOsWin; |
| 1881 | #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check. |
| 1882 | return kOsCrOS; |
| 1883 | #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
| 1884 | return kOsLinux; |
| 1885 | #elif defined(OS_ANDROID) |
| 1886 | return kOsAndroid; |
| 1887 | #else |
| 1888 | #error Unknown platform |
| 1889 | #endif |
| 1890 | } |
| 1891 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1892 | void RecordUMAStatistics(FlagsStorage* flags_storage) { |
| 1893 | std::set<std::string> flags = flags_storage->GetFlags(); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1894 | for (std::set<std::string>::iterator it = flags.begin(); it != flags.end(); |
| 1895 | ++it) { |
| 1896 | std::string action("AboutFlags_"); |
| 1897 | action += *it; |
| 1898 | content::RecordComputedAction(action); |
| 1899 | } |
| 1900 | // Since flag metrics are recorded every startup, add a tick so that the |
| 1901 | // stats can be made meaningful. |
| 1902 | if (flags.size()) |
| 1903 | content::RecordAction(UserMetricsAction("AboutFlags_StartupTick")); |
| 1904 | content::RecordAction(UserMetricsAction("StartupTick")); |
| 1905 | } |
| 1906 | |
| 1907 | ////////////////////////////////////////////////////////////////////////////// |
| 1908 | // FlagsState implementation. |
| 1909 | |
| 1910 | namespace { |
| 1911 | |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1912 | typedef std::map<std::string, std::pair<std::string, std::string> > |
| 1913 | NameToSwitchAndValueMap; |
| 1914 | |
| 1915 | void SetFlagToSwitchMapping(const std::string& key, |
| 1916 | const std::string& switch_name, |
| 1917 | const std::string& switch_value, |
| 1918 | NameToSwitchAndValueMap* name_to_switch_map) { |
| 1919 | DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key)); |
| 1920 | (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value); |
| 1921 | } |
| 1922 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1923 | void FlagsState::ConvertFlagsToSwitches( |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1924 | FlagsStorage* flags_storage, CommandLine* command_line) { |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1925 | if (command_line->HasSwitch(switches::kNoExperiments)) |
| 1926 | return; |
| 1927 | |
| 1928 | std::set<std::string> enabled_experiments; |
| 1929 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1930 | GetSanitizedEnabledFlagsForCurrentPlatform(flags_storage, |
| 1931 | &enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1932 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1933 | NameToSwitchAndValueMap name_to_switch_map; |
| 1934 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1935 | const Experiment& e = experiments[i]; |
| 1936 | if (e.type == Experiment::SINGLE_VALUE) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1937 | SetFlagToSwitchMapping(e.internal_name, e.command_line_switch, |
| 1938 | e.command_line_value, &name_to_switch_map); |
| 1939 | } else if (e.type == Experiment::MULTI_VALUE) { |
| 1940 | for (int j = 0; j < e.num_choices; ++j) { |
| 1941 | SetFlagToSwitchMapping(e.NameForChoice(j), |
| 1942 | e.choices[j].command_line_switch, |
| 1943 | e.choices[j].command_line_value, |
| 1944 | &name_to_switch_map); |
| 1945 | } |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1946 | } else { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1947 | DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE); |
| 1948 | SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(), |
| 1949 | &name_to_switch_map); |
| 1950 | SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch, |
| 1951 | e.command_line_value, &name_to_switch_map); |
| 1952 | SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch, |
| 1953 | e.disable_command_line_value, &name_to_switch_map); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1954 | } |
| 1955 | } |
| 1956 | |
| 1957 | command_line->AppendSwitch(switches::kFlagSwitchesBegin); |
| 1958 | flags_switches_.insert( |
| 1959 | std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, |
| 1960 | std::string())); |
| 1961 | for (std::set<std::string>::iterator it = enabled_experiments.begin(); |
| 1962 | it != enabled_experiments.end(); |
| 1963 | ++it) { |
| 1964 | const std::string& experiment_name = *it; |
| 1965 | NameToSwitchAndValueMap::const_iterator name_to_switch_it = |
| 1966 | name_to_switch_map.find(experiment_name); |
| 1967 | if (name_to_switch_it == name_to_switch_map.end()) { |
| 1968 | NOTREACHED(); |
| 1969 | continue; |
| 1970 | } |
| 1971 | |
| 1972 | const std::pair<std::string, std::string>& |
| 1973 | switch_and_value_pair = name_to_switch_it->second; |
| 1974 | |
| 1975 | command_line->AppendSwitchASCII(switch_and_value_pair.first, |
| 1976 | switch_and_value_pair.second); |
| 1977 | flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
| 1978 | } |
| 1979 | command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
| 1980 | flags_switches_.insert( |
| 1981 | std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
| 1982 | std::string())); |
| 1983 | } |
| 1984 | |
| 1985 | bool FlagsState::IsRestartNeededToCommitChanges() { |
| 1986 | return needs_restart_; |
| 1987 | } |
| 1988 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1989 | void FlagsState::SetExperimentEnabled(FlagsStorage* flags_storage, |
| 1990 | const std::string& internal_name, |
| 1991 | bool enable) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 1992 | size_t at_index = internal_name.find(testing::kMultiSeparator); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1993 | if (at_index != std::string::npos) { |
| 1994 | DCHECK(enable); |
| 1995 | // We're being asked to enable a multi-choice experiment. Disable the |
| 1996 | // currently selected choice. |
| 1997 | DCHECK_NE(at_index, 0u); |
| 1998 | const std::string experiment_name = internal_name.substr(0, at_index); |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 1999 | SetExperimentEnabled(flags_storage, experiment_name, false); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2000 | |
| 2001 | // And enable the new choice, if it is not the default first choice. |
| 2002 | if (internal_name != experiment_name + "@0") { |
| 2003 | std::set<std::string> enabled_experiments; |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2004 | GetSanitizedEnabledFlags(flags_storage, &enabled_experiments); |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2005 | needs_restart_ |= enabled_experiments.insert(internal_name).second; |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2006 | flags_storage->SetFlags(enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2007 | } |
| 2008 | return; |
| 2009 | } |
| 2010 | |
| 2011 | std::set<std::string> enabled_experiments; |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2012 | GetSanitizedEnabledFlags(flags_storage, &enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2013 | |
| 2014 | const Experiment* e = NULL; |
| 2015 | for (size_t i = 0; i < num_experiments; ++i) { |
| 2016 | if (experiments[i].internal_name == internal_name) { |
| 2017 | e = experiments + i; |
| 2018 | break; |
| 2019 | } |
| 2020 | } |
| 2021 | DCHECK(e); |
| 2022 | |
| 2023 | if (e->type == Experiment::SINGLE_VALUE) { |
| 2024 | if (enable) |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2025 | needs_restart_ |= enabled_experiments.insert(internal_name).second; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2026 | else |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2027 | needs_restart_ |= (enabled_experiments.erase(internal_name) > 0); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2028 | } else { |
| 2029 | if (enable) { |
| 2030 | // Enable the first choice. |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2031 | needs_restart_ |= enabled_experiments.insert(e->NameForChoice(0)).second; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2032 | } else { |
| 2033 | // Find the currently enabled choice and disable it. |
| 2034 | for (int i = 0; i < e->num_choices; ++i) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2035 | std::string choice_name = e->NameForChoice(i); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2036 | if (enabled_experiments.find(choice_name) != |
| 2037 | enabled_experiments.end()) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2038 | needs_restart_ = true; |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2039 | enabled_experiments.erase(choice_name); |
| 2040 | // Continue on just in case there's a bug and more than one |
| 2041 | // experiment for this choice was enabled. |
| 2042 | } |
| 2043 | } |
| 2044 | } |
| 2045 | } |
| 2046 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2047 | flags_storage->SetFlags(enabled_experiments); |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2048 | } |
| 2049 | |
| 2050 | void FlagsState::RemoveFlagsSwitches( |
| 2051 | std::map<std::string, CommandLine::StringType>* switch_list) { |
| 2052 | for (std::map<std::string, std::string>::const_iterator |
| 2053 | it = flags_switches_.begin(); it != flags_switches_.end(); ++it) { |
| 2054 | switch_list->erase(it->first); |
| 2055 | } |
| 2056 | } |
| 2057 | |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2058 | void FlagsState::ResetAllFlags(FlagsStorage* flags_storage) { |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2059 | needs_restart_ = true; |
| 2060 | |
| 2061 | std::set<std::string> no_experiments; |
Torne (Richard Coles) | 7d4cd47 | 2013-06-19 11:58:07 +0100 | [diff] [blame] | 2062 | flags_storage->SetFlags(no_experiments); |
Torne (Richard Coles) | 2a99a7e | 2013-03-28 15:31:22 +0000 | [diff] [blame] | 2063 | } |
| 2064 | |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 2065 | void FlagsState::reset() { |
| 2066 | needs_restart_ = false; |
| 2067 | flags_switches_.clear(); |
| 2068 | } |
| 2069 | |
| 2070 | } // namespace |
| 2071 | |
| 2072 | namespace testing { |
| 2073 | |
| 2074 | // WARNING: '@' is also used in the html file. If you update this constant you |
| 2075 | // also need to update the html file. |
| 2076 | const char kMultiSeparator[] = "@"; |
| 2077 | |
| 2078 | void ClearState() { |
| 2079 | FlagsState::GetInstance()->reset(); |
| 2080 | } |
| 2081 | |
| 2082 | void SetExperiments(const Experiment* e, size_t count) { |
| 2083 | if (!e) { |
| 2084 | experiments = kExperiments; |
| 2085 | num_experiments = arraysize(kExperiments); |
| 2086 | } else { |
| 2087 | experiments = e; |
| 2088 | num_experiments = count; |
| 2089 | } |
| 2090 | } |
| 2091 | |
| 2092 | const Experiment* GetExperiments(size_t* count) { |
| 2093 | *count = num_experiments; |
| 2094 | return experiments; |
| 2095 | } |
| 2096 | |
| 2097 | } // namespace testing |
| 2098 | |
| 2099 | } // namespace about_flags |