summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/extension_custom_bindings.cc
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-09 04:36:01 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-09 04:36:01 +0000
commit7b0c3f536f8ef4c248d03084a7e4ef9747cfc8c0 (patch)
treecb4afa76ecae3987687d70062aa136801ba93318 /chrome/renderer/extensions/extension_custom_bindings.cc
parent1b9ab79cf95ef6956b56c06ba3466f4f14ee3b39 (diff)
downloadchromium_src-7b0c3f536f8ef4c248d03084a7e4ef9747cfc8c0.zip
chromium_src-7b0c3f536f8ef4c248d03084a7e4ef9747cfc8c0.tar.gz
chromium_src-7b0c3f536f8ef4c248d03084a7e4ef9747cfc8c0.tar.bz2
Implement a module system for the extension bindings JS.
BUG=104100 TEST=existing browser tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125132 Review URL: http://codereview.chromium.org/9386001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/extension_custom_bindings.cc')
-rw-r--r--chrome/renderer/extensions/extension_custom_bindings.cc24
1 files changed, 4 insertions, 20 deletions
diff --git a/chrome/renderer/extensions/extension_custom_bindings.cc b/chrome/renderer/extensions/extension_custom_bindings.cc
index 6c9947c..c4895cd 100644
--- a/chrome/renderer/extensions/extension_custom_bindings.cc
+++ b/chrome/renderer/extensions/extension_custom_bindings.cc
@@ -111,15 +111,11 @@ class ExtensionViewAccumulator : public content::RenderViewVisitor {
} // namespace
ExtensionCustomBindings::ExtensionCustomBindings(
- int dependency_count,
- const char** dependencies,
ExtensionDispatcher* extension_dispatcher)
- : ChromeV8Extension(
- "extensions/extension_custom_bindings.js",
- IDR_EXTENSION_CUSTOM_BINDINGS_JS,
- dependency_count,
- dependencies,
- extension_dispatcher) {}
+ : ChromeV8Extension(extension_dispatcher) {
+ RouteStaticFunction("GetExtensionViews", &GetExtensionViews);
+ RouteStaticFunction("OpenChannelToExtension", &OpenChannelToExtension);
+}
// static
v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews(
@@ -172,18 +168,6 @@ v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews(
return accumulator.views();
}
-v8::Handle<v8::FunctionTemplate> ExtensionCustomBindings::GetNativeFunction(
- v8::Handle<v8::String> name) {
- if (name->Equals(v8::String::New("GetExtensionViews"))) {
- return v8::FunctionTemplate::New(GetExtensionViews,
- v8::External::New(this));
- } else if (name->Equals(v8::String::New("OpenChannelToExtension"))) {
- return v8::FunctionTemplate::New(OpenChannelToExtension);
- }
-
- return ChromeV8Extension::GetNativeFunction(name);
-}
-
// static
v8::Handle<v8::Value> ExtensionCustomBindings::OpenChannelToExtension(
const v8::Arguments& args) {