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

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

Issue 265503003: Enable file_handlers and chrome.app.runtime for QuickOffice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback, less hacky Created 6 years, 7 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 ae7327cf174dcce8626c06ac4c241ac73716be8c..eeb4f776a4df21ed07a1eea2d2550a89557a036c 100644
--- a/extensions/common/features/complex_feature.cc
+++ b/extensions/common/features/complex_feature.cc
@@ -9,6 +9,7 @@ namespace extensions {
ComplexFeature::ComplexFeature(scoped_ptr<FeatureList> features) {
DCHECK_GT(features->size(), 0UL);
features_.swap(*features);
+ no_parent_ = features_[0]->no_parent();
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
// Verify GetContexts, IsInternal, & IsBlockedInServiceWorker are consistent
@@ -29,6 +30,9 @@ ComplexFeature::ComplexFeature(scoped_ptr<FeatureList> features) {
DCHECK(first_blocked_in_service_worker == (*it)->IsBlockedInServiceWorker())
<< "Complex feature must have consistent values of "
"blocked_in_service_worker across all sub features.";
+ DCHECK(no_parent_ == (*it)->no_parent())
+ << "Complex feature must have consistent values of "
+ "no_parent across all sub features.";
}
#endif
}
@@ -82,6 +86,16 @@ Feature::Availability ComplexFeature::IsAvailableToContext(
return first_availability;
}
+bool ComplexFeature::IsIdInBlacklist(const std::string& extension_id) const {
+ for (FeatureList::const_iterator it = features_.begin();
+ it != features_.end();
+ ++it) {
+ if ((*it)->IsIdInBlacklist(extension_id))
+ return true;
+ }
+ return false;
+}
+
bool ComplexFeature::IsIdInWhitelist(const std::string& extension_id) const {
for (FeatureList::const_iterator it = features_.begin();
it != features_.end();
« 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