diff options
Diffstat (limited to 'chrome/renderer/extensions/page_capture_custom_bindings.cc')
-rw-r--r-- | chrome/renderer/extensions/page_capture_custom_bindings.cc | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/chrome/renderer/extensions/page_capture_custom_bindings.cc b/chrome/renderer/extensions/page_capture_custom_bindings.cc index e37cdab..c7e41ea 100644 --- a/chrome/renderer/extensions/page_capture_custom_bindings.cc +++ b/chrome/renderer/extensions/page_capture_custom_bindings.cc @@ -13,18 +13,15 @@ namespace extensions { -PageCaptureCustomBindings::PageCaptureCustomBindings( - int dependency_count, - const char** dependencies) - : ChromeV8Extension( - "extensions/page_capture_custom_bindings.js", - IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS, - dependency_count, - dependencies, - NULL) {} - -// Creates a Blob with the content of the specified file. -static v8::Handle<v8::Value> CreateBlob(const v8::Arguments& args) { +PageCaptureCustomBindings::PageCaptureCustomBindings() + : ChromeV8Extension(NULL) { + RouteStaticFunction("CreateBlob", &CreateBlob); + RouteStaticFunction("SendResponseAck", &SendResponseAck); +} + +// static +v8::Handle<v8::Value> PageCaptureCustomBindings::CreateBlob( + const v8::Arguments& args) { CHECK(args.Length() == 2); CHECK(args[0]->IsString()); CHECK(args[1]->IsInt32()); @@ -48,15 +45,4 @@ v8::Handle<v8::Value> PageCaptureCustomBindings::SendResponseAck( return v8::Undefined(); } -v8::Handle<v8::FunctionTemplate> PageCaptureCustomBindings::GetNativeFunction( - v8::Handle<v8::String> name) { - if (name->Equals(v8::String::New("CreateBlob"))) { - return v8::FunctionTemplate::New(CreateBlob, v8::External::New(this)); - } else if (name->Equals(v8::String::New("SendResponseAck"))) { - return v8::FunctionTemplate::New(SendResponseAck, v8::External::New(this)); - } - - return ChromeV8Extension::GetNativeFunction(name); -} - } // namespace extensions |