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

Unified Diff: extensions/common/extension_api.cc

Issue 109683007: Pass a Feature* to IsAnyFeatureAvailableToContext instead of a string name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update extension_api_stub.cc Created 7 years 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/extension_api.h ('k') | extensions/common/extension_api_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_api.cc
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc
index d5e96ad45cd0d6cc9f7849f9933f3399682aade6..13c1ce35ab125927111508d63d2d957b7bd727c7 100644
--- a/extensions/common/extension_api.cc
+++ b/extensions/common/extension_api.cc
@@ -276,7 +276,7 @@ void ExtensionAPI::RegisterDependencyProvider(const std::string& name,
dependency_providers_[name] = provider;
}
-bool ExtensionAPI::IsAnyFeatureAvailableToContext(const std::string& api_name,
+bool ExtensionAPI::IsAnyFeatureAvailableToContext(const Feature& api,
const Extension* extension,
Feature::Context context,
const GURL& url) {
@@ -290,12 +290,13 @@ bool ExtensionAPI::IsAnyFeatureAvailableToContext(const std::string& api_name,
for (std::vector<std::string>::const_iterator i = features.begin();
i != features.end(); ++i) {
const std::string& feature_name = *i;
- if (feature_name != api_name && feature_name.find(api_name + ".") == 0) {
+ if (feature_name != api.name() &&
+ feature_name.find(api.name() + ".") == 0) {
if (IsAvailable(feature_name, extension, context, url).is_available())
return true;
}
}
- return IsAvailable(api_name, extension, context, url).is_available();
+ return IsAvailable(api.name(), extension, context, url).is_available();
}
Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name,
« no previous file with comments | « extensions/common/extension_api.h ('k') | extensions/common/extension_api_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698