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

Unified Diff: extensions/common/features/complex_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/complex_feature.h ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/complex_feature.cc
diff --git a/extensions/common/features/complex_feature.cc b/extensions/common/features/complex_feature.cc
index ed129da1e6413884c70e853bcb3b27c4aa4ed90b..35680d17831dd30db7671ccd34138c64ea03a7b8 100644
--- a/extensions/common/features/complex_feature.cc
+++ b/extensions/common/features/complex_feature.cc
@@ -98,6 +98,24 @@ bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const {
return false;
}
+Feature::Availability ComplexFeature::IsAvailableToChannel(
+ version_info::Channel channel) const {
+ Feature::Availability first_availability =
+ features_[0]->IsAvailableToChannel(channel);
+ if (first_availability.is_available())
+ return first_availability;
+
+ for (FeatureList::const_iterator it = features_.begin() + 1;
+ it != features_.end(); ++it) {
+ Availability availability = (*it)->IsAvailableToChannel(channel);
+ if (availability.is_available())
+ return availability;
+ }
+ // If none of the SimpleFeatures are available, we return the availability
+ // info of the first SimpleFeature that was not available.
+ return first_availability;
+}
+
bool ComplexFeature::IsInternal() const {
// Constructor verifies that composed features are consistent, thus we can
// return just the first feature's value.
« no previous file with comments | « extensions/common/features/complex_feature.h ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698