summaryrefslogtreecommitdiffstats
path: root/extensions/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/renderer')
-rw-r--r--extensions/renderer/api_definitions_natives.cc2
-rw-r--r--extensions/renderer/dispatcher.cc7
-rw-r--r--extensions/renderer/test_features_native_handler.cc12
3 files changed, 9 insertions, 12 deletions
diff --git a/extensions/renderer/api_definitions_natives.cc b/extensions/renderer/api_definitions_natives.cc
index c0dc699..61ea710 100644
--- a/extensions/renderer/api_definitions_natives.cc
+++ b/extensions/renderer/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::GetAPIFeatures();
+ const 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/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index a3014ed..bba2087 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -73,7 +73,6 @@
#include "extensions/renderer/user_script_slave.h"
#include "extensions/renderer/utils_native_handler.h"
#include "extensions/renderer/v8_context_native_handler.h"
-#include "grit/common_resources.h"
#include "grit/renderer_resources.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
@@ -867,7 +866,8 @@ void Dispatcher::UpdateBindingsForContext(ScriptContext* context) {
case Feature::CONTENT_SCRIPT_CONTEXT: {
// Extension context; iterate through all the APIs and bind the available
// ones.
- FeatureProvider* api_feature_provider = FeatureProvider::GetAPIFeatures();
+ const FeatureProvider* api_feature_provider =
+ FeatureProvider::GetAPIFeatures();
const std::vector<std::string>& apis =
api_feature_provider->GetAllFeatureNames();
for (std::vector<std::string>::const_iterator it = apis.begin();
@@ -1187,7 +1187,8 @@ 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* api_feature_provider = FeatureProvider::GetAPIFeatures();
+ const FeatureProvider* api_feature_provider =
+ FeatureProvider::GetAPIFeatures();
std::string ancestor_name;
bool only_ancestor_available = false;
diff --git a/extensions/renderer/test_features_native_handler.cc b/extensions/renderer/test_features_native_handler.cc
index 6e0423d..c27575c 100644
--- a/extensions/renderer/test_features_native_handler.cc
+++ b/extensions/renderer/test_features_native_handler.cc
@@ -6,10 +6,9 @@
#include "base/bind.h"
#include "content/public/renderer/v8_value_converter.h"
+#include "extensions/common/extensions_client.h"
#include "extensions/common/features/json_feature_provider_source.h"
#include "extensions/renderer/script_context.h"
-#include "grit/common_resources.h"
-#include "grit/extensions_resources.h"
namespace extensions {
@@ -22,15 +21,12 @@ TestFeaturesNativeHandler::TestFeaturesNativeHandler(ScriptContext* context)
void TestFeaturesNativeHandler::GetAPIFeatures(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- JSONFeatureProviderSource source("api");
- // TODO(rockot): Only inlcude extensions features here. Chrome should add
- // its own native handler for Chrome features.
- source.LoadJSON(IDR_CHROME_EXTENSION_API_FEATURES);
- source.LoadJSON(IDR_EXTENSION_API_FEATURES);
+ scoped_ptr<JSONFeatureProviderSource> source(
+ ExtensionsClient::Get()->CreateFeatureProviderSource("api"));
scoped_ptr<content::V8ValueConverter> converter(
content::V8ValueConverter::create());
args.GetReturnValue().Set(
- converter->ToV8Value(&source.dictionary(), context()->v8_context()));
+ converter->ToV8Value(&source->dictionary(), context()->v8_context()));
}
} // namespace extensions