| Index: extensions/common/feature_switch.cc
|
| diff --git a/extensions/common/feature_switch.cc b/extensions/common/feature_switch.cc
|
| index 5d6bb6d91738840fbacec681feaf6f70426148e9..23d60d10613a32a9f5afdee6c2e3501f18f19025 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
|
| + // 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)
|
| @@ -107,6 +117,11 @@ FeatureSwitch* FeatureSwitch::scripts_require_action() {
|
| FeatureSwitch* FeatureSwitch::embedded_extension_options() {
|
| return &g_common_switches.Get().embedded_extension_options;
|
| }
|
| +#if defined(ENABLE_MEDIA_ROUTER)
|
| +FeatureSwitch* FeatureSwitch::media_router() {
|
| + return &g_common_switches.Get().media_router;
|
| +}
|
| +#endif
|
| FeatureSwitch* FeatureSwitch::trace_app_source() {
|
| return &g_common_switches.Get().trace_app_source;
|
| }
|
|
|