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 23 matching lines...) Expand all Loading... |
34 switches::kErrorConsole, | 34 switches::kErrorConsole, |
35 FeatureSwitch::DEFAULT_DISABLED), | 35 FeatureSwitch::DEFAULT_DISABLED), |
36 enable_override_bookmarks_ui( | 36 enable_override_bookmarks_ui( |
37 switches::kEnableOverrideBookmarksUI, | 37 switches::kEnableOverrideBookmarksUI, |
38 FeatureSwitch::DEFAULT_DISABLED), | 38 FeatureSwitch::DEFAULT_DISABLED), |
39 extension_action_redesign( | 39 extension_action_redesign( |
40 switches::kExtensionActionRedesign, | 40 switches::kExtensionActionRedesign, |
41 FeatureSwitch::DEFAULT_DISABLED), | 41 FeatureSwitch::DEFAULT_DISABLED), |
42 scripts_require_action(switches::kScriptsRequireAction, | 42 scripts_require_action(switches::kScriptsRequireAction, |
43 FeatureSwitch::DEFAULT_DISABLED), | 43 FeatureSwitch::DEFAULT_DISABLED), |
44 embedded_extension_options( | |
45 switches::kEmbeddedExtensionOptions, | |
46 FeatureSwitch::DEFAULT_DISABLED), | |
47 app_view(switches::kAppView, | 44 app_view(switches::kAppView, |
48 FeatureSwitch::DEFAULT_DISABLED), | 45 FeatureSwitch::DEFAULT_DISABLED), |
49 mime_handler_view(switches::kMimeHandlerView, | 46 mime_handler_view(switches::kMimeHandlerView, |
50 FeatureSwitch::DEFAULT_DISABLED) {} | 47 FeatureSwitch::DEFAULT_DISABLED) {} |
51 | 48 |
52 // Enables extensions to be easily installed from sites other than the web | 49 // Enables extensions to be easily installed from sites other than the web |
53 // store. | 50 // store. |
54 FeatureSwitch easy_off_store_install; | 51 FeatureSwitch easy_off_store_install; |
55 | 52 |
56 FeatureSwitch force_dev_mode_highlighting; | 53 FeatureSwitch force_dev_mode_highlighting; |
57 | 54 |
58 // Should we prompt the user before allowing external extensions to install? | 55 // Should we prompt the user before allowing external extensions to install? |
59 // Default is yes. | 56 // Default is yes. |
60 FeatureSwitch prompt_for_external_extensions; | 57 FeatureSwitch prompt_for_external_extensions; |
61 | 58 |
62 FeatureSwitch error_console; | 59 FeatureSwitch error_console; |
63 FeatureSwitch enable_override_bookmarks_ui; | 60 FeatureSwitch enable_override_bookmarks_ui; |
64 FeatureSwitch extension_action_redesign; | 61 FeatureSwitch extension_action_redesign; |
65 FeatureSwitch scripts_require_action; | 62 FeatureSwitch scripts_require_action; |
66 FeatureSwitch embedded_extension_options; | |
67 FeatureSwitch app_view; | 63 FeatureSwitch app_view; |
68 FeatureSwitch mime_handler_view; | 64 FeatureSwitch mime_handler_view; |
69 }; | 65 }; |
70 | 66 |
71 base::LazyInstance<CommonSwitches> g_common_switches = | 67 base::LazyInstance<CommonSwitches> g_common_switches = |
72 LAZY_INSTANCE_INITIALIZER; | 68 LAZY_INSTANCE_INITIALIZER; |
73 | 69 |
74 } // namespace | 70 } // namespace |
75 | 71 |
76 FeatureSwitch* FeatureSwitch::force_dev_mode_highlighting() { | 72 FeatureSwitch* FeatureSwitch::force_dev_mode_highlighting() { |
(...skipping 10 matching lines...) Expand all Loading... |
87 } | 83 } |
88 FeatureSwitch* FeatureSwitch::enable_override_bookmarks_ui() { | 84 FeatureSwitch* FeatureSwitch::enable_override_bookmarks_ui() { |
89 return &g_common_switches.Get().enable_override_bookmarks_ui; | 85 return &g_common_switches.Get().enable_override_bookmarks_ui; |
90 } | 86 } |
91 FeatureSwitch* FeatureSwitch::extension_action_redesign() { | 87 FeatureSwitch* FeatureSwitch::extension_action_redesign() { |
92 return &g_common_switches.Get().extension_action_redesign; | 88 return &g_common_switches.Get().extension_action_redesign; |
93 } | 89 } |
94 FeatureSwitch* FeatureSwitch::scripts_require_action() { | 90 FeatureSwitch* FeatureSwitch::scripts_require_action() { |
95 return &g_common_switches.Get().scripts_require_action; | 91 return &g_common_switches.Get().scripts_require_action; |
96 } | 92 } |
97 FeatureSwitch* FeatureSwitch::embedded_extension_options() { | |
98 return &g_common_switches.Get().embedded_extension_options; | |
99 } | |
100 FeatureSwitch* FeatureSwitch::app_view() { | 93 FeatureSwitch* FeatureSwitch::app_view() { |
101 return &g_common_switches.Get().app_view; | 94 return &g_common_switches.Get().app_view; |
102 } | 95 } |
103 FeatureSwitch* FeatureSwitch::mime_handler_view() { | 96 FeatureSwitch* FeatureSwitch::mime_handler_view() { |
104 return &g_common_switches.Get().mime_handler_view; | 97 return &g_common_switches.Get().mime_handler_view; |
105 } | 98 } |
106 | 99 |
107 FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature, | 100 FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature, |
108 bool override_value) | 101 bool override_value) |
109 : feature_(feature), | 102 : feature_(feature), |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 167 |
175 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) { | 168 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) { |
176 override_value_ = override_value; | 169 override_value_ = override_value; |
177 } | 170 } |
178 | 171 |
179 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const { | 172 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const { |
180 return override_value_; | 173 return override_value_; |
181 } | 174 } |
182 | 175 |
183 } // namespace extensions | 176 } // namespace extensions |
OLD | NEW |