| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/feature_switch.h" | 5 #include "extensions/common/feature_switch.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 trace_app_source(switches::kTraceAppSource, | 52 trace_app_source(switches::kTraceAppSource, |
| 53 FeatureSwitch::DEFAULT_ENABLED), | 53 FeatureSwitch::DEFAULT_ENABLED), |
| 54 load_media_router_component_extension( | 54 load_media_router_component_extension( |
| 55 kLoadMediaRouterComponentExtensionFlag, | 55 kLoadMediaRouterComponentExtensionFlag, |
| 56 #if defined(GOOGLE_CHROME_BUILD) | 56 #if defined(GOOGLE_CHROME_BUILD) |
| 57 FeatureSwitch::DEFAULT_ENABLED), | 57 FeatureSwitch::DEFAULT_ENABLED), |
| 58 #else | 58 #else |
| 59 FeatureSwitch::DEFAULT_DISABLED), | 59 FeatureSwitch::DEFAULT_DISABLED), |
| 60 #endif // defined(GOOGLE_CHROME_BUILD) | 60 #endif // defined(GOOGLE_CHROME_BUILD) |
| 61 native_crx_bindings(switches::kNativeCrxBindings, | 61 native_crx_bindings(switches::kNativeCrxBindings, |
| 62 FeatureSwitch::DEFAULT_DISABLED), |
| 63 webrequest_ssl_info(switches::kWebrequestSSLInfo, |
| 62 FeatureSwitch::DEFAULT_DISABLED) { | 64 FeatureSwitch::DEFAULT_DISABLED) { |
| 63 } | 65 } |
| 64 | 66 |
| 65 // Enables extensions to be easily installed from sites other than the web | 67 // Enables extensions to be easily installed from sites other than the web |
| 66 // store. | 68 // store. |
| 67 FeatureSwitch easy_off_store_install; | 69 FeatureSwitch easy_off_store_install; |
| 68 | 70 |
| 69 FeatureSwitch force_dev_mode_highlighting; | 71 FeatureSwitch force_dev_mode_highlighting; |
| 70 | 72 |
| 71 // Should we prompt the user before allowing external extensions to install? | 73 // Should we prompt the user before allowing external extensions to install? |
| 72 // Default is yes. | 74 // Default is yes. |
| 73 FeatureSwitch prompt_for_external_extensions; | 75 FeatureSwitch prompt_for_external_extensions; |
| 74 | 76 |
| 75 FeatureSwitch error_console; | 77 FeatureSwitch error_console; |
| 76 FeatureSwitch enable_override_bookmarks_ui; | 78 FeatureSwitch enable_override_bookmarks_ui; |
| 77 FeatureSwitch extension_action_redesign; | 79 FeatureSwitch extension_action_redesign; |
| 78 FeatureSwitch scripts_require_action; | 80 FeatureSwitch scripts_require_action; |
| 79 FeatureSwitch embedded_extension_options; | 81 FeatureSwitch embedded_extension_options; |
| 80 FeatureSwitch trace_app_source; | 82 FeatureSwitch trace_app_source; |
| 81 FeatureSwitch load_media_router_component_extension; | 83 FeatureSwitch load_media_router_component_extension; |
| 82 FeatureSwitch native_crx_bindings; | 84 FeatureSwitch native_crx_bindings; |
| 85 FeatureSwitch webrequest_ssl_info; |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 base::LazyInstance<CommonSwitches> g_common_switches = | 88 base::LazyInstance<CommonSwitches> g_common_switches = |
| 86 LAZY_INSTANCE_INITIALIZER; | 89 LAZY_INSTANCE_INITIALIZER; |
| 87 | 90 |
| 88 } // namespace | 91 } // namespace |
| 89 | 92 |
| 90 FeatureSwitch* FeatureSwitch::force_dev_mode_highlighting() { | 93 FeatureSwitch* FeatureSwitch::force_dev_mode_highlighting() { |
| 91 return &g_common_switches.Get().force_dev_mode_highlighting; | 94 return &g_common_switches.Get().force_dev_mode_highlighting; |
| 92 } | 95 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 113 } | 116 } |
| 114 FeatureSwitch* FeatureSwitch::trace_app_source() { | 117 FeatureSwitch* FeatureSwitch::trace_app_source() { |
| 115 return &g_common_switches.Get().trace_app_source; | 118 return &g_common_switches.Get().trace_app_source; |
| 116 } | 119 } |
| 117 FeatureSwitch* FeatureSwitch::load_media_router_component_extension() { | 120 FeatureSwitch* FeatureSwitch::load_media_router_component_extension() { |
| 118 return &g_common_switches.Get().load_media_router_component_extension; | 121 return &g_common_switches.Get().load_media_router_component_extension; |
| 119 } | 122 } |
| 120 FeatureSwitch* FeatureSwitch::native_crx_bindings() { | 123 FeatureSwitch* FeatureSwitch::native_crx_bindings() { |
| 121 return &g_common_switches.Get().native_crx_bindings; | 124 return &g_common_switches.Get().native_crx_bindings; |
| 122 } | 125 } |
| 126 FeatureSwitch* FeatureSwitch::webrequest_ssl_info() { |
| 127 return &g_common_switches.Get().webrequest_ssl_info; |
| 128 } |
| 123 | 129 |
| 124 FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature, | 130 FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature, |
| 125 bool override_value) | 131 bool override_value) |
| 126 : feature_(feature), | 132 : feature_(feature), |
| 127 previous_value_(feature->GetOverrideValue()) { | 133 previous_value_(feature->GetOverrideValue()) { |
| 128 feature_->SetOverrideValue( | 134 feature_->SetOverrideValue( |
| 129 override_value ? OVERRIDE_ENABLED : OVERRIDE_DISABLED); | 135 override_value ? OVERRIDE_ENABLED : OVERRIDE_DISABLED); |
| 130 } | 136 } |
| 131 | 137 |
| 132 FeatureSwitch::ScopedOverride::~ScopedOverride() { | 138 FeatureSwitch::ScopedOverride::~ScopedOverride() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 218 |
| 213 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) { | 219 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) { |
| 214 override_value_ = override_value; | 220 override_value_ = override_value; |
| 215 } | 221 } |
| 216 | 222 |
| 217 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const { | 223 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const { |
| 218 return override_value_; | 224 return override_value_; |
| 219 } | 225 } |
| 220 | 226 |
| 221 } // namespace extensions | 227 } // namespace extensions |
| OLD | NEW |