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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 class BaseFeatureProviderTest; | 25 class BaseFeatureProviderTest; |
26 class ExtensionAPITest; | 26 class ExtensionAPITest; |
27 class ManifestUnitTest; | 27 class ManifestUnitTest; |
28 class SimpleFeatureTest; | 28 class SimpleFeatureTest; |
29 | 29 |
30 class SimpleFeature : public Feature { | 30 class SimpleFeature : public Feature { |
31 public: | 31 public: |
| 32 // Used by tests to override the cached --whitelisted-extension-id. |
| 33 class ScopedWhitelistForTest { |
| 34 public: |
| 35 explicit ScopedWhitelistForTest(const std::string& id); |
| 36 ~ScopedWhitelistForTest(); |
| 37 |
| 38 private: |
| 39 std::string* previous_id_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(ScopedWhitelistForTest); |
| 42 }; |
| 43 |
32 SimpleFeature(); | 44 SimpleFeature(); |
33 ~SimpleFeature() override; | 45 ~SimpleFeature() override; |
34 | 46 |
35 // Dependency resolution is a property of Features that is preferrably | 47 // Dependency resolution is a property of Features that is preferrably |
36 // handled internally to avoid temptation, but FeatureFilters may need | 48 // handled internally to avoid temptation, but FeatureFilters may need |
37 // to know if there are any at all. | 49 // to know if there are any at all. |
38 bool HasDependencies() const; | 50 bool HasDependencies() const; |
39 | 51 |
40 // Adds a filter to this feature. The feature takes ownership of the filter. | 52 // Adds a filter to this feature. The feature takes ownership of the filter. |
41 void AddFilter(scoped_ptr<SimpleFeatureFilter> filter); | 53 void AddFilter(scoped_ptr<SimpleFeatureFilter> filter); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 std::string command_line_switch_; | 204 std::string command_line_switch_; |
193 | 205 |
194 ScopedVector<SimpleFeatureFilter> filters_;; | 206 ScopedVector<SimpleFeatureFilter> filters_;; |
195 | 207 |
196 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); | 208 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); |
197 }; | 209 }; |
198 | 210 |
199 } // namespace extensions | 211 } // namespace extensions |
200 | 212 |
201 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ | 213 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ |
OLD | NEW |