[email protected] | 9c66adc | 2012-01-05 02:10:16 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 5 | #include "chrome/browser/about_flags.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 6 | |
| 7 | #include <algorithm> |
| 8 | #include <iterator> |
| 9 | #include <map> |
| 10 | #include <set> |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 11 | #include <utility> |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 12 | |
[email protected] | 7d1d209 | 2013-03-04 04:12:43 | [diff] [blame] | 13 | #include "apps/switches.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 14 | #include "base/command_line.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 15 | #include "base/memory/singleton.h" |
[email protected] | 3853a4c | 2013-02-11 17:15:57 | [diff] [blame] | 16 | #include "base/prefs/pref_service.h" |
[email protected] | 3ea1b18 | 2013-02-08 22:38:41 | [diff] [blame] | 17 | #include "base/strings/string_number_conversions.h" |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 18 | #include "base/utf_string_conversions.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 19 | #include "base/values.h" |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 20 | #include "cc/switches.h" |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 21 | #include "chrome/browser/prefs/scoped_user_pref_update.h" |
[email protected] | d208f4d8 | 2011-05-23 21:52:03 | [diff] [blame] | 22 | #include "chrome/common/chrome_content_client.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 23 | #include "chrome/common/chrome_switches.h" |
| 24 | #include "chrome/common/pref_names.h" |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 25 | #include "content/public/browser/user_metrics.h" |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 26 | #include "grit/chromium_strings.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 27 | #include "grit/generated_resources.h" |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 28 | #include "grit/google_chrome_strings.h" |
[email protected] | e2e8e32 | 2012-09-12 04:37:02 | [diff] [blame] | 29 | #include "media/base/media_switches.h" |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 30 | #include "ui/app_list/app_list_switches.h" |
[email protected] | c051a1b | 2011-01-21 23:30:17 | [diff] [blame] | 31 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 32 | #include "ui/base/ui_base_switches.h" |
[email protected] | 0d3b9dd | 2012-11-14 04:14:48 | [diff] [blame] | 33 | #include "ui/gfx/switches.h" |
[email protected] | c9e2cbbb | 2012-05-12 21:17:27 | [diff] [blame] | 34 | #include "ui/gl/gl_switches.h" |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 35 | #include "ui/surface/surface_switches.h" |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 36 | |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 37 | #if defined(ENABLE_MESSAGE_CENTER) |
| 38 | #include "ui/message_center/message_center_switches.h" |
| 39 | #endif |
| 40 | |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 41 | #if defined(USE_ASH) |
[email protected] | b65bdda | 2011-12-23 23:35:31 | [diff] [blame] | 42 | #include "ash/ash_switches.h" |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 43 | #endif |
| 44 | |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 45 | #if defined(OS_CHROMEOS) |
| 46 | #include "chromeos/chromeos_switches.h" |
| 47 | #endif |
| 48 | |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 49 | using content::UserMetricsAction; |
| 50 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 51 | namespace about_flags { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 52 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 53 | // Macros to simplify specifying the type. |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 54 | #define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \ |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 55 | Experiment::SINGLE_VALUE, \ |
| 56 | command_line_switch, switch_value, NULL, NULL, NULL, 0 |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 57 | #define SINGLE_VALUE_TYPE(command_line_switch) \ |
| 58 | SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "") |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 59 | #define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \ |
| 60 | disable_switch, disable_value) \ |
| 61 | Experiment::ENABLE_DISABLE_VALUE, enable_switch, enable_value, \ |
| 62 | disable_switch, disable_value, NULL, 3 |
| 63 | #define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \ |
| 64 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "") |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 65 | #define MULTI_VALUE_TYPE(choices) \ |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 66 | Experiment::MULTI_VALUE, NULL, NULL, NULL, NULL, choices, arraysize(choices) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 67 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 68 | namespace { |
| 69 | |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 70 | const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid; |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 71 | const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 72 | |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 73 | // Adds a |StringValue| to |list| for each platform where |bitmask| indicates |
| 74 | // whether the experiment is available on that platform. |
| 75 | void AddOsStrings(unsigned bitmask, ListValue* list) { |
| 76 | struct { |
| 77 | unsigned bit; |
| 78 | const char* const name; |
| 79 | } kBitsToOs[] = { |
| 80 | {kOsMac, "Mac"}, |
| 81 | {kOsWin, "Windows"}, |
| 82 | {kOsLinux, "Linux"}, |
| 83 | {kOsCrOS, "Chrome OS"}, |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 84 | {kOsAndroid, "Android"}, |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 85 | }; |
| 86 | for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kBitsToOs); ++i) |
| 87 | if (bitmask & kBitsToOs[i].bit) |
| 88 | list->Append(new StringValue(kBitsToOs[i].name)); |
| 89 | } |
| 90 | |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 91 | const Experiment::Choice kOmniboxHistoryQuickProviderNewScoringChoices[] = { |
| 92 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_AUTOMATIC, "", "" }, |
| 93 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_ENABLED, |
| 94 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 95 | switches::kOmniboxHistoryQuickProviderNewScoringEnabled }, |
| 96 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DISABLED, |
| 97 | switches::kOmniboxHistoryQuickProviderNewScoring, |
| 98 | switches::kOmniboxHistoryQuickProviderNewScoringDisabled } |
| 99 | }; |
| 100 | |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 101 | const Experiment::Choice |
| 102 | kOmniboxHistoryQuickProviderReorderForInliningChoices[] = { |
| 103 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_AUTOMATIC, |
| 104 | "", |
| 105 | "" }, |
| 106 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_ENABLED, |
| 107 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 108 | switches::kOmniboxHistoryQuickProviderReorderForInliningEnabled }, |
| 109 | { IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DISABLED, |
| 110 | switches::kOmniboxHistoryQuickProviderReorderForInlining, |
| 111 | switches::kOmniboxHistoryQuickProviderReorderForInliningDisabled } |
| 112 | }; |
| 113 | |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 114 | const Experiment::Choice kOmniboxInlineHistoryQuickProviderChoices[] = { |
| 115 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_AUTOMATIC, "", "" }, |
| 116 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_ALLOWED, |
| 117 | switches::kOmniboxInlineHistoryQuickProvider, |
| 118 | switches::kOmniboxInlineHistoryQuickProviderAllowed }, |
| 119 | { IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_PROHIBITED, |
| 120 | switches::kOmniboxInlineHistoryQuickProvider, |
| 121 | switches::kOmniboxInlineHistoryQuickProviderProhibited } |
| 122 | }; |
| 123 | |
[email protected] | fb85419 | 2013-02-06 01:30:04 | [diff] [blame] | 124 | const Experiment::Choice kEnableCompositingForFixedPositionChoices[] = { |
| 125 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 126 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 127 | switches::kEnableCompositingForFixedPosition, ""}, |
| 128 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 129 | switches::kDisableCompositingForFixedPosition, ""}, |
| 130 | { IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_HIGH_DPI, |
| 131 | switches::kEnableHighDpiCompositingForFixedPosition, ""} |
| 132 | }; |
| 133 | |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 134 | const Experiment::Choice kGDIPresentChoices[] = { |
| 135 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 136 | { IDS_FLAGS_PRESENT_WITH_GDI_FIRST_SHOW, |
| 137 | switches::kDoFirstShowPresentWithGDI, ""}, |
| 138 | { IDS_FLAGS_PRESENT_WITH_GDI_ALL_SHOW, |
| 139 | switches::kDoAllShowPresentWithGDI, ""} |
| 140 | }; |
| 141 | |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 142 | const Experiment::Choice kTouchEventsChoices[] = { |
| 143 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
| 144 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 145 | switches::kTouchEvents, |
| 146 | switches::kTouchEventsEnabled }, |
| 147 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 148 | switches::kTouchEvents, |
| 149 | switches::kTouchEventsDisabled } |
| 150 | }; |
| 151 | |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 152 | const Experiment::Choice kTouchOptimizedUIChoices[] = { |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 153 | { IDS_GENERIC_EXPERIMENT_CHOICE_AUTOMATIC, "", "" }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 154 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 155 | switches::kTouchOptimizedUI, |
| 156 | switches::kTouchOptimizedUIEnabled }, |
[email protected] | a45c6940 | 2012-06-24 16:32:20 | [diff] [blame] | 157 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 158 | switches::kTouchOptimizedUI, |
| 159 | switches::kTouchOptimizedUIDisabled } |
| 160 | }; |
| 161 | |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 162 | const Experiment::Choice kNaClDebugMaskChoices[] = { |
| 163 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 164 | // Secure shell can be used on ChromeOS for forwarding the TCP port opened by |
| 165 | // debug stub to a remote machine. Since secure shell uses NaCl, we provide |
| 166 | // an option to switch off its debugging. |
| 167 | { IDS_NACL_DEBUG_MASK_CHOICE_EXCLUDE_UTILS, |
| 168 | switches::kNaClDebugMask, "!*://*/*ssh_client.nmf" }, |
| 169 | { IDS_NACL_DEBUG_MASK_CHOICE_INCLUDE_DEBUG, |
| 170 | switches::kNaClDebugMask, "*://*/*debug.nmf" } |
| 171 | }; |
| 172 | |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 173 | #if defined(OS_CHROMEOS) |
| 174 | const Experiment::Choice kAshBootAnimationFunction[] = { |
| 175 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 176 | { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION2, |
| 177 | ash::switches::kAshBootAnimationFunction2, ""}, |
| 178 | { IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION3, |
| 179 | ash::switches::kAshBootAnimationFunction3, ""} |
| 180 | }; |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 181 | |
| 182 | const Experiment::Choice kChromeCaptivePortalDetectionChoices[] = { |
[email protected] | ad2fe9f | 2012-11-15 11:03:19 | [diff] [blame] | 183 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""}, |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 184 | { IDS_FLAGS_CHROME_CAPTIVE_PORTAL_DETECTOR, |
[email protected] | ad2fe9f | 2012-11-15 11:03:19 | [diff] [blame] | 185 | switches::kEnableChromeCaptivePortalDetector, ""}, |
| 186 | { IDS_FLAGS_SHILL_CAPTIVE_PORTAL_DETECTOR, |
| 187 | switches::kDisableChromeCaptivePortalDetector, ""} |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 188 | }; |
[email protected] | a78c743 | 2013-03-13 06:22:43 | [diff] [blame] | 189 | |
| 190 | const Experiment::Choice kAshInternalDisplayUIScaleChoices[] = { |
| 191 | { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_DEFAULT, "", "" }, |
| 192 | { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_80, |
| 193 | ash::switches::kAshInternalDisplayUIScale, "0.8"}, |
| 194 | { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_125, |
| 195 | ash::switches::kAshInternalDisplayUIScale, "1.25"}, |
| 196 | { IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_150, |
| 197 | ash::switches::kAshInternalDisplayUIScale, "1.5"}, |
| 198 | }; |
| 199 | |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 200 | #endif |
| 201 | |
[email protected] | 9323fdd1 | 2013-02-23 00:31:36 | [diff] [blame] | 202 | const Experiment::Choice kImplSidePaintingChoices[] = { |
| 203 | { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 204 | { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 205 | cc::switches::kEnableImplSidePainting, ""}, |
| 206 | { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 207 | cc::switches::kDisableImplSidePainting, ""} |
| 208 | }; |
| 209 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 210 | // RECORDING USER METRICS FOR FLAGS: |
| 211 | // ----------------------------------------------------------------------------- |
| 212 | // The first line of the experiment is the internal name. If you'd like to |
| 213 | // gather statistics about the usage of your flag, you should append a marker |
| 214 | // comment to the end of the feature name, like so: |
| 215 | // "my-special-feature", // FLAGS:RECORD_UMA |
| 216 | // |
| 217 | // After doing that, run //chrome/tools/extract_actions.py (see instructions at |
| 218 | // the top of that file for details) to update the chromeactions.txt file, which |
| 219 | // will enable UMA to record your feature flag. |
| 220 | // |
[email protected] | 783d5bb | 2012-10-24 03:47:14 | [diff] [blame] | 221 | // After your feature has shipped under a flag, you can locate the metrics under |
| 222 | // the action name AboutFlags_internal-action-name. Actions are recorded once |
| 223 | // per startup, so you should divide this number by AboutFlags_StartupTick to |
| 224 | // get a sense of usage. Note that this will not be the same as number of users |
| 225 | // with a given feature enabled because users can quit and relaunch the |
| 226 | // application multiple times over a given time interval. The dashboard also |
| 227 | // shows you how many (metrics reporting) users have enabled the flag over the |
| 228 | // last seven days. However, note that this is not the same as the number of |
| 229 | // users who have the flag enabled, since enabling the flag happens once, |
| 230 | // whereas running with the flag enabled happens until the user flips the flag |
| 231 | // again. |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 232 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 233 | // To add a new experiment add to the end of kExperiments. There are two |
| 234 | // distinct types of experiments: |
| 235 | // . SINGLE_VALUE: experiment is either on or off. Use the SINGLE_VALUE_TYPE |
| 236 | // macro for this type supplying the command line to the macro. |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 237 | // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
| 238 | // deactivated state for this lab (i.e. no command line option). To specify |
| 239 | // this type of experiment use the macro MULTI_VALUE_TYPE supplying it the |
| 240 | // array of choices. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 241 | // See the documentation of Experiment for details on the fields. |
| 242 | // |
| 243 | // When adding a new choice, add it to the end of the list. |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 244 | const Experiment kExperiments[] = { |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 245 | #if defined(OS_ANDROID) |
| 246 | { |
[email protected] | 199def2 | 2013-02-21 17:52:29 | [diff] [blame] | 247 | "enable-spdy-proxy-auth", |
| 248 | IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_NAME, |
| 249 | IDS_FLAGS_ENABLE_SPDY_PROXY_AUTH_DESCRIPTION, |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 250 | kOsAndroid, |
[email protected] | 199def2 | 2013-02-21 17:52:29 | [diff] [blame] | 251 | SINGLE_VALUE_TYPE(switches::kEnableSpdyProxyAuth) |
[email protected] | 270f034 | 2013-02-20 01:19:44 | [diff] [blame] | 252 | }, |
| 253 | #endif |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 254 | { |
[email protected] | aac169d | 2011-03-18 19:53:03 | [diff] [blame] | 255 | "expose-for-tabs", // FLAGS:RECORD_UMA |
| 256 | IDS_FLAGS_TABPOSE_NAME, |
| 257 | IDS_FLAGS_TABPOSE_DESCRIPTION, |
| 258 | kOsMac, |
| 259 | #if defined(OS_MACOSX) |
| 260 | // The switch exists only on OS X. |
| 261 | SINGLE_VALUE_TYPE(switches::kEnableExposeForTabs) |
| 262 | #else |
| 263 | SINGLE_VALUE_TYPE("") |
| 264 | #endif |
| 265 | }, |
| 266 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 267 | "conflicting-modules-check", // FLAGS:RECORD_UMA |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 268 | IDS_FLAGS_CONFLICTS_CHECK_NAME, |
| 269 | IDS_FLAGS_CONFLICTS_CHECK_DESCRIPTION, |
| 270 | kOsWin, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 271 | SINGLE_VALUE_TYPE(switches::kConflictingModulesCheck) |
[email protected] | c1bbaa8 | 2010-11-08 11:17:05 | [diff] [blame] | 272 | }, |
| 273 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 274 | "cloud-print-proxy", // FLAGS:RECORD_UMA |
[email protected] | dae7325b | 2011-12-21 20:56:54 | [diff] [blame] | 275 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_NAME, |
| 276 | IDS_FLAGS_CLOUD_PRINT_CONNECTOR_DESCRIPTION, |
[email protected] | 9f8872b3 | 2011-03-04 19:44:45 | [diff] [blame] | 277 | // For a Chrome build, we know we have a PDF plug-in on Windows, so it's |
[email protected] | 4fa24bf | 2011-08-20 02:15:22 | [diff] [blame] | 278 | // fully enabled. |
[email protected] | 5d10d57d | 2011-07-22 22:16:31 | [diff] [blame] | 279 | // Otherwise, where we know Windows could be working if a viable PDF |
[email protected] | 4fa24bf | 2011-08-20 02:15:22 | [diff] [blame] | 280 | // plug-in could be supplied, we'll keep the lab enabled. Mac and Linux |
| 281 | // always have PDF rasterization available, so no flag needed there. |
| 282 | #if !defined(GOOGLE_CHROME_BUILD) |
| 283 | kOsWin, |
| 284 | #else |
| 285 | 0, |
[email protected] | fa6d2a2f | 2010-11-30 21:47:19 | [diff] [blame] | 286 | #endif |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 287 | SINGLE_VALUE_TYPE(switches::kEnableCloudPrintProxy) |
[email protected] | 8b6588a | 2010-10-12 02:39:42 | [diff] [blame] | 288 | }, |
[email protected] | 60d77bd | 2012-08-22 00:10:07 | [diff] [blame] | 289 | #if defined(OS_WIN) |
| 290 | { |
| 291 | "print-raster", |
| 292 | IDS_FLAGS_PRINT_RASTER_NAME, |
| 293 | IDS_FLAGS_PRINT_RASTER_DESCRIPTION, |
| 294 | kOsWin, |
| 295 | SINGLE_VALUE_TYPE(switches::kPrintRaster) |
| 296 | }, |
| 297 | #endif // OS_WIN |
[email protected] | 0209b44 | 2012-07-18 00:38:05 | [diff] [blame] | 298 | { |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 299 | "crxless-web-apps", |
| 300 | IDS_FLAGS_CRXLESS_WEB_APPS_NAME, |
| 301 | IDS_FLAGS_CRXLESS_WEB_APPS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 302 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 303 | SINGLE_VALUE_TYPE(switches::kEnableCrxlessWebApps) |
[email protected] | bb46153 | 2010-11-26 21:50:23 | [diff] [blame] | 304 | }, |
| 305 | { |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 306 | "ignore-gpu-blacklist", |
| 307 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_NAME, |
| 308 | IDS_FLAGS_IGNORE_GPU_BLACKLIST_DESCRIPTION, |
| 309 | kOsAll, |
| 310 | SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist) |
| 311 | }, |
| 312 | { |
[email protected] | 0110cf11 | 2011-07-02 00:39:43 | [diff] [blame] | 313 | "force-compositing-mode-2", |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 314 | IDS_FLAGS_FORCE_COMPOSITING_MODE_NAME, |
| 315 | IDS_FLAGS_FORCE_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | 9b19cf8 | 2012-06-13 06:23:23 | [diff] [blame] | 316 | kOsMac | kOsWin | kOsLinux, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 317 | ENABLE_DISABLE_VALUE_TYPE(switches::kForceCompositingMode, |
| 318 | switches::kDisableForceCompositingMode) |
[email protected] | 96c6f4c | 2011-05-18 19:36:22 | [diff] [blame] | 319 | }, |
| 320 | { |
[email protected] | 72787e39 | 2012-03-23 05:55:43 | [diff] [blame] | 321 | "threaded-compositing-mode", |
| 322 | IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME, |
| 323 | IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 324 | kOsDesktop & ~kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 325 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing, |
| 326 | switches::kDisableThreadedCompositing) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 327 | }, |
| 328 | { |
[email protected] | 17e2769 | 2013-02-06 17:02:09 | [diff] [blame] | 329 | "force-accelerated-composited-scrolling", |
| 330 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME, |
| 331 | IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION, |
| 332 | kOsAll, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 333 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedOverflowScroll, |
| 334 | switches::kDisableAcceleratedOverflowScroll) |
[email protected] | 17e2769 | 2013-02-06 17:02:09 | [diff] [blame] | 335 | }, |
| 336 | { |
[email protected] | 8b1c3c7 | 2013-01-25 01:48:43 | [diff] [blame] | 337 | "present-with-GDI", |
| 338 | IDS_FLAGS_PRESENT_WITH_GDI_NAME, |
| 339 | IDS_FLAGS_PRESENT_WITH_GDI_DESCRIPTION, |
| 340 | kOsWin, |
| 341 | MULTI_VALUE_TYPE(kGDIPresentChoices) |
| 342 | }, |
| 343 | { |
[email protected] | 81c64af6 | 2012-06-06 20:15:52 | [diff] [blame] | 344 | "disable-accelerated-2d-canvas", |
| 345 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_NAME, |
| 346 | IDS_FLAGS_DISABLE_ACCELERATED_2D_CANVAS_DESCRIPTION, |
| 347 | kOsAll, |
| 348 | SINGLE_VALUE_TYPE(switches::kDisableAccelerated2dCanvas) |
| 349 | }, |
| 350 | { |
[email protected] | 69cffc8 | 2012-08-10 13:27:27 | [diff] [blame] | 351 | "disable-deferred-2d-canvas", |
| 352 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_NAME, |
| 353 | IDS_FLAGS_DISABLE_DEFERRED_2D_CANVAS_DESCRIPTION, |
| 354 | kOsAll, |
| 355 | SINGLE_VALUE_TYPE(switches::kDisableDeferred2dCanvas) |
| 356 | }, |
| 357 | { |
[email protected] | efcde13 | 2012-05-30 01:05:18 | [diff] [blame] | 358 | "disable-threaded-animation", |
| 359 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME, |
| 360 | IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION, |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 361 | kOsAll, |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 362 | SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation) |
[email protected] | 644a107 | 2012-03-16 09:29:59 | [diff] [blame] | 363 | }, |
| 364 | { |
[email protected] | 5963b77 | 2011-02-09 22:55:38 | [diff] [blame] | 365 | "composited-layer-borders", |
| 366 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS, |
| 367 | IDS_FLAGS_COMPOSITED_LAYER_BORDERS_DESCRIPTION, |
| 368 | kOsAll, |
| 369 | SINGLE_VALUE_TYPE(switches::kShowCompositedLayerBorders) |
| 370 | }, |
| 371 | { |
[email protected] | a8f1eaa | 2011-03-07 19:00:58 | [diff] [blame] | 372 | "show-fps-counter", |
| 373 | IDS_FLAGS_SHOW_FPS_COUNTER, |
| 374 | IDS_FLAGS_SHOW_FPS_COUNTER_DESCRIPTION, |
| 375 | kOsAll, |
| 376 | SINGLE_VALUE_TYPE(switches::kShowFPSCounter) |
| 377 | }, |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 378 | { |
[email protected] | 70c98a33 | 2011-12-21 20:51:52 | [diff] [blame] | 379 | "accelerated-filters", |
| 380 | IDS_FLAGS_ACCELERATED_FILTERS, |
| 381 | IDS_FLAGS_ACCELERATED_FILTERS_DESCRIPTION, |
| 382 | kOsAll, |
| 383 | SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters) |
| 384 | }, |
| 385 | { |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 386 | "disable-gpu-vsync", |
| 387 | IDS_FLAGS_DISABLE_GPU_VSYNC_NAME, |
| 388 | IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 389 | kOsDesktop, |
[email protected] | 8ff7f34 | 2011-05-25 01:49:47 | [diff] [blame] | 390 | SINGLE_VALUE_TYPE(switches::kDisableGpuVsync) |
| 391 | }, |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 392 | { |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 393 | "enable-webgl", |
| 394 | IDS_FLAGS_ENABLE_WEBGL_NAME, |
| 395 | IDS_FLAGS_ENABLE_WEBGL_DESCRIPTION, |
| 396 | kOsAndroid, |
| 397 | #if defined(OS_ANDROID) |
| 398 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebGL) |
| 399 | #else |
| 400 | SINGLE_VALUE_TYPE("") |
| 401 | #endif |
| 402 | }, |
| 403 | { |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 404 | "disable-webgl", |
| 405 | IDS_FLAGS_DISABLE_WEBGL_NAME, |
| 406 | IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 407 | kOsDesktop, |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 408 | #if defined(OS_ANDROID) |
| 409 | SINGLE_VALUE_TYPE("") |
| 410 | #else |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 411 | SINGLE_VALUE_TYPE(switches::kDisableExperimentalWebGL) |
[email protected] | 4052d83 | 2013-01-16 05:31:01 | [diff] [blame] | 412 | #endif |
[email protected] | deaba6d5 | 2011-09-23 14:47:12 | [diff] [blame] | 413 | }, |
[email protected] | 09096e0 | 2012-05-24 11:12:04 | [diff] [blame] | 414 | { |
[email protected] | d9da958 | 2013-01-31 04:59:05 | [diff] [blame] | 415 | "enable-webrtc", |
| 416 | IDS_FLAGS_ENABLE_WEBRTC_NAME, |
| 417 | IDS_FLAGS_ENABLE_WEBRTC_DESCRIPTION, |
| 418 | kOsAndroid, |
| 419 | #if defined(OS_ANDROID) |
| 420 | SINGLE_VALUE_TYPE(switches::kEnableWebRTC) |
| 421 | #else |
| 422 | SINGLE_VALUE_TYPE("") |
| 423 | #endif |
| 424 | }, |
| 425 | { |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 426 | "fixed-position-creates-stacking-context", |
| 427 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_NAME, |
| 428 | IDS_FLAGS_FIXED_POSITION_CREATES_STACKING_CONTEXT_DESCRIPTION, |
| 429 | kOsAll, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 430 | ENABLE_DISABLE_VALUE_TYPE( |
| 431 | switches::kEnableFixedPositionCreatesStackingContext, |
| 432 | switches::kDisableFixedPositionCreatesStackingContext) |
[email protected] | 96bcdc10 | 2012-05-24 23:42:10 | [diff] [blame] | 433 | }, |
[email protected] | fb85419 | 2013-02-06 01:30:04 | [diff] [blame] | 434 | { |
| 435 | "enable-compositing-for-fixed-position", |
| 436 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_NAME, |
| 437 | IDS_FLAGS_COMPOSITING_FOR_FIXED_POSITION_DESCRIPTION, |
| 438 | kOsAll, |
| 439 | MULTI_VALUE_TYPE(kEnableCompositingForFixedPositionChoices) |
| 440 | }, |
[email protected] | a7640ef2 | 2012-10-06 00:52:08 | [diff] [blame] | 441 | // TODO(bbudge): When NaCl is on by default, remove this flag entry. |
[email protected] | 2fe15fcb | 2010-10-21 20:39:53 | [diff] [blame] | 442 | { |
[email protected] | e3791ce9 | 2011-08-09 01:03:32 | [diff] [blame] | 443 | "enable-nacl", // FLAGS:RECORD_UMA |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 444 | IDS_FLAGS_ENABLE_NACL_NAME, |
| 445 | IDS_FLAGS_ENABLE_NACL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 446 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 447 | SINGLE_VALUE_TYPE(switches::kEnableNaCl) |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 448 | }, |
[email protected] | b39c6d9 | 2012-01-31 16:38:41 | [diff] [blame] | 449 | // TODO(halyavin): When exception handling is on by default, replace this |
| 450 | // flag with disable-nacl-exception-handling. |
| 451 | { |
| 452 | "enable-nacl-exception-handling", // FLAGS:RECORD_UMA |
| 453 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_NAME, |
| 454 | IDS_FLAGS_ENABLE_NACL_EXCEPTION_HANDLING_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 455 | kOsDesktop, |
[email protected] | b39c6d9 | 2012-01-31 16:38:41 | [diff] [blame] | 456 | SINGLE_VALUE_TYPE(switches::kEnableNaClExceptionHandling) |
| 457 | }, |
[email protected] | 4ff87d20 | 2010-11-06 01:28:40 | [diff] [blame] | 458 | { |
[email protected] | 9addd1c | 2012-09-15 14:28:24 | [diff] [blame] | 459 | "enable-nacl-debug", // FLAGS:RECORD_UMA |
| 460 | IDS_FLAGS_ENABLE_NACL_DEBUG_NAME, |
| 461 | IDS_FLAGS_ENABLE_NACL_DEBUG_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 462 | kOsDesktop, |
[email protected] | 9addd1c | 2012-09-15 14:28:24 | [diff] [blame] | 463 | SINGLE_VALUE_TYPE(switches::kEnableNaClDebug) |
[email protected] | 401b9079 | 2012-05-30 11:41:13 | [diff] [blame] | 464 | }, |
| 465 | { |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 466 | "nacl-debug-mask", // FLAGS:RECORD_UMA |
| 467 | IDS_FLAGS_NACL_DEBUG_MASK_NAME, |
| 468 | IDS_FLAGS_NACL_DEBUG_MASK_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 469 | kOsDesktop, |
[email protected] | 66f409c | 2012-10-04 20:59:04 | [diff] [blame] | 470 | MULTI_VALUE_TYPE(kNaClDebugMaskChoices) |
| 471 | }, |
| 472 | { |
[email protected] | 7babd1c | 2012-08-08 20:35:29 | [diff] [blame] | 473 | "enable-pnacl", // FLAGS:RECORD_UMA |
| 474 | IDS_FLAGS_ENABLE_PNACL_NAME, |
| 475 | IDS_FLAGS_ENABLE_PNACL_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 476 | kOsDesktop, |
[email protected] | 7babd1c | 2012-08-08 20:35:29 | [diff] [blame] | 477 | SINGLE_VALUE_TYPE(switches::kEnablePnacl) |
| 478 | }, |
| 479 | { |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 480 | "extension-apis", // FLAGS:RECORD_UMA |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 481 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_NAME, |
| 482 | IDS_FLAGS_EXPERIMENTAL_EXTENSION_APIS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 483 | kOsDesktop, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 484 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalExtensionApis) |
[email protected] | 11dd68cd5 | 2010-11-12 01:15:32 | [diff] [blame] | 485 | }, |
[email protected] | 3627b06d | 2010-11-12 16:36:16 | [diff] [blame] | 486 | { |
[email protected] | 544471a | 2012-10-13 05:27:09 | [diff] [blame] | 487 | "action-box", |
[email protected] | cab18ef | 2012-04-27 07:22:03 | [diff] [blame] | 488 | IDS_FLAGS_ACTION_BOX_NAME, |
| 489 | IDS_FLAGS_ACTION_BOX_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 490 | kOsDesktop, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 491 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kActionBox, "1", |
| 492 | switches::kActionBox, "0") |
[email protected] | cab18ef | 2012-04-27 07:22:03 | [diff] [blame] | 493 | }, |
| 494 | { |
[email protected] | 3a36243 | 2012-06-18 20:39:51 | [diff] [blame] | 495 | "script-badges", |
| 496 | IDS_FLAGS_SCRIPT_BADGES_NAME, |
| 497 | IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 498 | kOsDesktop, |
[email protected] | 544471a | 2012-10-13 05:27:09 | [diff] [blame] | 499 | SINGLE_VALUE_TYPE(switches::kScriptBadges) |
| 500 | }, |
| 501 | { |
| 502 | "script-bubble", |
| 503 | IDS_FLAGS_SCRIPT_BUBBLE_NAME, |
| 504 | IDS_FLAGS_SCRIPT_BUBBLE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 505 | kOsDesktop, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 506 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kScriptBubble, "1", |
| 507 | switches::kScriptBubble, "0") |
[email protected] | 3a36243 | 2012-06-18 20:39:51 | [diff] [blame] | 508 | }, |
| 509 | { |
[email protected] | cbe224d | 2011-08-04 22:12:49 | [diff] [blame] | 510 | "apps-new-install-bubble", |
| 511 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME, |
| 512 | IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 513 | kOsDesktop, |
[email protected] | cbe224d | 2011-08-04 22:12:49 | [diff] [blame] | 514 | SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble) |
| 515 | }, |
| 516 | { |
[email protected] | 80bd24e | 2010-11-30 09:34:38 | [diff] [blame] | 517 | "disable-hyperlink-auditing", |
| 518 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME, |
| 519 | IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION, |
| 520 | kOsAll, |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 521 | SINGLE_VALUE_TYPE(switches::kNoPings) |
[email protected] | feb28fef | 2010-12-01 10:52:51 | [diff] [blame] | 522 | }, |
| 523 | { |
| 524 | "experimental-location-features", // FLAGS:RECORD_UMA |
| 525 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_NAME, |
| 526 | IDS_FLAGS_EXPERIMENTAL_LOCATION_FEATURES_DESCRIPTION, |
| 527 | kOsMac | kOsWin | kOsLinux, // Currently does nothing on CrOS. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 528 | SINGLE_VALUE_TYPE(switches::kExperimentalLocationFeatures) |
| 529 | }, |
| 530 | { |
[email protected] | 5aea186 | 2011-03-23 23:55:39 | [diff] [blame] | 531 | "tab-groups-context-menu", |
| 532 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_NAME, |
| 533 | IDS_FLAGS_TAB_GROUPS_CONTEXT_MENU_DESCRIPTION, |
| 534 | kOsWin, |
| 535 | SINGLE_VALUE_TYPE(switches::kEnableTabGroupsContextMenu) |
| 536 | }, |
[email protected] | c94cebd | 2012-06-21 00:55:28 | [diff] [blame] | 537 | { |
| 538 | "enable-instant-extended-api", |
| 539 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API, |
| 540 | IDS_FLAGS_ENABLE_INSTANT_EXTENDED_API_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 541 | kOsDesktop, |
[email protected] | 7344438 | 2013-02-26 19:31:51 | [diff] [blame] | 542 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableInstantExtendedAPI, |
| 543 | switches::kDisableInstantExtendedAPI) |
[email protected] | c94cebd | 2012-06-21 00:55:28 | [diff] [blame] | 544 | }, |
[email protected] | e9bf9d9 | 2011-03-31 20:57:15 | [diff] [blame] | 545 | { |
[email protected] | 354e33b | 2011-06-15 00:29:10 | [diff] [blame] | 546 | "static-ip-config", |
| 547 | IDS_FLAGS_STATIC_IP_CONFIG_NAME, |
| 548 | IDS_FLAGS_STATIC_IP_CONFIG_DESCRIPTION, |
| 549 | kOsCrOS, |
| 550 | #if defined(OS_CHROMEOS) |
| 551 | // This switch exists only on Chrome OS. |
| 552 | SINGLE_VALUE_TYPE(switches::kEnableStaticIPConfig) |
| 553 | #else |
| 554 | SINGLE_VALUE_TYPE("") |
| 555 | #endif |
| 556 | }, |
[email protected] | 3eb5728c | 2011-06-20 22:32:24 | [diff] [blame] | 557 | { |
| 558 | "show-autofill-type-predictions", |
| 559 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_NAME, |
| 560 | IDS_FLAGS_SHOW_AUTOFILL_TYPE_PREDICTIONS_DESCRIPTION, |
| 561 | kOsAll, |
| 562 | SINGLE_VALUE_TYPE(switches::kShowAutofillTypePredictions) |
| 563 | }, |
[email protected] | bff4d3e | 2011-06-21 23:58:52 | [diff] [blame] | 564 | { |
[email protected] | fdf4e25 | 2012-04-27 00:26:55 | [diff] [blame] | 565 | "sync-tab-favicons", |
| 566 | IDS_FLAGS_SYNC_TAB_FAVICONS_NAME, |
| 567 | IDS_FLAGS_SYNC_TAB_FAVICONS_DESCRIPTION, |
| 568 | kOsAll, |
| 569 | SINGLE_VALUE_TYPE(switches::kSyncTabFavicons) |
| 570 | }, |
| 571 | { |
[email protected] | 5d90a0a | 2012-11-15 02:43:40 | [diff] [blame] | 572 | "sync-keystore-encryption", |
| 573 | IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_NAME, |
| 574 | IDS_FLAGS_SYNC_KEYSTORE_ENCRYPTION_DESCRIPTION, |
| 575 | kOsAll, |
| 576 | SINGLE_VALUE_TYPE(switches::kSyncKeystoreEncryption) |
| 577 | }, |
| 578 | { |
[email protected] | e755a38 | 2012-09-13 17:16:35 | [diff] [blame] | 579 | "enable-gesture-tap-highlight", |
| 580 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_NAME, |
| 581 | IDS_FLAGS_ENABLE_GESTURE_TAP_HIGHLIGHTING_DESCRIPTION, |
| 582 | kOsLinux | kOsCrOS, |
[email protected] | 06ca05d | 2013-03-13 19:12:47 | [diff] [blame^] | 583 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableGestureTapHighlight, |
| 584 | switches::kDisableGestureTapHighlight) |
[email protected] | e755a38 | 2012-09-13 17:16:35 | [diff] [blame] | 585 | }, |
| 586 | { |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 587 | "enable-smooth-scrolling", // FLAGS:RECORD_UMA |
| 588 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME, |
| 589 | IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION, |
| 590 | // Can't expose the switch unless the code is compiled in. |
[email protected] | 554b706 | 2011-09-03 03:09:40 | [diff] [blame] | 591 | // On by default for the Mac (different implementation in WebKit). |
[email protected] | 2a5e9d0 | 2013-01-20 01:09:25 | [diff] [blame] | 592 | kOsWin | kOsLinux, |
[email protected] | a22ebd81 | 2011-06-23 00:05:39 | [diff] [blame] | 593 | SINGLE_VALUE_TYPE(switches::kEnableSmoothScrolling) |
| 594 | }, |
[email protected] | 81a6b0b | 2011-06-24 17:55:40 | [diff] [blame] | 595 | { |
[email protected] | 6831780 | 2012-06-07 19:13:23 | [diff] [blame] | 596 | "omnibox-history-quick-provider-new-scoring", |
| 597 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_NAME, |
| 598 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_NEW_SCORING_DESCRIPTION, |
| 599 | kOsAll, |
| 600 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderNewScoringChoices) |
| 601 | }, |
| 602 | { |
[email protected] | 128dc6c | 2012-06-22 20:30:35 | [diff] [blame] | 603 | "omnibox-history-quick-provider-reorder-for-inlining", |
| 604 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_NAME, |
| 605 | IDS_FLAGS_OMNIBOX_HISTORY_QUICK_PROVIDER_REORDER_FOR_INLINING_DESCRIPTION, |
| 606 | kOsAll, |
| 607 | MULTI_VALUE_TYPE(kOmniboxHistoryQuickProviderReorderForInliningChoices) |
| 608 | }, |
| 609 | { |
[email protected] | 032d5e6c | 2012-02-17 17:53:55 | [diff] [blame] | 610 | "omnibox-inline-history-quick-provider", |
| 611 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_NAME, |
| 612 | IDS_FLAGS_OMNIBOX_INLINE_HISTORY_QUICK_PROVIDER_DESCRIPTION, |
| 613 | kOsAll, |
| 614 | MULTI_VALUE_TYPE(kOmniboxInlineHistoryQuickProviderChoices) |
| 615 | }, |
| 616 | { |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 617 | "enable-panels", |
| 618 | IDS_FLAGS_ENABLE_PANELS_NAME, |
| 619 | IDS_FLAGS_ENABLE_PANELS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 620 | kOsDesktop, |
[email protected] | 7e7a2809 | 2011-12-09 22:24:55 | [diff] [blame] | 621 | SINGLE_VALUE_TYPE(switches::kEnablePanels) |
[email protected] | 73fb1fc5 | 2011-07-09 00:06:54 | [diff] [blame] | 622 | }, |
[email protected] | e3749d1 | 2011-07-25 22:22:12 | [diff] [blame] | 623 | { |
[email protected] | 27c14f0 | 2012-06-22 17:29:58 | [diff] [blame] | 624 | // See http://crbug.com/120416 for how to remove this flag. |
[email protected] | 6474b11 | 2012-05-04 19:35:27 | [diff] [blame] | 625 | "save-page-as-mhtml", // FLAGS:RECORD_UMA |
| 626 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_NAME, |
| 627 | IDS_FLAGS_SAVE_PAGE_AS_MHTML_DESCRIPTION, |
| 628 | kOsMac | kOsWin | kOsLinux, |
| 629 | SINGLE_VALUE_TYPE(switches::kSavePageAsMHTML) |
| 630 | }, |
| 631 | { |
[email protected] | b7bb44f | 2011-09-01 05:17:03 | [diff] [blame] | 632 | "enable-autologin", |
| 633 | IDS_FLAGS_ENABLE_AUTOLOGIN_NAME, |
| 634 | IDS_FLAGS_ENABLE_AUTOLOGIN_DESCRIPTION, |
| 635 | kOsMac | kOsWin | kOsLinux, |
| 636 | SINGLE_VALUE_TYPE(switches::kEnableAutologin) |
| 637 | }, |
[email protected] | b984117 | 2011-09-26 23:36:09 | [diff] [blame] | 638 | { |
[email protected] | 3231b61 | 2012-03-23 05:57:54 | [diff] [blame] | 639 | "enable-spdy3", |
| 640 | IDS_FLAGS_ENABLE_SPDY3_NAME, |
| 641 | IDS_FLAGS_ENABLE_SPDY3_DESCRIPTION, |
| 642 | kOsAll, |
| 643 | SINGLE_VALUE_TYPE(switches::kEnableSpdy3) |
| 644 | }, |
| 645 | { |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 646 | "enable-async-dns", |
| 647 | IDS_FLAGS_ENABLE_ASYNC_DNS_NAME, |
| 648 | IDS_FLAGS_ENABLE_ASYNC_DNS_DESCRIPTION, |
[email protected] | 85594c14 | 2012-09-11 18:02:46 | [diff] [blame] | 649 | kOsWin | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 650 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAsyncDns, |
| 651 | switches::kDisableAsyncDns) |
[email protected] | 27b3fe9 | 2012-03-21 05:35:06 | [diff] [blame] | 652 | }, |
| 653 | { |
[email protected] | 1eb9380 | 2012-09-11 18:57:56 | [diff] [blame] | 654 | "disable-media-source", |
[email protected] | da43c08 | 2012-09-07 18:56:11 | [diff] [blame] | 655 | IDS_FLAGS_DISABLE_MEDIA_SOURCE_NAME, |
| 656 | IDS_FLAGS_DISABLE_MEDIA_SOURCE_DESCRIPTION, |
[email protected] | ec9d053 | 2012-03-21 05:55:32 | [diff] [blame] | 657 | kOsAll, |
[email protected] | da43c08 | 2012-09-07 18:56:11 | [diff] [blame] | 658 | SINGLE_VALUE_TYPE(switches::kDisableMediaSource) |
[email protected] | 6aa03b3 | 2011-10-27 21:44:44 | [diff] [blame] | 659 | }, |
[email protected] | e4e68dbb | 2011-11-18 01:50:22 | [diff] [blame] | 660 | { |
[email protected] | 36d9841 | 2013-01-31 20:28:53 | [diff] [blame] | 661 | "disable-encrypted-media", |
| 662 | IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_NAME, |
| 663 | IDS_FLAGS_DISABLE_ENCRYPTED_MEDIA_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 664 | kOsDesktop, |
[email protected] | 36d9841 | 2013-01-31 20:28:53 | [diff] [blame] | 665 | SINGLE_VALUE_TYPE(switches::kDisableEncryptedMedia) |
[email protected] | 9f5b782 | 2012-04-18 23:39:03 | [diff] [blame] | 666 | }, |
[email protected] | f8862879 | 2012-12-18 07:07:50 | [diff] [blame] | 667 | { |
| 668 | "enable-opus-playback", |
| 669 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_NAME, |
| 670 | IDS_FLAGS_ENABLE_OPUS_PLAYBACK_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 671 | kOsDesktop, |
[email protected] | f8862879 | 2012-12-18 07:07:50 | [diff] [blame] | 672 | SINGLE_VALUE_TYPE(switches::kEnableOpusPlayback) |
| 673 | }, |
[email protected] | ca6eaa5a | 2013-01-24 16:16:04 | [diff] [blame] | 674 | { |
[email protected] | c54e1aa | 2013-01-25 09:26:17 | [diff] [blame] | 675 | "enable-vp9-playback", |
| 676 | IDS_FLAGS_ENABLE_VP9_PLAYBACK_NAME, |
| 677 | IDS_FLAGS_ENABLE_VP9_PLAYBACK_DESCRIPTION, |
| 678 | kOsDesktop, |
| 679 | SINGLE_VALUE_TYPE(switches::kEnableVp9Playback) |
| 680 | }, |
| 681 | { |
[email protected] | ca6eaa5a | 2013-01-24 16:16:04 | [diff] [blame] | 682 | "enable-managed-users", |
| 683 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_NAME, |
| 684 | IDS_FLAGS_ENABLE_LOCALLY_MANAGED_USERS_DESCRIPTION, |
| 685 | kOsAll, |
| 686 | SINGLE_VALUE_TYPE(switches::kEnableManagedUsers) |
| 687 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 688 | #if defined(USE_ASH) |
[email protected] | 8cc10df | 2011-11-03 23:57:50 | [diff] [blame] | 689 | { |
[email protected] | cda278d | 2012-10-30 20:31:40 | [diff] [blame] | 690 | "ash-disable-auto-window-placement", |
| 691 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_NAME, |
| 692 | IDS_FLAGS_ASH_AUTO_WINDOW_PLACEMENT_DESCRIPTION, |
| 693 | kOsWin | kOsLinux | kOsCrOS, |
| 694 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableAutoWindowPlacement) |
| 695 | }, |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 696 | { |
[email protected] | 16f55a2 | 2013-02-13 23:47:34 | [diff] [blame] | 697 | "ash-disable-per-app-launcher", |
| 698 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_NAME, |
| 699 | IDS_FLAGS_ASH_DISABLE_PER_APP_LAUNCHER_DESCRIPTION, |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 700 | kOsWin | kOsLinux | kOsCrOS, |
[email protected] | 16f55a2 | 2013-02-13 23:47:34 | [diff] [blame] | 701 | SINGLE_VALUE_TYPE(ash::switches::kAshDisablePerAppLauncher) |
[email protected] | b4e4ec4 | 2012-11-29 21:42:40 | [diff] [blame] | 702 | }, |
[email protected] | 1c92d862 | 2013-03-06 13:06:13 | [diff] [blame] | 703 | { |
| 704 | "ash-enable-full-browser-list-in-launcher", |
| 705 | IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_NAME, |
| 706 | IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_DESCRIPTION, |
| 707 | kOsWin | kOsLinux | kOsCrOS, |
| 708 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableFullBrowserListInLauncher) |
| 709 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 710 | #endif |
[email protected] | eaae8b46 | 2012-01-20 22:20:39 | [diff] [blame] | 711 | { |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 712 | "per-tile-painting", |
| 713 | IDS_FLAGS_PER_TILE_PAINTING_NAME, |
| 714 | IDS_FLAGS_PER_TILE_PAINTING_DESCRIPTION, |
[email protected] | a5b1b27 | 2012-01-06 20:44:37 | [diff] [blame] | 715 | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 65bfd997 | 2012-10-19 03:39:37 | [diff] [blame] | 716 | SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting) |
[email protected] | db543d32 | 2011-12-15 20:40:15 | [diff] [blame] | 717 | }, |
[email protected] | bf88c03 | 2011-12-22 19:05:47 | [diff] [blame] | 718 | { |
| 719 | "enable-javascript-harmony", |
| 720 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_NAME, |
| 721 | IDS_FLAGS_ENABLE_JAVASCRIPT_HARMONY_DESCRIPTION, |
| 722 | kOsAll, |
| 723 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kJavaScriptFlags, "--harmony") |
| 724 | }, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 725 | { |
[email protected] | 8564617 | 2012-01-09 22:45:54 | [diff] [blame] | 726 | "enable-tab-browser-dragging", |
| 727 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_NAME, |
| 728 | IDS_FLAGS_ENABLE_TAB_BROWSER_DRAGGING_DESCRIPTION, |
| 729 | kOsWin, |
| 730 | SINGLE_VALUE_TYPE(switches::kTabBrowserDragging) |
| 731 | }, |
| 732 | { |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 733 | "disable-restore-session-state", |
| 734 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_NAME, |
| 735 | IDS_FLAGS_DISABLE_RESTORE_SESSION_STATE_DESCRIPTION, |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 736 | kOsAll, |
[email protected] | 068b7b5 | 2012-02-27 12:41:44 | [diff] [blame] | 737 | SINGLE_VALUE_TYPE(switches::kDisableRestoreSessionState) |
[email protected] | 7e7f378a | 2012-01-05 14:35:37 | [diff] [blame] | 738 | }, |
[email protected] | 88864db | 2012-01-18 20:56:35 | [diff] [blame] | 739 | { |
| 740 | "disable-software-rasterizer", |
| 741 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_NAME, |
| 742 | IDS_FLAGS_DISABLE_SOFTWARE_RASTERIZER_DESCRIPTION, |
| 743 | #if defined(ENABLE_SWIFTSHADER) |
| 744 | kOsAll, |
| 745 | #else |
| 746 | 0, |
| 747 | #endif |
| 748 | SINGLE_VALUE_TYPE(switches::kDisableSoftwareRasterizer) |
| 749 | }, |
[email protected] | 15a5d72 | 2012-01-23 09:11:14 | [diff] [blame] | 750 | { |
[email protected] | ff7b6dd | 2012-09-15 20:20:03 | [diff] [blame] | 751 | "enable-experimental-webkit-features", |
| 752 | IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_NAME, |
| 753 | IDS_FLAGS_EXPERIMENTAL_WEBKIT_FEATURES_DESCRIPTION, |
[email protected] | d2edc670 | 2012-01-30 09:13:16 | [diff] [blame] | 754 | kOsAll, |
[email protected] | ff7b6dd | 2012-09-15 20:20:03 | [diff] [blame] | 755 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebKitFeatures) |
[email protected] | ca7a3d79 | 2012-03-02 15:55:49 | [diff] [blame] | 756 | }, |
| 757 | { |
[email protected] | 0f95a25 | 2012-09-13 22:30:04 | [diff] [blame] | 758 | "enable-css-shaders", |
| 759 | IDS_FLAGS_CSS_SHADERS_NAME, |
| 760 | IDS_FLAGS_CSS_SHADERS_DESCRIPTION, |
| 761 | kOsAll, |
| 762 | SINGLE_VALUE_TYPE(switches::kEnableCssShaders) |
| 763 | }, |
| 764 | { |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 765 | "enable-extension-activity-ui", |
| 766 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_NAME, |
| 767 | IDS_FLAGS_ENABLE_EXTENSION_ACTIVITY_UI_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 768 | kOsDesktop, |
[email protected] | 9860c68b | 2012-02-02 01:58:09 | [diff] [blame] | 769 | SINGLE_VALUE_TYPE(switches::kEnableExtensionActivityUI) |
[email protected] | 8bed69d | 2012-02-02 06:46:00 | [diff] [blame] | 770 | }, |
[email protected] | 54ae4e9 | 2012-02-16 15:19:05 | [diff] [blame] | 771 | { |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 772 | "disable-ntp-other-sessions-menu", |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 773 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_NAME, |
| 774 | IDS_FLAGS_NTP_OTHER_SESSIONS_MENU_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 775 | kOsDesktop, |
[email protected] | 3e8befc | 2012-03-13 01:17:03 | [diff] [blame] | 776 | SINGLE_VALUE_TYPE(switches::kDisableNTPOtherSessionsMenu) |
[email protected] | 156f96633 | 2012-02-29 00:03:16 | [diff] [blame] | 777 | }, |
[email protected] | dc04be7c | 2012-03-15 23:57:49 | [diff] [blame] | 778 | #if defined(USE_ASH) |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 779 | { |
[email protected] | 3cd198a2 | 2012-03-12 20:38:01 | [diff] [blame] | 780 | "enable-ash-oak", |
| 781 | IDS_FLAGS_ENABLE_ASH_OAK_NAME, |
| 782 | IDS_FLAGS_ENABLE_ASH_OAK_DESCRIPTION, |
| 783 | kOsAll, |
| 784 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableOak), |
| 785 | }, |
[email protected] | 31cf1c5 | 2012-02-29 20:55:01 | [diff] [blame] | 786 | #endif |
[email protected] | 184ec59 | 2012-03-01 11:54:28 | [diff] [blame] | 787 | { |
| 788 | "enable-devtools-experiments", |
| 789 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_NAME, |
| 790 | IDS_FLAGS_ENABLE_DEVTOOLS_EXPERIMENTS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 791 | kOsDesktop, |
[email protected] | 184ec59 | 2012-03-01 11:54:28 | [diff] [blame] | 792 | SINGLE_VALUE_TYPE(switches::kEnableDevToolsExperiments) |
| 793 | }, |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 794 | { |
[email protected] | 2fefdb3 | 2013-02-26 14:28:10 | [diff] [blame] | 795 | "silent-debugger-extension-api", |
| 796 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_NAME, |
| 797 | IDS_FLAGS_SILENT_DEBUGGER_EXTENSION_API_DESCRIPTION, |
| 798 | kOsDesktop, |
| 799 | SINGLE_VALUE_TYPE(switches::kSilentDebuggerExtensionAPI) |
| 800 | }, |
| 801 | { |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 802 | "enable-suggestions-ntp", |
| 803 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_NAME, |
| 804 | IDS_FLAGS_NTP_SUGGESTIONS_PAGE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 805 | kOsDesktop, |
[email protected] | 76d1854e | 2012-03-02 23:57:44 | [diff] [blame] | 806 | SINGLE_VALUE_TYPE(switches::kEnableSuggestionsTabPage) |
| 807 | }, |
[email protected] | a3d5425 | 2012-04-05 20:04:13 | [diff] [blame] | 808 | { |
[email protected] | 1dbaf5e | 2012-11-30 05:51:32 | [diff] [blame] | 809 | "spellcheck-autocorrect", |
| 810 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT, |
| 811 | IDS_FLAGS_SPELLCHECK_AUTOCORRECT_DESCRIPTION, |
| 812 | kOsWin | kOsLinux | kOsCrOS, |
| 813 | SINGLE_VALUE_TYPE(switches::kEnableSpellingAutoCorrect) |
| 814 | }, |
| 815 | { |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 816 | "touch-events", |
| 817 | IDS_TOUCH_EVENTS_NAME, |
| 818 | IDS_TOUCH_EVENTS_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 819 | kOsDesktop, |
[email protected] | d793253 | 2012-11-21 21:10:31 | [diff] [blame] | 820 | MULTI_VALUE_TYPE(kTouchEventsChoices) |
| 821 | }, |
| 822 | { |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 823 | "touch-optimized-ui", |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 824 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME, |
| 825 | IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION, |
[email protected] | c71fe640 | 2012-08-15 15:22:55 | [diff] [blame] | 826 | kOsWin, |
[email protected] | 347a0c7 | 2012-05-14 20:28:06 | [diff] [blame] | 827 | MULTI_VALUE_TYPE(kTouchOptimizedUIChoices) |
[email protected] | c9c73ad4 | 2012-04-18 03:35:59 | [diff] [blame] | 828 | }, |
[email protected] | 8a6aaa7 | 2012-04-20 20:53:58 | [diff] [blame] | 829 | { |
[email protected] | b9c96ff | 2012-11-26 22:24:40 | [diff] [blame] | 830 | "disable-touch-adjustment", |
| 831 | IDS_DISABLE_TOUCH_ADJUSTMENT_NAME, |
| 832 | IDS_DISABLE_TOUCH_ADJUSTMENT_DESCRIPTION, |
| 833 | kOsWin | kOsLinux | kOsCrOS, |
| 834 | SINGLE_VALUE_TYPE(switches::kDisableTouchAdjustment) |
| 835 | }, |
| 836 | { |
[email protected] | 0b9383a | 2012-10-26 00:58:16 | [diff] [blame] | 837 | "enable-tab-capture", |
| 838 | IDS_ENABLE_TAB_CAPTURE_NAME, |
| 839 | IDS_ENABLE_TAB_CAPTURE_DESCRIPTION, |
[email protected] | a692d13 | 2012-10-31 05:15:25 | [diff] [blame] | 840 | kOsWin | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 841 | ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(switches::kTabCapture, "1", |
| 842 | switches::kTabCapture, "0") |
[email protected] | 0b9383a | 2012-10-26 00:58:16 | [diff] [blame] | 843 | }, |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 844 | #if defined(OS_CHROMEOS) |
| 845 | { |
[email protected] | 7c4a9bc | 2012-09-11 22:10:05 | [diff] [blame] | 846 | "enable-background-loader", |
| 847 | IDS_ENABLE_BACKLOADER_NAME, |
| 848 | IDS_ENABLE_BACKLOADER_DESCRIPTION, |
| 849 | kOsCrOS, |
| 850 | SINGLE_VALUE_TYPE(switches::kEnableBackgroundLoader) |
| 851 | }, |
| 852 | { |
[email protected] | c5667b28 | 2012-08-31 00:32:50 | [diff] [blame] | 853 | "enable-bezel-touch", |
| 854 | IDS_ENABLE_BEZEL_TOUCH_NAME, |
| 855 | IDS_ENABLE_BEZEL_TOUCH_DESCRIPTION, |
[email protected] | 1995d80d | 2012-08-23 02:58:47 | [diff] [blame] | 856 | kOsCrOS, |
[email protected] | c5667b28 | 2012-08-31 00:32:50 | [diff] [blame] | 857 | SINGLE_VALUE_TYPE(switches::kEnableBezelTouch) |
[email protected] | 1995d80d | 2012-08-23 02:58:47 | [diff] [blame] | 858 | }, |
| 859 | { |
[email protected] | 3f4181a | 2013-02-01 21:31:07 | [diff] [blame] | 860 | "enable-screensaver-extension", |
| 861 | IDS_ENABLE_SCREENSAVER_EXTENSION_NAME, |
| 862 | IDS_ENABLE_SCREENSAVER_EXTENSION_DESCRIPTION, |
| 863 | kOsCrOS, |
| 864 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableScreensaverExtensions) |
| 865 | }, |
| 866 | { |
[email protected] | 0b60afa | 2012-04-19 17:36:39 | [diff] [blame] | 867 | "no-discard-tabs", |
| 868 | IDS_FLAGS_NO_DISCARD_TABS_NAME, |
| 869 | IDS_FLAGS_NO_DISCARD_TABS_DESCRIPTION, |
| 870 | kOsCrOS, |
| 871 | SINGLE_VALUE_TYPE(switches::kNoDiscardTabs) |
| 872 | }, |
| 873 | #endif |
[email protected] | 79be6d3 | 2012-04-24 20:47:44 | [diff] [blame] | 874 | { |
[email protected] | 8d68a3e0 | 2013-01-12 15:57:10 | [diff] [blame] | 875 | "enable-download-resumption", |
| 876 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_NAME, |
| 877 | IDS_FLAGS_ENABLE_DOWNLOAD_RESUMPTION_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 878 | kOsDesktop, |
[email protected] | 8d68a3e0 | 2013-01-12 15:57:10 | [diff] [blame] | 879 | SINGLE_VALUE_TYPE(switches::kEnableDownloadResumption) |
| 880 | }, |
| 881 | { |
[email protected] | 9a5940d | 2012-04-27 19:16:23 | [diff] [blame] | 882 | "allow-nacl-socket-api", |
| 883 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_NAME, |
| 884 | IDS_FLAGS_ALLOW_NACL_SOCKET_API_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 885 | kOsDesktop, |
[email protected] | 9a5940d | 2012-04-27 19:16:23 | [diff] [blame] | 886 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kAllowNaClSocketAPI, "*") |
| 887 | }, |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 888 | { |
[email protected] | 60673ad7 | 2012-05-02 06:16:33 | [diff] [blame] | 889 | "stacked-tab-strip", |
| 890 | IDS_FLAGS_STACKED_TAB_STRIP_NAME, |
| 891 | IDS_FLAGS_STACKED_TAB_STRIP_DESCRIPTION, |
| 892 | kOsWin, |
| 893 | SINGLE_VALUE_TYPE(switches::kEnableStackedTabStrip) |
| 894 | }, |
| 895 | { |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 896 | "force-device-scale-factor", |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 897 | IDS_FLAGS_FORCE_HIGH_DPI_NAME, |
| 898 | IDS_FLAGS_FORCE_HIGH_DPI_DESCRIPTION, |
| 899 | kOsCrOS, |
[email protected] | 4bd2020 | 2012-06-14 17:35:01 | [diff] [blame] | 900 | SINGLE_VALUE_TYPE_AND_VALUE(switches::kForceDeviceScaleFactor, "2") |
[email protected] | 8533373 | 2012-05-01 19:02:24 | [diff] [blame] | 901 | }, |
[email protected] | 190349fd | 2012-05-02 00:10:47 | [diff] [blame] | 902 | #if defined(OS_CHROMEOS) |
| 903 | { |
| 904 | "allow-touchpad-three-finger-click", |
| 905 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_NAME, |
| 906 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_CLICK_DESCRIPTION, |
| 907 | kOsCrOS, |
| 908 | SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerClick) |
| 909 | }, |
[email protected] | fbc176b6 | 2012-10-27 02:19:58 | [diff] [blame] | 910 | { |
| 911 | "allow-touchpad-three-finger-swipe", |
| 912 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_NAME, |
| 913 | IDS_FLAGS_ALLOW_TOUCHPAD_THREE_FINGER_SWIPE_DESCRIPTION, |
| 914 | kOsCrOS, |
| 915 | SINGLE_VALUE_TYPE(switches::kEnableTouchpadThreeFingerSwipe) |
| 916 | }, |
[email protected] | 190349fd | 2012-05-02 00:10:47 | [diff] [blame] | 917 | #endif |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 918 | { |
[email protected] | a585e46 | 2013-01-26 00:37:15 | [diff] [blame] | 919 | "use-client-login-signin-flow", |
| 920 | IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_NAME, |
| 921 | IDS_FLAGS_USE_CLIENT_LOGIN_SIGNIN_FLOW_DESCRIPTION, |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 922 | kOsMac | kOsWin | kOsLinux, |
[email protected] | a585e46 | 2013-01-26 00:37:15 | [diff] [blame] | 923 | SINGLE_VALUE_TYPE(switches::kUseClientLoginSigninFlow) |
[email protected] | 1992a2f4 | 2012-10-23 18:32:21 | [diff] [blame] | 924 | }, |
[email protected] | 8ee0224 | 2012-12-04 15:23:32 | [diff] [blame] | 925 | { |
| 926 | "enable-desktop-guest-mode", |
| 927 | IDS_FLAGS_DESKTOP_GUEST_MODE_NAME, |
| 928 | IDS_FLAGS_DESKTOP_GUEST_MODE_DESCRIPTION, |
| 929 | kOsMac | kOsWin | kOsLinux, |
| 930 | SINGLE_VALUE_TYPE(switches::kEnableDesktopGuestMode) |
| 931 | }, |
[email protected] | 53520b1b | 2012-05-07 21:43:37 | [diff] [blame] | 932 | #if defined(USE_ASH) |
| 933 | { |
[email protected] | fac380e0 | 2013-03-08 20:06:30 | [diff] [blame] | 934 | "hide-launcher-alignment-menu", |
| 935 | IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_NAME, |
| 936 | IDS_FLAGS_HIDE_LAUNCHER_ALIGNMENT_MENU_DESCRIPTION, |
[email protected] | 35a4ced | 2013-02-06 23:24:42 | [diff] [blame] | 937 | kOsAll, |
[email protected] | fac380e0 | 2013-03-08 20:06:30 | [diff] [blame] | 938 | SINGLE_VALUE_TYPE(switches::kHideLauncherAlignmentMenu) |
[email protected] | 35a4ced | 2013-02-06 23:24:42 | [diff] [blame] | 939 | }, |
| 940 | { |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 941 | "show-touch-hud", |
| 942 | IDS_FLAGS_SHOW_TOUCH_HUD_NAME, |
| 943 | IDS_FLAGS_SHOW_TOUCH_HUD_DESCRIPTION, |
| 944 | kOsAll, |
| 945 | SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud) |
| 946 | }, |
| 947 | { |
[email protected] | 9f0940b6 | 2012-05-23 22:56:35 | [diff] [blame] | 948 | "enable-pinch", |
| 949 | IDS_FLAGS_ENABLE_PINCH_SCALE_NAME, |
| 950 | IDS_FLAGS_ENABLE_PINCH_SCALE_DESCRIPTION, |
[email protected] | 16ad47f8 | 2012-12-05 21:06:06 | [diff] [blame] | 951 | kOsLinux | kOsWin | kOsCrOS, |
[email protected] | 9f0940b6 | 2012-05-23 22:56:35 | [diff] [blame] | 952 | SINGLE_VALUE_TYPE(switches::kEnablePinch), |
| 953 | }, |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 954 | { |
| 955 | "app-list-show-apps-only", |
| 956 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_NAME, |
| 957 | IDS_FLAGS_ENABLE_APP_LIST_SHOW_APPS_ONLY_DESCRIPTION, |
| 958 | kOsAll, |
[email protected] | 0bc6c27 | 2012-07-17 03:32:03 | [diff] [blame] | 959 | SINGLE_VALUE_TYPE(app_list::switches::kAppListShowAppsOnly), |
[email protected] | a837931 | 2012-06-15 00:20:43 | [diff] [blame] | 960 | }, |
[email protected] | 7307474 | 2012-05-17 01:44:41 | [diff] [blame] | 961 | #endif // defined(USE_ASH) |
[email protected] | ed7b67f3 | 2012-05-28 10:12:28 | [diff] [blame] | 962 | #if defined(OS_CHROMEOS) |
| 963 | { |
[email protected] | 8b04a165 | 2012-08-04 02:59:49 | [diff] [blame] | 964 | "disable-boot-animation", |
| 965 | IDS_FLAGS_DISABLE_BOOT_ANIMATION, |
| 966 | IDS_FLAGS_DISABLE_BOOT_ANIMATION_DESCRIPTION, |
| 967 | kOsCrOS, |
| 968 | SINGLE_VALUE_TYPE(switches::kDisableBootAnimation), |
| 969 | }, |
[email protected] | 9505857 | 2012-08-20 14:57:29 | [diff] [blame] | 970 | { |
[email protected] | b455719 | 2012-09-19 11:29:58 | [diff] [blame] | 971 | "disable-boot-animation2", |
| 972 | IDS_FLAGS_DISABLE_BOOT_ANIMATION2, |
| 973 | IDS_FLAGS_DISABLE_BOOT_ANIMATION2_DESCRIPTION, |
| 974 | kOsCrOS, |
| 975 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableBootAnimation2), |
| 976 | }, |
| 977 | { |
[email protected] | ea2f334 | 2012-09-21 21:13:36 | [diff] [blame] | 978 | "boot-animation-fucntion", |
| 979 | IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION, |
| 980 | IDS_FLAGS_ASH_BOOT_ANIMATION_FUNCTION_DESCRIPTION, |
| 981 | kOsCrOS, |
| 982 | MULTI_VALUE_TYPE(kAshBootAnimationFunction), |
| 983 | }, |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 984 | { |
[email protected] | d96aef2 | 2012-10-30 11:47:02 | [diff] [blame] | 985 | "captive-portal-detector", |
| 986 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_NAME, |
| 987 | IDS_FLAGS_CAPTIVE_PORTAL_DETECTOR_DESCRIPTION, |
| 988 | kOsCrOS, |
| 989 | MULTI_VALUE_TYPE(kChromeCaptivePortalDetectionChoices), |
| 990 | }, |
| 991 | { |
[email protected] | c11aa8f1 | 2012-12-18 18:43:14 | [diff] [blame] | 992 | "disable-new-lock-animations", |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 993 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS, |
| 994 | IDS_FLAGS_ASH_NEW_LOCK_ANIMATIONS_DESCRIPTION, |
| 995 | kOsCrOS, |
[email protected] | c11aa8f1 | 2012-12-18 18:43:14 | [diff] [blame] | 996 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewLockAnimations), |
[email protected] | 839667d6 | 2012-10-23 19:38:57 | [diff] [blame] | 997 | }, |
[email protected] | f028095 | 2012-11-06 20:30:50 | [diff] [blame] | 998 | { |
[email protected] | 0fb5c485 | 2012-11-08 20:33:23 | [diff] [blame] | 999 | "file-manager-packaged", |
| 1000 | IDS_FLAGS_FILE_MANAGER_PACKAGED_NAME, |
| 1001 | IDS_FLAGS_FILE_MANAGER_PACKAGED_DESCRIPTION, |
| 1002 | kOsCrOS, |
| 1003 | SINGLE_VALUE_TYPE(switches::kFileManagerPackaged), |
| 1004 | }, |
[email protected] | 3e035e8 | 2012-11-27 20:54:32 | [diff] [blame] | 1005 | { |
[email protected] | 8039e06c | 2013-01-17 23:34:50 | [diff] [blame] | 1006 | "disable-launcher-per-display", |
| 1007 | IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_NAME, |
| 1008 | IDS_FLAGS_DISABLE_LAUNCHER_PER_DISPLAY_DESCRIPTION, |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1009 | kOsCrOS, |
[email protected] | 8039e06c | 2013-01-17 23:34:50 | [diff] [blame] | 1010 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableLauncherPerDisplay), |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1011 | }, |
[email protected] | 06b146d | 2013-02-07 06:06:47 | [diff] [blame] | 1012 | { |
| 1013 | "enable-app-mode", |
| 1014 | IDS_FLAGS_ENABLE_KIOSK_APPS_NAME, |
| 1015 | IDS_FLAGS_ENABLE_KIOSK_APPS_DESCRIPTION, |
| 1016 | kOsCrOS, |
| 1017 | SINGLE_VALUE_TYPE(switches::kEnableAppMode), |
| 1018 | }, |
[email protected] | 6ad015c | 2013-03-06 00:49:51 | [diff] [blame] | 1019 | { |
| 1020 | "force-fullscreen-app", |
| 1021 | IDS_FLAGS_FORCE_FULLSCREEN_APP_NAME, |
| 1022 | IDS_FLAGS_FORCE_FULLSCREEN_APP_DESCRIPTION, |
| 1023 | kOsCrOS, |
| 1024 | SINGLE_VALUE_TYPE(switches::kForceFullscreenApp), |
| 1025 | }, |
[email protected] | a78c743 | 2013-03-13 06:22:43 | [diff] [blame] | 1026 | { |
| 1027 | "ash-internal-display-ui-scale", |
| 1028 | IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_NAME, |
| 1029 | IDS_FLAGS_ASH_INTERNAL_DISPLAY_SCALE_DESCRIPTION, |
| 1030 | kOsCrOS, |
| 1031 | MULTI_VALUE_TYPE(kAshInternalDisplayUIScaleChoices) |
| 1032 | }, |
[email protected] | 62018dc | 2012-12-13 00:37:35 | [diff] [blame] | 1033 | #endif // defined(OS_CHROMEOS) |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1034 | { |
[email protected] | 6247aba | 2013-03-04 22:57:18 | [diff] [blame] | 1035 | "views-textfield", |
| 1036 | IDS_FLAGS_VIEWS_TEXTFIELD_NAME, |
| 1037 | IDS_FLAGS_VIEWS_TEXTFIELD_DESCRIPTION, |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1038 | kOsWin, |
[email protected] | 6247aba | 2013-03-04 22:57:18 | [diff] [blame] | 1039 | ENABLE_DISABLE_VALUE_TYPE(switches::kEnableViewsTextfield, |
| 1040 | switches::kDisableViewsTextfield), |
[email protected] | fc7a93c | 2012-06-08 20:25:39 | [diff] [blame] | 1041 | }, |
[email protected] | bd0cd3bb | 2012-06-14 03:03:38 | [diff] [blame] | 1042 | { |
[email protected] | 2d481774 | 2012-12-17 20:16:18 | [diff] [blame] | 1043 | "enable-new-dialog-style", |
| 1044 | IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_NAME, |
| 1045 | IDS_FLAGS_ENABLE_NEW_DIALOG_STYLE_DESCRIPTION, |
[email protected] | fcb88de | 2012-07-12 22:25:32 | [diff] [blame] | 1046 | kOsWin | kOsCrOS, |
[email protected] | 2d481774 | 2012-12-17 20:16:18 | [diff] [blame] | 1047 | SINGLE_VALUE_TYPE(switches::kEnableNewDialogStyle), |
[email protected] | fcb88de | 2012-07-12 22:25:32 | [diff] [blame] | 1048 | }, |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 1049 | { "disable-accelerated-video-decode", |
| 1050 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_NAME, |
| 1051 | IDS_FLAGS_DISABLE_ACCELERATED_VIDEO_DECODE_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1052 | kOsDesktop, |
[email protected] | 7db8893a | 2012-07-26 00:49:40 | [diff] [blame] | 1053 | SINGLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), |
[email protected] | 66dcb049 | 2012-06-18 22:32:15 | [diff] [blame] | 1054 | }, |
[email protected] | 66ae9fc | 2012-06-19 21:33:52 | [diff] [blame] | 1055 | #if defined(USE_ASH) |
| 1056 | { |
| 1057 | "ash-debug-shortcuts", |
| 1058 | IDS_FLAGS_DEBUG_SHORTCUTS_NAME, |
| 1059 | IDS_FLAGS_DEBUG_SHORTCUTS_DESCRIPTION, |
| 1060 | kOsAll, |
| 1061 | SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), |
| 1062 | }, |
| 1063 | #endif |
[email protected] | 37fee094 | 2012-08-07 21:07:45 | [diff] [blame] | 1064 | { |
[email protected] | ad3f6d2 | 2012-08-29 02:34:19 | [diff] [blame] | 1065 | "enable-contacts", |
| 1066 | IDS_FLAGS_ENABLE_CONTACTS_NAME, |
| 1067 | IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION, |
| 1068 | kOsCrOS, |
| 1069 | SINGLE_VALUE_TYPE(switches::kEnableContacts) |
| 1070 | }, |
[email protected] | 1d9bb9cd | 2012-08-28 22:02:50 | [diff] [blame] | 1071 | #if defined(USE_ASH) |
| 1072 | { "ash-enable-advanced-gestures", |
| 1073 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_NAME, |
| 1074 | IDS_FLAGS_ENABLE_ADVANCED_GESTURES_DESCRIPTION, |
| 1075 | kOsCrOS, |
| 1076 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableAdvancedGestures), |
| 1077 | }, |
[email protected] | cfa24e6 | 2013-02-13 21:19:11 | [diff] [blame] | 1078 | { "ash-disable-tab-scrubbing", |
| 1079 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_NAME, |
| 1080 | IDS_FLAGS_DISABLE_TAB_SCRUBBING_DESCRIPTION, |
[email protected] | 51075f8c | 2012-11-13 01:48:16 | [diff] [blame] | 1081 | kOsCrOS, |
[email protected] | cfa24e6 | 2013-02-13 21:19:11 | [diff] [blame] | 1082 | SINGLE_VALUE_TYPE(switches::kAshDisableTabScrubbing), |
[email protected] | 51075f8c | 2012-11-13 01:48:16 | [diff] [blame] | 1083 | }, |
[email protected] | 83eef80 | 2012-12-02 07:43:52 | [diff] [blame] | 1084 | { "ash-enable-workspace-scrubbing", |
| 1085 | IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_NAME, |
| 1086 | IDS_FLAGS_ENABLE_WORKSPACE_SCRUBBING_DESCRIPTION, |
| 1087 | kOsCrOS, |
| 1088 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableWorkspaceScrubbing), |
| 1089 | }, |
[email protected] | 8c426dc | 2013-03-06 01:30:12 | [diff] [blame] | 1090 | { "ash-disable-immersive-mode", |
| 1091 | IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_NAME, |
| 1092 | IDS_FLAGS_ASH_DISABLE_IMMERSIVE_MODE_DESCRIPTION, |
[email protected] | c043df27 | 2012-11-21 00:43:24 | [diff] [blame] | 1093 | kOsCrOS, |
[email protected] | 8c426dc | 2013-03-06 01:30:12 | [diff] [blame] | 1094 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableImmersiveMode), |
[email protected] | c043df27 | 2012-11-21 00:43:24 | [diff] [blame] | 1095 | }, |
[email protected] | 316708a | 2012-11-05 22:57:02 | [diff] [blame] | 1096 | #if defined(OS_LINUX) |
| 1097 | { "ash-enable-memory-monitor", |
| 1098 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_NAME, |
| 1099 | IDS_FLAGS_ENABLE_MEMORY_MONITOR_DESCRIPTION, |
| 1100 | kOsCrOS, |
| 1101 | SINGLE_VALUE_TYPE(ash::switches::kAshEnableMemoryMonitor), |
| 1102 | }, |
| 1103 | #endif |
[email protected] | 1d9bb9cd | 2012-08-28 22:02:50 | [diff] [blame] | 1104 | #endif |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1105 | #if defined(OS_CHROMEOS) |
[email protected] | 9475ee6f | 2013-03-08 18:20:09 | [diff] [blame] | 1106 | { "ash-disable-new-network-status-area", |
| 1107 | IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_NAME, |
| 1108 | IDS_FLAGS_ASH_DISABLE_NEW_NETWORK_STATUS_AREA_DESCRIPTION, |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 1109 | kOsCrOS, |
[email protected] | 9475ee6f | 2013-03-08 18:20:09 | [diff] [blame] | 1110 | SINGLE_VALUE_TYPE(ash::switches::kAshDisableNewNetworkStatusArea), |
[email protected] | badba1ad | 2012-11-16 17:21:46 | [diff] [blame] | 1111 | }, |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1112 | { |
[email protected] | 205f0789 | 2012-10-16 20:26:22 | [diff] [blame] | 1113 | "enable-carrier-switching", |
| 1114 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING, |
| 1115 | IDS_FLAGS_ENABLE_CARRIER_SWITCHING_DESCRIPTION, |
| 1116 | kOsCrOS, |
| 1117 | SINGLE_VALUE_TYPE(switches::kEnableCarrierSwitching) |
| 1118 | }, |
| 1119 | { |
[email protected] | 9b7ab88 | 2012-09-10 23:46:36 | [diff] [blame] | 1120 | "enable-request-tablet-site", |
| 1121 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_NAME, |
| 1122 | IDS_FLAGS_ENABLE_REQUEST_TABLET_SITE_DESCRIPTION, |
| 1123 | kOsCrOS, |
| 1124 | SINGLE_VALUE_TYPE(switches::kEnableRequestTabletSite) |
| 1125 | }, |
| 1126 | #endif |
[email protected] | dab49c0b | 2012-10-04 05:55:35 | [diff] [blame] | 1127 | { |
| 1128 | "debug-packed-apps", |
| 1129 | IDS_FLAGS_DEBUG_PACKED_APP_NAME, |
| 1130 | IDS_FLAGS_DEBUG_PACKED_APP_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1131 | kOsDesktop, |
[email protected] | dab49c0b | 2012-10-04 05:55:35 | [diff] [blame] | 1132 | SINGLE_VALUE_TYPE(switches::kDebugPackedApps) |
| 1133 | }, |
[email protected] | d1459ed | 2012-10-10 01:29:33 | [diff] [blame] | 1134 | { |
| 1135 | "enable-password-generation", |
| 1136 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_NAME, |
| 1137 | IDS_FLAGS_ENABLE_PASSWORD_GENERATION_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1138 | kOsDesktop, |
[email protected] | d1459ed | 2012-10-10 01:29:33 | [diff] [blame] | 1139 | SINGLE_VALUE_TYPE(switches::kEnablePasswordGeneration) |
| 1140 | }, |
[email protected] | 26d045f | 2012-10-18 21:18:43 | [diff] [blame] | 1141 | { |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1142 | "enable-deferred-image-decoding", |
| 1143 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_NAME, |
| 1144 | IDS_FLAGS_ENABLE_DEFERRED_IMAGE_DECODING_DESCRIPTION, |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1145 | kOsMac | kOsLinux | kOsCrOS, |
[email protected] | 76f7d488 | 2012-10-26 21:09:22 | [diff] [blame] | 1146 | SINGLE_VALUE_TYPE(switches::kEnableDeferredImageDecoding) |
| 1147 | }, |
| 1148 | { |
[email protected] | 075543d | 2012-10-24 01:29:14 | [diff] [blame] | 1149 | "performance-monitor-gathering", |
| 1150 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_NAME, |
| 1151 | IDS_FLAGS_PERFORMANCE_MONITOR_GATHERING_DESCRIPTION, |
| 1152 | kOsAll, |
| 1153 | SINGLE_VALUE_TYPE(switches::kPerformanceMonitorGathering) |
| 1154 | }, |
[email protected] | 783d5bb | 2012-10-24 03:47:14 | [diff] [blame] | 1155 | { |
[email protected] | b58d5a0 | 2013-03-06 04:33:53 | [diff] [blame] | 1156 | "enable-native-autofill-ui", |
| 1157 | IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_NAME, |
| 1158 | IDS_FLAGS_ENABLE_NATIVE_AUTOFILL_UI_DESCRIPTION, |
[email protected] | f3cd680 | 2013-01-23 20:25:56 | [diff] [blame] | 1159 | kOsDesktop, |
[email protected] | b58d5a0 | 2013-03-06 04:33:53 | [diff] [blame] | 1160 | SINGLE_VALUE_TYPE(switches::kEnableNativeAutofillUi) |
[email protected] | 0572fb2e | 2012-11-03 00:38:59 | [diff] [blame] | 1161 | }, |
| 1162 | { |
[email protected] | 99002fd | 2012-11-06 04:35:52 | [diff] [blame] | 1163 | "show-app-list-shortcut", |
| 1164 | IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME, |
| 1165 | IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION, |
| 1166 | kOsWin, |
[email protected] | 7d1d209 | 2013-03-04 04:12:43 | [diff] [blame] | 1167 | SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut) |
[email protected] | 99002fd | 2012-11-06 04:35:52 | [diff] [blame] | 1168 | }, |
[email protected] | a7259fb | 2012-11-08 06:22:23 | [diff] [blame] | 1169 | { |
| 1170 | "enable-experimental-form-filling", |
| 1171 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_NAME, |
| 1172 | IDS_FLAGS_ENABLE_EXPERIMENTAL_FORM_FILLING_DESCRIPTION, |
| 1173 | kOsWin | kOsCrOS, |
| 1174 | SINGLE_VALUE_TYPE(switches::kEnableExperimentalFormFilling) |
| 1175 | }, |
[email protected] | 6e6efe4 | 2013-01-30 00:04:50 | [diff] [blame] | 1176 | { |
| 1177 | "enable-interactive-autocomplete", |
| 1178 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME, |
| 1179 | IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION, |
[email protected] | 57e67ac | 2013-02-22 03:37:22 | [diff] [blame] | 1180 | kOsWin | kOsCrOS | kOsAndroid, |
[email protected] | 6e6efe4 | 2013-01-30 00:04:50 | [diff] [blame] | 1181 | SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete) |
| 1182 | }, |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1183 | #if defined(USE_AURA) |
| 1184 | { |
[email protected] | b75ba13 | 2013-02-26 19:38:31 | [diff] [blame] | 1185 | "disable-overscroll-history-navigation", |
| 1186 | IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_NAME, |
| 1187 | IDS_FLAGS_DISABLE_OVERSCROLL_HISTORY_NAVIGATION_DESCRIPTION, |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1188 | kOsAll, |
[email protected] | b75ba13 | 2013-02-26 19:38:31 | [diff] [blame] | 1189 | SINGLE_VALUE_TYPE(switches::kDisableOverscrollHistoryNavigation) |
[email protected] | e42b1f8 | 2012-11-16 21:18:46 | [diff] [blame] | 1190 | }, |
| 1191 | #endif |
[email protected] | edbea62 | 2012-11-28 20:39:38 | [diff] [blame] | 1192 | { |
| 1193 | "enable-touch-drag-drop", |
| 1194 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_NAME, |
| 1195 | IDS_FLAGS_ENABLE_TOUCH_DRAG_DROP_DESCRIPTION, |
| 1196 | kOsWin | kOsCrOS, |
| 1197 | SINGLE_VALUE_TYPE(switches::kEnableTouchDragDrop) |
| 1198 | }, |
[email protected] | 0e2f43b6 | 2013-02-21 00:47:15 | [diff] [blame] | 1199 | { |
| 1200 | "enable-touch-editing", |
| 1201 | IDS_FLAGS_ENABLE_TOUCH_EDITING_NAME, |
| 1202 | IDS_FLAGS_ENABLE_TOUCH_EDITING_DESCRIPTION, |
| 1203 | kOsCrOS, |
| 1204 | SINGLE_VALUE_TYPE(switches::kEnableTouchEditing) |
| 1205 | }, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1206 | #if defined(ENABLE_MESSAGE_CENTER) |
[email protected] | 92e12dd9 | 2012-12-11 03:33:20 | [diff] [blame] | 1207 | { |
| 1208 | "enable-rich-notifications", |
| 1209 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_NAME, |
| 1210 | IDS_FLAGS_ENABLE_RICH_NOTIFICATIONS_DESCRIPTION, |
| 1211 | kOsWin | kOsCrOS, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1212 | SINGLE_VALUE_TYPE(message_center::switches::kEnableRichNotifications) |
[email protected] | 92e12dd9 | 2012-12-11 03:33:20 | [diff] [blame] | 1213 | }, |
[email protected] | f1c3924 | 2013-01-29 16:13:01 | [diff] [blame] | 1214 | #endif |
[email protected] | 4d51c68 | 2012-12-11 11:34:55 | [diff] [blame] | 1215 | { |
| 1216 | "full-history-sync", |
| 1217 | IDS_FLAGS_FULL_HISTORY_SYNC_NAME, |
| 1218 | IDS_FLAGS_FULL_HISTORY_SYNC_DESCRIPTION, |
| 1219 | kOsAll, |
| 1220 | SINGLE_VALUE_TYPE(switches::kHistoryEnableFullHistorySync) |
| 1221 | }, |
[email protected] | 628a69a9 | 2012-12-23 04:09:34 | [diff] [blame] | 1222 | { |
[email protected] | fd03014 | 2013-02-08 02:04:38 | [diff] [blame] | 1223 | "enable-usermedia-screen-capture", |
| 1224 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_NAME, |
| 1225 | IDS_FLAGS_ENABLE_SCREEN_CAPTURE_DESCRIPTION, |
| 1226 | kOsDesktop, |
| 1227 | SINGLE_VALUE_TYPE(switches::kEnableUserMediaScreenCapturing) |
| 1228 | }, |
[email protected] | 5b93e16 | 2013-02-19 06:33:09 | [diff] [blame] | 1229 | { |
| 1230 | "enable-apps-devtool-app", |
| 1231 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_NAME, |
| 1232 | IDS_FLAGS_ENABLE_APPS_DEVTOOL_APP_DESCRIPTION, |
| 1233 | kOsDesktop, |
| 1234 | SINGLE_VALUE_TYPE(switches::kAppsDevtool) |
| 1235 | }, |
[email protected] | 9323fdd1 | 2013-02-23 00:31:36 | [diff] [blame] | 1236 | { |
| 1237 | "impl-side-painting", |
| 1238 | IDS_FLAGS_IMPL_SIDE_PAINTING_NAME, |
| 1239 | IDS_FLAGS_IMPL_SIDE_PAINTING_DESCRIPTION, |
| 1240 | kOsAndroid, |
| 1241 | MULTI_VALUE_TYPE(kImplSidePaintingChoices) |
| 1242 | }, |
[email protected] | 2f2f72b | 2013-03-08 22:37:31 | [diff] [blame] | 1243 | // TODO(sky): ifdef needed until focus sorted out in DesktopNativeWidgetAura. |
| 1244 | #if !defined(USE_AURA) |
[email protected] | 484deaa | 2013-03-01 03:10:37 | [diff] [blame] | 1245 | { |
| 1246 | "track-active-visit-time", |
| 1247 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_NAME, |
| 1248 | IDS_FLAGS_TRACK_ACTIVE_VISIT_TIME_DESCRIPTION, |
| 1249 | kOsWin, |
| 1250 | SINGLE_VALUE_TYPE(switches::kTrackActiveVisitTime) |
| 1251 | }, |
[email protected] | 2f2f72b | 2013-03-08 22:37:31 | [diff] [blame] | 1252 | #endif |
[email protected] | 8cc71d4 | 2013-03-02 17:26:08 | [diff] [blame] | 1253 | #if defined(OS_ANDROID) |
| 1254 | { |
| 1255 | "disable-gesture-requirement-for-media-playback", |
| 1256 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME, |
| 1257 | IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_DESCRIPTION, |
| 1258 | kOsAndroid, |
| 1259 | SINGLE_VALUE_TYPE(switches::kDisableGestureRequirementForMediaPlayback) |
| 1260 | }, |
| 1261 | #endif |
[email protected] | e79f2fd5 | 2013-03-08 23:52:47 | [diff] [blame] | 1262 | #if defined(OS_CHROMEOS) |
| 1263 | { |
| 1264 | "enable-experimental-bluetooth", |
| 1265 | IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_NAME, |
| 1266 | IDS_FLAGS_ENABLE_EXPERIMENTAL_BLUETOOTH_DESCRIPTION, |
| 1267 | kOsCrOS, |
| 1268 | SINGLE_VALUE_TYPE(chromeos::switches::kEnableExperimentalBluetooth) |
| 1269 | }, |
| 1270 | #endif |
[email protected] | 6077cab | 2013-03-11 19:36:14 | [diff] [blame] | 1271 | #if defined(ENABLE_GOOGLE_NOW) |
| 1272 | { |
| 1273 | "enable-google-now", |
| 1274 | IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_NAME, |
| 1275 | IDS_FLAGS_ENABLE_GOOGLE_NOW_INTEGRATION_DESCRIPTION, |
| 1276 | kOsWin | kOsCrOS, |
| 1277 | SINGLE_VALUE_TYPE(switches::kEnableGoogleNowIntegration) |
| 1278 | }, |
| 1279 | #endif |
[email protected] | a0e4b07 | 2011-08-17 01:47:07 | [diff] [blame] | 1280 | }; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1281 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1282 | const Experiment* experiments = kExperiments; |
| 1283 | size_t num_experiments = arraysize(kExperiments); |
| 1284 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1285 | // Stores and encapsulates the little state that about:flags has. |
| 1286 | class FlagsState { |
| 1287 | public: |
| 1288 | FlagsState() : needs_restart_(false) {} |
| 1289 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line); |
| 1290 | bool IsRestartNeededToCommitChanges(); |
| 1291 | void SetExperimentEnabled( |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1292 | PrefService* prefs, const std::string& internal_name, bool enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1293 | void RemoveFlagsSwitches( |
| 1294 | std::map<std::string, CommandLine::StringType>* switch_list); |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1295 | void ResetAllFlags(PrefService* prefs); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1296 | void reset(); |
| 1297 | |
| 1298 | // Returns the singleton instance of this class |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1299 | static FlagsState* GetInstance() { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1300 | return Singleton<FlagsState>::get(); |
| 1301 | } |
| 1302 | |
| 1303 | private: |
| 1304 | bool needs_restart_; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1305 | std::map<std::string, std::string> flags_switches_; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1306 | |
| 1307 | DISALLOW_COPY_AND_ASSIGN(FlagsState); |
| 1308 | }; |
| 1309 | |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 1310 | // Extracts the list of enabled lab experiments from preferences and stores them |
[email protected] | c634337 | 2013-03-13 17:05:49 | [diff] [blame] | 1311 | // in a set. |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1312 | void GetEnabledFlags(const PrefService* prefs, std::set<std::string>* result) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1313 | const ListValue* enabled_experiments = prefs->GetList( |
| 1314 | prefs::kEnabledLabsExperiments); |
| 1315 | if (!enabled_experiments) |
| 1316 | return; |
| 1317 | |
| 1318 | for (ListValue::const_iterator it = enabled_experiments->begin(); |
| 1319 | it != enabled_experiments->end(); |
| 1320 | ++it) { |
| 1321 | std::string experiment_name; |
| 1322 | if (!(*it)->GetAsString(&experiment_name)) { |
| 1323 | LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments; |
| 1324 | continue; |
| 1325 | } |
| 1326 | result->insert(experiment_name); |
| 1327 | } |
| 1328 | } |
| 1329 | |
[email protected] | c634337 | 2013-03-13 17:05:49 | [diff] [blame] | 1330 | // Takes a set of enabled lab experiments |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1331 | void SetEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1332 | PrefService* prefs, const std::set<std::string>& enabled_experiments) { |
[email protected] | 1bc7842 | 2011-03-31 08:41:38 | [diff] [blame] | 1333 | ListPrefUpdate update(prefs, prefs::kEnabledLabsExperiments); |
| 1334 | ListValue* experiments_list = update.Get(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1335 | |
| 1336 | experiments_list->Clear(); |
| 1337 | for (std::set<std::string>::const_iterator it = enabled_experiments.begin(); |
| 1338 | it != enabled_experiments.end(); |
| 1339 | ++it) { |
| 1340 | experiments_list->Append(new StringValue(*it)); |
| 1341 | } |
| 1342 | } |
| 1343 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1344 | // Adds the internal names for the specified experiment to |names|. |
| 1345 | void AddInternalName(const Experiment& e, std::set<std::string>* names) { |
| 1346 | if (e.type == Experiment::SINGLE_VALUE) { |
| 1347 | names->insert(e.internal_name); |
| 1348 | } else { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1349 | DCHECK(e.type == Experiment::MULTI_VALUE || |
| 1350 | e.type == Experiment::ENABLE_DISABLE_VALUE); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1351 | for (int i = 0; i < e.num_choices; ++i) |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1352 | names->insert(e.NameForChoice(i)); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1353 | } |
| 1354 | } |
| 1355 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1356 | // Confirms that an experiment is valid, used in a DCHECK in |
| 1357 | // SanitizeList below. |
| 1358 | bool ValidateExperiment(const Experiment& e) { |
| 1359 | switch (e.type) { |
| 1360 | case Experiment::SINGLE_VALUE: |
| 1361 | DCHECK_EQ(0, e.num_choices); |
| 1362 | DCHECK(!e.choices); |
| 1363 | break; |
| 1364 | case Experiment::MULTI_VALUE: |
| 1365 | DCHECK_GT(e.num_choices, 0); |
| 1366 | DCHECK(e.choices); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1367 | DCHECK(e.choices[0].command_line_switch); |
| 1368 | DCHECK_EQ('\0', e.choices[0].command_line_switch[0]); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1369 | break; |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1370 | case Experiment::ENABLE_DISABLE_VALUE: |
| 1371 | DCHECK_EQ(3, e.num_choices); |
| 1372 | DCHECK(!e.choices); |
| 1373 | DCHECK(e.command_line_switch); |
| 1374 | DCHECK(e.command_line_value); |
| 1375 | DCHECK(e.disable_command_line_switch); |
| 1376 | DCHECK(e.disable_command_line_value); |
| 1377 | break; |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1378 | default: |
| 1379 | NOTREACHED(); |
| 1380 | } |
| 1381 | return true; |
| 1382 | } |
| 1383 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1384 | // Removes all experiments from prefs::kEnabledLabsExperiments that are |
| 1385 | // unknown, to prevent this list to become very long as experiments are added |
| 1386 | // and removed. |
| 1387 | void SanitizeList(PrefService* prefs) { |
| 1388 | std::set<std::string> known_experiments; |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1389 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1390 | DCHECK(ValidateExperiment(experiments[i])); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1391 | AddInternalName(experiments[i], &known_experiments); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1392 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1393 | |
| 1394 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1395 | GetEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1396 | |
| 1397 | std::set<std::string> new_enabled_experiments; |
| 1398 | std::set_intersection( |
| 1399 | known_experiments.begin(), known_experiments.end(), |
| 1400 | enabled_experiments.begin(), enabled_experiments.end(), |
| 1401 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1402 | |
[email protected] | 4c8853f | 2012-07-23 01:29:16 | [diff] [blame] | 1403 | if (new_enabled_experiments != enabled_experiments) |
| 1404 | SetEnabledFlags(prefs, new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1405 | } |
| 1406 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1407 | void GetSanitizedEnabledFlags( |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1408 | PrefService* prefs, std::set<std::string>* result) { |
| 1409 | SanitizeList(prefs); |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1410 | GetEnabledFlags(prefs, result); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1411 | } |
| 1412 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1413 | // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 1414 | // enabled on the current platform. |
| 1415 | void GetSanitizedEnabledFlagsForCurrentPlatform( |
| 1416 | PrefService* prefs, std::set<std::string>* result) { |
| 1417 | GetSanitizedEnabledFlags(prefs, result); |
| 1418 | |
| 1419 | // Filter out any experiments that aren't enabled on the current platform. We |
| 1420 | // don't remove these from prefs else syncing to a platform with a different |
| 1421 | // set of experiments would be lossy. |
| 1422 | std::set<std::string> platform_experiments; |
| 1423 | int current_platform = GetCurrentPlatform(); |
| 1424 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1425 | if (experiments[i].supported_platforms & current_platform) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1426 | AddInternalName(experiments[i], &platform_experiments); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1427 | } |
| 1428 | |
| 1429 | std::set<std::string> new_enabled_experiments; |
| 1430 | std::set_intersection( |
| 1431 | platform_experiments.begin(), platform_experiments.end(), |
| 1432 | result->begin(), result->end(), |
| 1433 | std::inserter(new_enabled_experiments, new_enabled_experiments.begin())); |
| 1434 | |
| 1435 | result->swap(new_enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1436 | } |
| 1437 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1438 | // Returns the Value representing the choice data in the specified experiment. |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1439 | Value* CreateChoiceData(const Experiment& experiment, |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1440 | const std::set<std::string>& enabled_experiments) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1441 | DCHECK(experiment.type == Experiment::MULTI_VALUE || |
| 1442 | experiment.type == Experiment::ENABLE_DISABLE_VALUE); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1443 | ListValue* result = new ListValue; |
| 1444 | for (int i = 0; i < experiment.num_choices; ++i) { |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1445 | DictionaryValue* value = new DictionaryValue; |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1446 | const std::string name = experiment.NameForChoice(i); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1447 | value->SetString("internal_name", name); |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1448 | value->SetString("description", experiment.DescriptionForChoice(i)); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1449 | value->SetBoolean("selected", enabled_experiments.count(name) > 0); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1450 | result->Append(value); |
| 1451 | } |
| 1452 | return result; |
| 1453 | } |
| 1454 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1455 | } // namespace |
| 1456 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1457 | std::string Experiment::NameForChoice(int index) const { |
| 1458 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1459 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1460 | DCHECK_LT(index, num_choices); |
| 1461 | return std::string(internal_name) + testing::kMultiSeparator + |
| 1462 | base::IntToString(index); |
| 1463 | } |
| 1464 | |
| 1465 | string16 Experiment::DescriptionForChoice(int index) const { |
| 1466 | DCHECK(type == Experiment::MULTI_VALUE || |
| 1467 | type == Experiment::ENABLE_DISABLE_VALUE); |
| 1468 | DCHECK_LT(index, num_choices); |
| 1469 | int description_id; |
| 1470 | if (type == Experiment::ENABLE_DISABLE_VALUE) { |
| 1471 | const int kEnableDisableDescriptionIds[] = { |
| 1472 | IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, |
| 1473 | IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 1474 | IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 1475 | }; |
| 1476 | description_id = kEnableDisableDescriptionIds[index]; |
| 1477 | } else { |
| 1478 | description_id = choices[index].description_id; |
| 1479 | } |
| 1480 | return l10n_util::GetStringUTF16(description_id); |
| 1481 | } |
| 1482 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1483 | void ConvertFlagsToSwitches(PrefService* prefs, CommandLine* command_line) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1484 | FlagsState::GetInstance()->ConvertFlagsToSwitches(prefs, command_line); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1485 | } |
| 1486 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1487 | ListValue* GetFlagsExperimentsData(PrefService* prefs) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1488 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1489 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1490 | |
| 1491 | int current_platform = GetCurrentPlatform(); |
| 1492 | |
| 1493 | ListValue* experiments_data = new ListValue(); |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1494 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1495 | const Experiment& experiment = experiments[i]; |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1496 | |
| 1497 | DictionaryValue* data = new DictionaryValue(); |
| 1498 | data->SetString("internal_name", experiment.internal_name); |
| 1499 | data->SetString("name", |
| 1500 | l10n_util::GetStringUTF16(experiment.visible_name_id)); |
| 1501 | data->SetString("description", |
| 1502 | l10n_util::GetStringUTF16( |
| 1503 | experiment.visible_description_id)); |
[email protected] | cc3e205 | 2011-12-20 01:01:40 | [diff] [blame] | 1504 | bool supported = !!(experiment.supported_platforms & current_platform); |
| 1505 | data->SetBoolean("supported", supported); |
| 1506 | |
| 1507 | ListValue* supported_platforms = new ListValue(); |
| 1508 | AddOsStrings(experiment.supported_platforms, supported_platforms); |
| 1509 | data->Set("supported_platforms", supported_platforms); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1510 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1511 | switch (experiment.type) { |
| 1512 | case Experiment::SINGLE_VALUE: |
| 1513 | data->SetBoolean( |
| 1514 | "enabled", |
| 1515 | enabled_experiments.count(experiment.internal_name) > 0); |
| 1516 | break; |
| 1517 | case Experiment::MULTI_VALUE: |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1518 | case Experiment::ENABLE_DISABLE_VALUE: |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1519 | data->Set("choices", CreateChoiceData(experiment, enabled_experiments)); |
| 1520 | break; |
| 1521 | default: |
| 1522 | NOTREACHED(); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1523 | } |
| 1524 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1525 | experiments_data->Append(data); |
| 1526 | } |
| 1527 | return experiments_data; |
| 1528 | } |
| 1529 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1530 | bool IsRestartNeededToCommitChanges() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1531 | return FlagsState::GetInstance()->IsRestartNeededToCommitChanges(); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1532 | } |
| 1533 | |
| 1534 | void SetExperimentEnabled( |
[email protected] | c7b7800a | 2010-10-07 18:51:35 | [diff] [blame] | 1535 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1536 | FlagsState::GetInstance()->SetExperimentEnabled(prefs, internal_name, enable); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1537 | } |
| 1538 | |
| 1539 | void RemoveFlagsSwitches( |
| 1540 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1541 | FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1542 | } |
| 1543 | |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1544 | void ResetAllFlags(PrefService* prefs) { |
| 1545 | FlagsState::GetInstance()->ResetAllFlags(prefs); |
| 1546 | } |
| 1547 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1548 | int GetCurrentPlatform() { |
| 1549 | #if defined(OS_MACOSX) |
| 1550 | return kOsMac; |
| 1551 | #elif defined(OS_WIN) |
| 1552 | return kOsWin; |
| 1553 | #elif defined(OS_CHROMEOS) // Needs to be before the OS_LINUX check. |
| 1554 | return kOsCrOS; |
[email protected] | c92f4ed | 2011-10-21 19:50:21 | [diff] [blame] | 1555 | #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1556 | return kOsLinux; |
[email protected] | 9c7453d | 2012-01-21 00:45:40 | [diff] [blame] | 1557 | #elif defined(OS_ANDROID) |
| 1558 | return kOsAndroid; |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1559 | #else |
| 1560 | #error Unknown platform |
| 1561 | #endif |
| 1562 | } |
| 1563 | |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1564 | void RecordUMAStatistics(const PrefService* prefs) { |
| 1565 | std::set<std::string> flags; |
| 1566 | GetEnabledFlags(prefs, &flags); |
| 1567 | for (std::set<std::string>::iterator it = flags.begin(); it != flags.end(); |
| 1568 | ++it) { |
| 1569 | std::string action("AboutFlags_"); |
| 1570 | action += *it; |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1571 | content::RecordComputedAction(action); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1572 | } |
| 1573 | // Since flag metrics are recorded every startup, add a tick so that the |
| 1574 | // stats can be made meaningful. |
| 1575 | if (flags.size()) |
[email protected] | 7f6f44c | 2011-12-14 13:23:38 | [diff] [blame] | 1576 | content::RecordAction(UserMetricsAction("AboutFlags_StartupTick")); |
| 1577 | content::RecordAction(UserMetricsAction("StartupTick")); |
[email protected] | 4bc5050c | 2010-11-18 17:55:54 | [diff] [blame] | 1578 | } |
| 1579 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1580 | ////////////////////////////////////////////////////////////////////////////// |
| 1581 | // FlagsState implementation. |
| 1582 | |
| 1583 | namespace { |
| 1584 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1585 | typedef std::map<std::string, std::pair<std::string, std::string> > |
| 1586 | NameToSwitchAndValueMap; |
| 1587 | |
| 1588 | void SetFlagToSwitchMapping(const std::string& key, |
| 1589 | const std::string& switch_name, |
| 1590 | const std::string& switch_value, |
| 1591 | NameToSwitchAndValueMap* name_to_switch_map) { |
| 1592 | DCHECK(name_to_switch_map->end() == name_to_switch_map->find(key)); |
| 1593 | (*name_to_switch_map)[key] = std::make_pair(switch_name, switch_value); |
| 1594 | } |
| 1595 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1596 | void FlagsState::ConvertFlagsToSwitches( |
| 1597 | PrefService* prefs, CommandLine* command_line) { |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1598 | if (command_line->HasSwitch(switches::kNoExperiments)) |
| 1599 | return; |
| 1600 | |
| 1601 | std::set<std::string> enabled_experiments; |
[email protected] | ba816424 | 2010-11-16 21:31:00 | [diff] [blame] | 1602 | |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1603 | GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1604 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1605 | NameToSwitchAndValueMap name_to_switch_map; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1606 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1607 | const Experiment& e = experiments[i]; |
| 1608 | if (e.type == Experiment::SINGLE_VALUE) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1609 | SetFlagToSwitchMapping(e.internal_name, e.command_line_switch, |
| 1610 | e.command_line_value, &name_to_switch_map); |
| 1611 | } else if (e.type == Experiment::MULTI_VALUE) { |
| 1612 | for (int j = 0; j < e.num_choices; ++j) { |
| 1613 | SetFlagToSwitchMapping(e.NameForChoice(j), |
| 1614 | e.choices[j].command_line_switch, |
| 1615 | e.choices[j].command_line_value, |
| 1616 | &name_to_switch_map); |
| 1617 | } |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1618 | } else { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1619 | DCHECK_EQ(e.type, Experiment::ENABLE_DISABLE_VALUE); |
| 1620 | SetFlagToSwitchMapping(e.NameForChoice(0), std::string(), std::string(), |
| 1621 | &name_to_switch_map); |
| 1622 | SetFlagToSwitchMapping(e.NameForChoice(1), e.command_line_switch, |
| 1623 | e.command_line_value, &name_to_switch_map); |
| 1624 | SetFlagToSwitchMapping(e.NameForChoice(2), e.disable_command_line_switch, |
| 1625 | e.disable_command_line_value, &name_to_switch_map); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1626 | } |
| 1627 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1628 | |
| 1629 | command_line->AppendSwitch(switches::kFlagSwitchesBegin); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1630 | flags_switches_.insert( |
| 1631 | std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, |
| 1632 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1633 | for (std::set<std::string>::iterator it = enabled_experiments.begin(); |
| 1634 | it != enabled_experiments.end(); |
| 1635 | ++it) { |
| 1636 | const std::string& experiment_name = *it; |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1637 | NameToSwitchAndValueMap::const_iterator name_to_switch_it = |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1638 | name_to_switch_map.find(experiment_name); |
| 1639 | if (name_to_switch_it == name_to_switch_map.end()) { |
| 1640 | NOTREACHED(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1641 | continue; |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1642 | } |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1643 | |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1644 | const std::pair<std::string, std::string>& |
| 1645 | switch_and_value_pair = name_to_switch_it->second; |
| 1646 | |
| 1647 | command_line->AppendSwitchASCII(switch_and_value_pair.first, |
| 1648 | switch_and_value_pair.second); |
| 1649 | flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1650 | } |
| 1651 | command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1652 | flags_switches_.insert( |
| 1653 | std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
| 1654 | std::string())); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1655 | } |
| 1656 | |
| 1657 | bool FlagsState::IsRestartNeededToCommitChanges() { |
| 1658 | return needs_restart_; |
| 1659 | } |
| 1660 | |
| 1661 | void FlagsState::SetExperimentEnabled( |
| 1662 | PrefService* prefs, const std::string& internal_name, bool enable) { |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1663 | needs_restart_ = true; |
| 1664 | |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1665 | size_t at_index = internal_name.find(testing::kMultiSeparator); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1666 | if (at_index != std::string::npos) { |
| 1667 | DCHECK(enable); |
| 1668 | // We're being asked to enable a multi-choice experiment. Disable the |
| 1669 | // currently selected choice. |
| 1670 | DCHECK_NE(at_index, 0u); |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1671 | const std::string experiment_name = internal_name.substr(0, at_index); |
| 1672 | SetExperimentEnabled(prefs, experiment_name, false); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1673 | |
[email protected] | 28e35af | 2011-02-09 12:56:22 | [diff] [blame] | 1674 | // And enable the new choice, if it is not the default first choice. |
| 1675 | if (internal_name != experiment_name + "@0") { |
| 1676 | std::set<std::string> enabled_experiments; |
| 1677 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
| 1678 | enabled_experiments.insert(internal_name); |
| 1679 | SetEnabledFlags(prefs, enabled_experiments); |
| 1680 | } |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1681 | return; |
| 1682 | } |
| 1683 | |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1684 | std::set<std::string> enabled_experiments; |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1685 | GetSanitizedEnabledFlags(prefs, &enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1686 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1687 | const Experiment* e = NULL; |
| 1688 | for (size_t i = 0; i < num_experiments; ++i) { |
| 1689 | if (experiments[i].internal_name == internal_name) { |
| 1690 | e = experiments + i; |
| 1691 | break; |
| 1692 | } |
| 1693 | } |
| 1694 | DCHECK(e); |
| 1695 | |
| 1696 | if (e->type == Experiment::SINGLE_VALUE) { |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1697 | if (enable) |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1698 | enabled_experiments.insert(internal_name); |
[email protected] | 8a271368 | 2011-08-19 10:36:59 | [diff] [blame] | 1699 | else |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1700 | enabled_experiments.erase(internal_name); |
| 1701 | } else { |
| 1702 | if (enable) { |
| 1703 | // Enable the first choice. |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1704 | enabled_experiments.insert(e->NameForChoice(0)); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1705 | } else { |
| 1706 | // Find the currently enabled choice and disable it. |
| 1707 | for (int i = 0; i < e->num_choices; ++i) { |
[email protected] | 83e9fa70 | 2013-02-25 19:30:44 | [diff] [blame] | 1708 | std::string choice_name = e->NameForChoice(i); |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1709 | if (enabled_experiments.find(choice_name) != |
| 1710 | enabled_experiments.end()) { |
| 1711 | enabled_experiments.erase(choice_name); |
| 1712 | // Continue on just in case there's a bug and more than one |
| 1713 | // experiment for this choice was enabled. |
| 1714 | } |
| 1715 | } |
| 1716 | } |
| 1717 | } |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1718 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1719 | SetEnabledFlags(prefs, enabled_experiments); |
[email protected] | ad2a3ded | 2010-08-27 13:19:05 | [diff] [blame] | 1720 | } |
| 1721 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1722 | void FlagsState::RemoveFlagsSwitches( |
| 1723 | std::map<std::string, CommandLine::StringType>* switch_list) { |
[email protected] | a8274453 | 2011-02-11 16:15:53 | [diff] [blame] | 1724 | for (std::map<std::string, std::string>::const_iterator |
| 1725 | it = flags_switches_.begin(); it != flags_switches_.end(); ++it) { |
| 1726 | switch_list->erase(it->first); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1727 | } |
| 1728 | } |
| 1729 | |
[email protected] | cb93bf5 | 2013-02-20 01:20:00 | [diff] [blame] | 1730 | void FlagsState::ResetAllFlags(PrefService* prefs) { |
| 1731 | needs_restart_ = true; |
| 1732 | |
| 1733 | std::set<std::string> no_experiments; |
| 1734 | SetEnabledFlags(prefs, no_experiments); |
| 1735 | } |
| 1736 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1737 | void FlagsState::reset() { |
| 1738 | needs_restart_ = false; |
| 1739 | flags_switches_.clear(); |
| 1740 | } |
| 1741 | |
[email protected] | 38e4681 | 2011-05-09 20:49:22 | [diff] [blame] | 1742 | } // namespace |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1743 | |
| 1744 | namespace testing { |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1745 | |
| 1746 | // WARNING: '@' is also used in the html file. If you update this constant you |
| 1747 | // also need to update the html file. |
| 1748 | const char kMultiSeparator[] = "@"; |
| 1749 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1750 | void ClearState() { |
[email protected] | 8e8bb6d | 2010-12-13 08:18:55 | [diff] [blame] | 1751 | FlagsState::GetInstance()->reset(); |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1752 | } |
[email protected] | a314ee5a | 2010-10-26 21:23:28 | [diff] [blame] | 1753 | |
| 1754 | void SetExperiments(const Experiment* e, size_t count) { |
| 1755 | if (!e) { |
| 1756 | experiments = kExperiments; |
| 1757 | num_experiments = arraysize(kExperiments); |
| 1758 | } else { |
| 1759 | experiments = e; |
| 1760 | num_experiments = count; |
| 1761 | } |
| 1762 | } |
| 1763 | |
[email protected] | 8a6ff28d | 2010-12-02 16:35:19 | [diff] [blame] | 1764 | const Experiment* GetExperiments(size_t* count) { |
| 1765 | *count = num_experiments; |
| 1766 | return experiments; |
| 1767 | } |
| 1768 | |
[email protected] | e2ddbc9 | 2010-10-15 20:02:07 | [diff] [blame] | 1769 | } // namespace testing |
| 1770 | |
[email protected] | 1a47d7e | 2010-10-15 00:37:24 | [diff] [blame] | 1771 | } // namespace about_flags |