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

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

Issue 1835863002: Added check for behavior feature existense (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: extensions/common/features/feature_provider.cc
diff --git a/extensions/common/features/feature_provider.cc b/extensions/common/features/feature_provider.cc
index e420094ae7726c7a9a2810e28c9716684bfae008..5bfa3c50cca862afedf45e36cc4a692a62d469f4 100644
--- a/extensions/common/features/feature_provider.cc
+++ b/extensions/common/features/feature_provider.cc
@@ -13,6 +13,7 @@
#include "base/trace_event/trace_event.h"
#include "content/public/common/content_switches.h"
#include "extensions/common/extensions_client.h"
+#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_util.h"
#include "extensions/common/switches.h"
@@ -117,8 +118,11 @@ const Feature* FeatureProvider::GetPermissionFeature(const std::string& name) {
}
// static
-const Feature* FeatureProvider::GetBehaviorFeature(const std::string& name) {
- return GetFeatureFromProviderByName("behavior", name);
+bool FeatureProvider::BehaviorFeatureIsAvailable(const std::string& name,
+ const Extension* extension) {
+ const Feature* behavior_feature = GetBehaviorFeatures()->GetFeature(name);
+ return behavior_feature &&
+ behavior_feature->IsAvailableToExtension(extension).is_available();
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698