diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 20:44:41 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-07 20:44:41 +0000 |
commit | 276f05aa5fc98df61d947ccaf7480bca9c021730 (patch) | |
tree | 39f71a9d3ea8be562d942b702172e5e6b6c56433 /chrome/renderer/extensions/dispatcher.cc | |
parent | c6176da0f310db393db5f02269f2e83cbe17aacf (diff) | |
download | chromium_src-276f05aa5fc98df61d947ccaf7480bca9c021730.zip chromium_src-276f05aa5fc98df61d947ccaf7480bca9c021730.tar.gz chromium_src-276f05aa5fc98df61d947ccaf7480bca9c021730.tar.bz2 |
Add FeatureProvider::GetAPIFeatures, GetManifestFeatures, and
GetPermissionFeatures as shortcuts for FeatureProvider::GetByName.
R=yoz@chromium.org
Review URL: https://codereview.chromium.org/25943002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/dispatcher.cc')
-rw-r--r-- | chrome/renderer/extensions/dispatcher.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc index c139095..822d5e5 100644 --- a/chrome/renderer/extensions/dispatcher.cc +++ b/chrome/renderer/extensions/dispatcher.cc @@ -679,13 +679,13 @@ void Dispatcher::AddOrRemoveBindingsForContext(ChromeV8Context* context) { case Feature::CONTENT_SCRIPT_CONTEXT: { // Extension context; iterate through all the APIs and bind the available // ones. - FeatureProvider* feature_provider = FeatureProvider::GetByName("api"); + FeatureProvider* api_feature_provider = FeatureProvider::GetAPIFeatures(); const std::vector<std::string>& apis = - feature_provider->GetAllFeatureNames(); + api_feature_provider->GetAllFeatureNames(); for (std::vector<std::string>::const_iterator it = apis.begin(); it != apis.end(); ++it) { const std::string& api_name = *it; - Feature* feature = feature_provider->GetFeature(api_name); + Feature* feature = api_feature_provider->GetFeature(api_name); DCHECK(feature); // Internal APIs are included via require(api_name) from internal code @@ -696,8 +696,8 @@ void Dispatcher::AddOrRemoveBindingsForContext(ChromeV8Context* context) { // If this API name has parent features, then this must be a function or // event, so we should not register. bool parent_feature_available = false; - for (Feature* parent = feature_provider->GetParent(feature); - parent != NULL; parent = feature_provider->GetParent(parent)) { + for (Feature* parent = api_feature_provider->GetParent(feature); + parent != NULL; parent = api_feature_provider->GetParent(parent)) { if (context->IsAnyFeatureAvailableToContext(parent->name())) { parent_feature_available = true; break; @@ -733,13 +733,13 @@ v8::Handle<v8::Object> Dispatcher::GetOrCreateBindObjectIfAvailable( // If app is available and app.window is not, just install app. // If app.window is available and app is not, delete app and install // app.window on a new object so app does not have to be loaded. - FeatureProvider* feature_provider = FeatureProvider::GetByName("api"); + FeatureProvider* api_feature_provider = FeatureProvider::GetAPIFeatures(); std::string ancestor_name; bool only_ancestor_available = false; for (size_t i = 0; i < split.size() - 1; ++i) { ancestor_name += (i ? ".": "") + split[i]; - if (feature_provider->GetFeature(ancestor_name) && + if (api_feature_provider->GetFeature(ancestor_name) && context->GetAvailability(ancestor_name).is_available() && !context->GetAvailability(api_name).is_available()) { only_ancestor_available = true; |