diff options
Diffstat (limited to 'extensions/common/features')
-rw-r--r-- | extensions/common/features/feature_provider.cc | 16 | ||||
-rw-r--r-- | extensions/common/features/feature_provider.h | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/extensions/common/features/feature_provider.cc b/extensions/common/features/feature_provider.cc index 8e15d4b..d5357f1 100644 --- a/extensions/common/features/feature_provider.cc +++ b/extensions/common/features/feature_provider.cc @@ -9,8 +9,24 @@ namespace extensions { +// static FeatureProvider* FeatureProvider::GetByName(const std::string& name) { return ExtensionsClient::Get()->GetFeatureProviderByName(name); } +// static +FeatureProvider* FeatureProvider::GetAPIFeatures() { + return GetByName("api"); +} + +// static +FeatureProvider* FeatureProvider::GetManifestFeatures() { + return GetByName("manifest"); +} + +// static +FeatureProvider* FeatureProvider::GetPermissionFeatures() { + return GetByName("permission"); +} + } // namespace extensions diff --git a/extensions/common/features/feature_provider.h b/extensions/common/features/feature_provider.h index c20e5d1..a295fe0 100644 --- a/extensions/common/features/feature_provider.h +++ b/extensions/common/features/feature_provider.h @@ -29,6 +29,11 @@ class FeatureProvider { // Gets a feature provider for a specific feature type, like "permission". static FeatureProvider* GetByName(const std::string& name); + + // Directly access the common feature types. + static FeatureProvider* GetAPIFeatures(); + static FeatureProvider* GetManifestFeatures(); + static FeatureProvider* GetPermissionFeatures(); }; } // namespace extensions |