summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/extensions/api/extension_api.cc9
-rw-r--r--chrome/common/extensions/permissions/permissions_data.cc4
-rw-r--r--chrome/renderer/extensions/api_definitions_natives.cc2
-rw-r--r--chrome/renderer/extensions/dispatcher.cc14
-rw-r--r--chrome/renderer/extensions/runtime_custom_bindings.cc2
5 files changed, 14 insertions, 17 deletions
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index a609ac8..f28ab3c 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -224,12 +224,9 @@ ExtensionAPI::~ExtensionAPI() {
}
void ExtensionAPI::InitDefaultConfiguration() {
- RegisterDependencyProvider(
- "api", FeatureProvider::GetByName("api"));
- RegisterDependencyProvider(
- "manifest", FeatureProvider::GetByName("manifest"));
- RegisterDependencyProvider(
- "permission", FeatureProvider::GetByName("permission"));
+ const char* names[] = {"api", "manifest", "permission"};
+ for (size_t i = 0; i < arraysize(names); ++i)
+ RegisterDependencyProvider(names[i], FeatureProvider::GetByName(names[i]));
// Schemas to be loaded from resources.
CHECK(unloaded_schemas_.empty());
diff --git a/chrome/common/extensions/permissions/permissions_data.cc b/chrome/common/extensions/permissions/permissions_data.cc
index a05a2d8..0e8adc6 100644
--- a/chrome/common/extensions/permissions/permissions_data.cc
+++ b/chrome/common/extensions/permissions/permissions_data.cc
@@ -12,7 +12,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/features/base_feature_provider.h"
#include "chrome/common/extensions/permissions/api_permission_set.h"
#include "chrome/common/extensions/permissions/chrome_scheme_hosts.h"
#include "chrome/common/extensions/permissions/permission_set.h"
@@ -21,6 +20,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/features/feature.h"
+#include "extensions/common/features/feature_provider.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_constants.h"
@@ -119,7 +119,7 @@ bool ParseHelper(Extension* extension,
// Verify feature availability of permissions.
std::vector<APIPermission::ID> to_remove;
FeatureProvider* permission_features =
- BaseFeatureProvider::GetByName("permission");
+ FeatureProvider::GetPermissionFeatures();
for (APIPermissionSet::const_iterator iter = api_permissions->begin();
iter != api_permissions->end(); ++iter) {
Feature* feature = permission_features->GetFeature(iter->name());
diff --git a/chrome/renderer/extensions/api_definitions_natives.cc b/chrome/renderer/extensions/api_definitions_natives.cc
index 316daaa..37dc415 100644
--- a/chrome/renderer/extensions/api_definitions_natives.cc
+++ b/chrome/renderer/extensions/api_definitions_natives.cc
@@ -23,7 +23,7 @@ ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher,
void ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest(
const v8::FunctionCallbackInfo<v8::Value>& args) {
std::vector<std::string> apis;
- FeatureProvider* feature_provider = FeatureProvider::GetByName("api");
+ FeatureProvider* feature_provider = FeatureProvider::GetAPIFeatures();
const std::vector<std::string>& feature_names =
feature_provider->GetAllFeatureNames();
for (std::vector<std::string>::const_iterator i = feature_names.begin();
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;
diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
index 45663f9..ea5f5bf 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -68,7 +68,7 @@ void RuntimeCustomBindings::OpenChannelToNativeApp(
const v8::FunctionCallbackInfo<v8::Value>& args) {
// Verify that the extension has permission to use native messaging.
Feature::Availability availability =
- FeatureProvider::GetByName("permission")->
+ FeatureProvider::GetPermissionFeatures()->
GetFeature("nativeMessaging")->IsAvailableToContext(
GetExtensionForRenderView(),
context()->context_type(),