Chromium Code Reviews| Index: extensions/common/feature_switch.cc |
| diff --git a/extensions/common/feature_switch.cc b/extensions/common/feature_switch.cc |
| index 5d6bb6d91738840fbacec681feaf6f70426148e9..282089936e3dfcdc67753549331c19d8174b8f1b 100644 |
| --- a/extensions/common/feature_switch.cc |
| +++ b/extensions/common/feature_switch.cc |
| @@ -14,6 +14,7 @@ namespace extensions { |
| namespace { |
| +const char kEnableMediaRouterExperiment[] = "EnableMediaRouter"; |
| const char kExtensionActionRedesignExperiment[] = "ExtensionActionRedesign"; |
| class CommonSwitches { |
| @@ -45,6 +46,13 @@ class CommonSwitches { |
| FeatureSwitch::DEFAULT_DISABLED), |
| embedded_extension_options(switches::kEmbeddedExtensionOptions, |
| FeatureSwitch::DEFAULT_DISABLED), |
| +#if defined(ENABLE_MEDIA_ROUTER) |
| + // The switch enable-media-router is defined in |
|
msw
2015/10/23 20:18:43
If media_router::MediaRouterEnabled simply does:
imcheng
2015/10/23 21:39:27
The flag's presence will be checked in FeatureSwit
msw
2015/10/23 22:30:49
Acknowledged.
|
| + // chrome/common/chrome_switches.cc, but we can't depend on chrome here. |
| + media_router("media-router", |
| + kEnableMediaRouterExperiment, |
| + FeatureSwitch::DEFAULT_DISABLED), |
| +#endif // defined(ENABLE_MEDIA_ROUTER) |
| trace_app_source(switches::kTraceAppSource, |
| FeatureSwitch::DEFAULT_ENABLED) { |
| } |
| @@ -65,6 +73,9 @@ class CommonSwitches { |
| FeatureSwitch extension_action_redesign_override; |
| FeatureSwitch scripts_require_action; |
| FeatureSwitch embedded_extension_options; |
| +#if defined(ENABLE_MEDIA_ROUTER) |
| + FeatureSwitch media_router; |
| +#endif |
| FeatureSwitch trace_app_source; |
| }; |
| @@ -94,8 +105,7 @@ FeatureSwitch* FeatureSwitch::extension_action_redesign() { |
| // is enabled. Should be removed when the toolbar redesign is used by default. |
| // See crbug.com/514694 |
| // TODO(kmarshall): Remove this override. |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - "enable-media-router")) { |
| + if (media_router()->IsEnabled()) { |
| return &g_common_switches.Get().extension_action_redesign_override; |
| } |
| #endif // defined(ENABLE_MEDIA_ROUTER) |
| @@ -110,6 +120,11 @@ FeatureSwitch* FeatureSwitch::embedded_extension_options() { |
| FeatureSwitch* FeatureSwitch::trace_app_source() { |
| return &g_common_switches.Get().trace_app_source; |
| } |
| +#if defined(ENABLE_MEDIA_ROUTER) |
| +FeatureSwitch* FeatureSwitch::media_router() { |
| + return &g_common_switches.Get().media_router; |
| +} |
| +#endif |
| FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature, |
| bool override_value) |