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

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

Issue 109683007: Pass a Feature* to IsAnyFeatureAvailableToContext instead of a string name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update extension_api_stub.cc Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « extensions/common/extension_api_stub.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_ 5 #ifndef EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_
6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_ 6 #define EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 class Feature; 13 class Feature;
14 14
15 // Implemented by classes that can vend features. 15 // Implemented by classes that can vend features.
16 class FeatureProvider { 16 class FeatureProvider {
17 public: 17 public:
18 FeatureProvider() {} 18 FeatureProvider() {}
19 virtual ~FeatureProvider() {} 19 virtual ~FeatureProvider() {}
20 20
21 // Returns the feature with the specified name. 21 // Returns the feature with the specified name.
22 virtual Feature* GetFeature(const std::string& name) = 0; 22 virtual Feature* GetFeature(const std::string& name) const = 0;
23 23
24 // Returns the parent feature of |feature|, or NULL if there isn't one. 24 // Returns the parent feature of |feature|, or NULL if there isn't one.
25 virtual Feature* GetParent(Feature* feature) = 0; 25 virtual Feature* GetParent(Feature* feature) const = 0;
26 26
27 // Returns all features described by this instance. 27 // Returns all features described by this instance.
28 virtual const std::vector<std::string>& GetAllFeatureNames() = 0; 28 virtual const std::vector<std::string>& GetAllFeatureNames() const = 0;
29 29
30 // Gets a feature provider for a specific feature type, like "permission". 30 // Gets a feature provider for a specific feature type, like "permission".
31 static FeatureProvider* GetByName(const std::string& name); 31 static FeatureProvider* GetByName(const std::string& name);
32 32
33 // Directly access the common feature types. 33 // Directly access the common feature types.
34 static FeatureProvider* GetAPIFeatures(); 34 static FeatureProvider* GetAPIFeatures();
35 static FeatureProvider* GetManifestFeatures(); 35 static FeatureProvider* GetManifestFeatures();
36 static FeatureProvider* GetPermissionFeatures(); 36 static FeatureProvider* GetPermissionFeatures();
37 }; 37 };
38 38
39 } // namespace extensions 39 } // namespace extensions
40 40
41 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_ 41 #endif // EXTENSIONS_COMMON_FEATURES_FEATURE_PROVIDER_H_
OLDNEW
« no previous file with comments | « extensions/common/extension_api_stub.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698