diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-09 04:36:01 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-09 04:36:01 +0000 |
commit | 7b0c3f536f8ef4c248d03084a7e4ef9747cfc8c0 (patch) | |
tree | cb4afa76ecae3987687d70062aa136801ba93318 /chrome/renderer/extensions/extension_custom_bindings.cc | |
parent | 1b9ab79cf95ef6956b56c06ba3466f4f14ee3b39 (diff) | |
download | chromium_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.cc | 24 |
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) { |