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

Unified Diff: extensions/common/features/simple_feature.cc

Issue 2705513002: Extensions: Only create Web request rules registry if Declarative Web Request is enabled. (Closed)
Patch Set: Correct comment. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/features/simple_feature.h ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/simple_feature.cc
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc
index d901cd9a70cb765eb6e0abd76ff46fab218bc7c5..0f7675b19f15c504bd5caa3c6409e6bc48fea78d 100644
--- a/extensions/common/features/simple_feature.cc
+++ b/extensions/common/features/simple_feature.cc
@@ -53,6 +53,11 @@ Feature::Availability IsAvailableToContextForBind(const Extension* extension,
return feature->IsAvailableToContext(extension, context, url, platform);
}
+Feature::Availability IsAvailableToChannelForBind(version_info::Channel channel,
+ const Feature* feature) {
+ return feature->IsAvailableToChannel(channel);
+}
+
// Gets a human-readable name for the given extension type, suitable for giving
// to developers in an error message.
std::string GetDisplayName(Manifest::Type type) {
@@ -455,6 +460,13 @@ bool SimpleFeature::IsIdInWhitelist(const std::string& extension_id) const {
return IsIdInList(extension_id, whitelist_);
}
+Feature::Availability SimpleFeature::IsAvailableToChannel(
+ version_info::Channel channel) const {
+ if (channel_ && *channel_ < channel)
+ return CreateAvailability(UNSUPPORTED_CHANNEL, *channel_);
+ return CheckDependencies(base::Bind(&IsAvailableToChannelForBind, channel));
+}
+
// static
bool SimpleFeature::IsIdInArray(const std::string& extension_id,
const char* const array[],
« no previous file with comments | « extensions/common/features/simple_feature.h ('k') | extensions/common/features/simple_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698