Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: extensions/common/features/simple_feature.h

Issue 1076393002: Revert of Cache --whitelisted-extension-id in SimpleFeature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
44 SimpleFeature(); 32 SimpleFeature();
45 ~SimpleFeature() override; 33 ~SimpleFeature() override;
46 34
47 // Dependency resolution is a property of Features that is preferrably 35 // Dependency resolution is a property of Features that is preferrably
48 // handled internally to avoid temptation, but FeatureFilters may need 36 // handled internally to avoid temptation, but FeatureFilters may need
49 // to know if there are any at all. 37 // to know if there are any at all.
50 bool HasDependencies() const; 38 bool HasDependencies() const;
51 39
52 // Adds a filter to this feature. The feature takes ownership of the filter. 40 // Adds a filter to this feature. The feature takes ownership of the filter.
53 void AddFilter(scoped_ptr<SimpleFeatureFilter> filter); 41 void AddFilter(scoped_ptr<SimpleFeatureFilter> filter);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 std::string command_line_switch_; 192 std::string command_line_switch_;
205 193
206 ScopedVector<SimpleFeatureFilter> filters_;; 194 ScopedVector<SimpleFeatureFilter> filters_;;
207 195
208 DISALLOW_COPY_AND_ASSIGN(SimpleFeature); 196 DISALLOW_COPY_AND_ASSIGN(SimpleFeature);
209 }; 197 };
210 198
211 } // namespace extensions 199 } // namespace extensions
212 200
213 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_ 201 #endif // EXTENSIONS_COMMON_FEATURES_SIMPLE_FEATURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698