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

Side by Side Diff: chrome/renderer/extensions/page_capture_custom_bindings.cc

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/extensions/page_capture_custom_bindings.h" 5 #include "chrome/renderer/extensions/page_capture_custom_bindings.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/common/extensions/extension_messages.h" 8 #include "chrome/common/extensions/extension_messages.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "grit/renderer_resources.h" 10 #include "grit/renderer_resources.h"
(...skipping 30 matching lines...) Expand all
41 CHECK(args[0]->IsInt32()); 41 CHECK(args[0]->IsInt32());
42 42
43 content::RenderView* render_view = GetCurrentRenderView(); 43 content::RenderView* render_view = GetCurrentRenderView();
44 if (render_view) { 44 if (render_view) {
45 render_view->Send(new ExtensionHostMsg_ResponseAck( 45 render_view->Send(new ExtensionHostMsg_ResponseAck(
46 render_view->GetRoutingId(), args[0]->Int32Value())); 46 render_view->GetRoutingId(), args[0]->Int32Value()));
47 } 47 }
48 return v8::Undefined(); 48 return v8::Undefined();
49 } 49 }
50 50
51 v8::Handle<v8::FunctionTemplate> PageCaptureCustomBindings::GetNativeFunction( 51 void PageCaptureCustomBindings::SetNativeFunctions(
52 v8::Handle<v8::String> name) { 52 v8::Handle<v8::Object> object) {
53 if (name->Equals(v8::String::New("CreateBlob"))) { 53 RouteFunctionToStatic("CreateBlob", CreateBlob, object);
54 return v8::FunctionTemplate::New(CreateBlob, v8::External::New(this)); 54 RouteFunctionToStatic("SendResponseAck", SendResponseAck, object);
55 } else if (name->Equals(v8::String::New("SendResponseAck"))) {
56 return v8::FunctionTemplate::New(SendResponseAck, v8::External::New(this));
57 }
58
59 return ChromeV8Extension::GetNativeFunction(name);
60 } 55 }
61 56
62 } // namespace extensions 57 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698