| Index: extensions/common/extension_api.cc
|
| diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc
|
| index 8430a2fb117dead341b92dc8d8790f75196aeffc..a8ff7221c609cd8aa08c15d0ead193c343052b89 100644
|
| --- a/extensions/common/extension_api.cc
|
| +++ b/extensions/common/extension_api.cc
|
| @@ -265,14 +265,17 @@ void ExtensionAPI::RegisterDependencyProvider(const std::string& name,
|
| dependency_providers_[name] = provider;
|
| }
|
|
|
| -bool ExtensionAPI::IsAnyFeatureAvailableToContext(const Feature& api,
|
| - const Extension* extension,
|
| - Feature::Context context,
|
| - const GURL& url) {
|
| +bool ExtensionAPI::IsAnyFeatureAvailableToContext(
|
| + const Feature& api,
|
| + const Extension* extension,
|
| + Feature::Context context,
|
| + Feature::SessionType session_type,
|
| + const GURL& url) {
|
| FeatureProviderMap::iterator provider = dependency_providers_.find("api");
|
| CHECK(provider != dependency_providers_.end());
|
|
|
| - if (api.IsAvailableToContext(extension, context, url).is_available())
|
| + if (api.IsAvailableToContext(extension, context, session_type, url)
|
| + .is_available())
|
| return true;
|
|
|
| // Check to see if there are any parts of this API that are allowed in this
|
| @@ -281,27 +284,33 @@ bool ExtensionAPI::IsAnyFeatureAvailableToContext(const Feature& api,
|
| for (std::vector<Feature*>::const_iterator it = features.begin();
|
| it != features.end();
|
| ++it) {
|
| - if ((*it)->IsAvailableToContext(extension, context, url).is_available())
|
| + if ((*it)
|
| + ->IsAvailableToContext(extension, context, session_type, url)
|
| + .is_available())
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| -Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name,
|
| - const Extension* extension,
|
| - Feature::Context context,
|
| - const GURL& url) {
|
| +Feature::Availability ExtensionAPI::IsAvailable(
|
| + const std::string& full_name,
|
| + const Extension* extension,
|
| + Feature::Context context,
|
| + Feature::SessionType session_type,
|
| + const GURL& url) {
|
| Feature* feature = GetFeatureDependency(full_name);
|
| if (!feature) {
|
| return Feature::Availability(Feature::NOT_PRESENT,
|
| std::string("Unknown feature: ") + full_name);
|
| }
|
| - return feature->IsAvailableToContext(extension, context, url);
|
| + return feature->IsAvailableToContext(extension, context, session_type, url);
|
| }
|
|
|
| bool ExtensionAPI::IsAvailableToWebUI(const std::string& name,
|
| + Feature::SessionType session_type,
|
| const GURL& url) {
|
| - return IsAvailable(name, NULL, Feature::WEBUI_CONTEXT, url).is_available();
|
| + return IsAvailable(name, NULL, Feature::WEBUI_CONTEXT, session_type, url)
|
| + .is_available();
|
| }
|
|
|
| const base::DictionaryValue* ExtensionAPI::GetSchema(
|
|
|