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. |