OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 5 #ifndef EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 6 #define EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const GURL& url) const; | 132 const GURL& url) const; |
133 Availability CreateAvailability(AvailabilityResult result, | 133 Availability CreateAvailability(AvailabilityResult result, |
134 Context context) const; | 134 Context context) const; |
135 | 135 |
136 private: | 136 private: |
137 bool MatchesManifestLocation(Manifest::Location manifest_location) const; | 137 bool MatchesManifestLocation(Manifest::Location manifest_location) const; |
138 | 138 |
139 Availability CheckDependencies( | 139 Availability CheckDependencies( |
140 const base::Callback<Availability(const Feature*)>& checker) const; | 140 const base::Callback<Availability(const Feature*)>& checker) const; |
141 | 141 |
| 142 // A singleton copy of the --whitelisted-extension-id so that we don't need to |
| 143 // copy it from the CommandLine each time. |
| 144 static const std::string& whitelisted_extension_id(); |
| 145 |
142 // For clarity and consistency, we handle the default value of each of these | 146 // For clarity and consistency, we handle the default value of each of these |
143 // members the same way: it matches everything. It is up to the higher level | 147 // members the same way: it matches everything. It is up to the higher level |
144 // code that reads Features out of static data to validate that data and set | 148 // code that reads Features out of static data to validate that data and set |
145 // sensible defaults. | 149 // sensible defaults. |
146 std::set<std::string> blacklist_; | 150 std::set<std::string> blacklist_; |
147 std::set<std::string> whitelist_; | 151 std::set<std::string> whitelist_; |
148 std::set<std::string> dependencies_; | 152 std::set<std::string> dependencies_; |
149 std::set<Manifest::Type> extension_types_; | 153 std::set<Manifest::Type> extension_types_; |
150 std::set<Context> contexts_; | 154 std::set<Context> contexts_; |
151 URLPatternSet matches_; | 155 URLPatternSet matches_; |
152 Location location_; | 156 Location location_; |
153 std::set<Platform> platforms_; | 157 std::set<Platform> platforms_; |
154 int min_manifest_version_; | 158 int min_manifest_version_; |
155 int max_manifest_version_; | 159 int max_manifest_version_; |
156 bool component_extensions_auto_granted_; | 160 bool component_extensions_auto_granted_; |
157 std::string command_line_switch_; | 161 std::string command_line_switch_; |
158 | 162 |
159 ScopedVector<SimpleFeatureFilter> filters_;; | 163 ScopedVector<SimpleFeatureFilter> filters_;; |
160 | 164 |
161 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 165 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
162 }; | 166 }; |
163 | 167 |
164 } // namespace extensions | 168 } // namespace extensions |
165 | 169 |
166 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 170 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
OLD | NEW |