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

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

Issue 2494653005: Support API aliases (Closed)
Patch Set: rebase Created 4 years, 1 month 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
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..3780b7218f04a0d1c3f96c78955661a1a8a9007c 100644
--- a/extensions/common/features/complex_feature.cc
+++ b/extensions/common/features/complex_feature.cc
@@ -98,6 +98,28 @@ bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const {
return false;
}
+std::string ComplexFeature::GetAlias() const {
+ for (FeatureList::const_iterator it = features_.begin();
+ it != features_.end(); ++it) {
+ std::string alias = (*it)->GetAlias();
+ if (!alias.empty())
+ return alias;
+ }
+
+ return std::string();
+}
+
+std::string ComplexFeature::GetSource() const {
+ for (FeatureList::const_iterator it = features_.begin();
+ it != features_.end(); ++it) {
+ std::string source = (*it)->GetSource();
+ if (!source.empty())
+ return source;
+ }
+
+ return std::string();
+}
+
bool ComplexFeature::IsInternal() const {
// Constructor verifies that composed features are consistent, thus we can
// return just the first feature's value.

Powered by Google App Engine
This is Rietveld 408576698