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

Unified Diff: chrome/renderer/render_thread.cc

Issue 159542: Add a WebKit API that registers a V8 extension to be loaded into content (Closed)
Patch Set: final Created 11 years, 5 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 | « chrome/renderer/js_only_v8_extensions.cc ('k') | chrome/renderer/user_script_slave.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 0067c65708e89c0b5c52ca98da3af05fe7616163..e9720d640e47a5a9c8fe6b20f08cd2ac1ff7d6e5 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -28,6 +28,7 @@
#include "chrome/plugin/plugin_channel_base.h"
#endif
#include "chrome/renderer/devtools_agent_filter.h"
+#include "chrome/renderer/extension_groups.h"
#include "chrome/renderer/extensions/event_bindings.h"
#include "chrome/renderer/extensions/extension_process_bindings.h"
#include "chrome/renderer/extensions/renderer_extension_bindings.h"
@@ -349,19 +350,25 @@ void RenderThread::EnsureWebKitInitialized() {
WebKit::registerExtension(extensions_v8::LoadTimesExtension::Get());
WebKit::registerExtension(extensions_v8::ExternalExtension::Get());
- WebKit::registerExtension(ExtensionProcessBindings::Get(),
- WebKit::WebString::fromUTF8(chrome::kExtensionScheme));
+ const WebKit::WebString kExtensionScheme =
+ WebKit::WebString::fromUTF8(chrome::kExtensionScheme);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ WebKit::registerExtension(ExtensionProcessBindings::Get(), kExtensionScheme);
- // TODO(aa): Add a way to restrict extensions to the content script context
- // only so that we don't have to gate these on --enable-extensions.
- if (command_line.HasSwitch(switches::kEnableExtensions)) {
- WebKit::registerExtension(BaseJsV8Extension::Get());
- WebKit::registerExtension(JsonSchemaJsV8Extension::Get());
- WebKit::registerExtension(EventBindings::Get());
- WebKit::registerExtension(RendererExtensionBindings::Get());
- }
+ WebKit::registerExtension(BaseJsV8Extension::Get(),
+ EXTENSION_GROUP_CONTENT_SCRIPTS);
+ WebKit::registerExtension(BaseJsV8Extension::Get(), kExtensionScheme);
+ WebKit::registerExtension(JsonSchemaJsV8Extension::Get(),
+ EXTENSION_GROUP_CONTENT_SCRIPTS);
+ WebKit::registerExtension(JsonSchemaJsV8Extension::Get(), kExtensionScheme);
+ WebKit::registerExtension(EventBindings::Get(),
+ EXTENSION_GROUP_CONTENT_SCRIPTS);
+ WebKit::registerExtension(EventBindings::Get(), kExtensionScheme);
+ WebKit::registerExtension(RendererExtensionBindings::Get(),
+ EXTENSION_GROUP_CONTENT_SCRIPTS);
+ WebKit::registerExtension(RendererExtensionBindings::Get(), kExtensionScheme);
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kEnableBenchmarking))
WebKit::registerExtension(extensions_v8::BenchmarkingExtension::Get());
« no previous file with comments | « chrome/renderer/js_only_v8_extensions.cc ('k') | chrome/renderer/user_script_slave.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698