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

Unified Diff: extensions/renderer/test_features_native_handler.cc

Issue 293943002: Clean up TestFeaturesNativeHandler to use the ExtensionsClient's JSON feature sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months 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/renderer/dispatcher.cc ('k') | extensions/test/test_extensions_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/test_features_native_handler.cc
diff --git a/extensions/renderer/test_features_native_handler.cc b/extensions/renderer/test_features_native_handler.cc
index 6e0423d463bf0ab531c90ecf354c5374ab206d8e..c27575ccefdd7f9691401512e48e5cff16de4509 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
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/test/test_extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698