Separate AtomBindings for renderer.

This commit is contained in:
Cheng Zhao 2013-04-22 16:27:34 +08:00
parent 2ba3ce740c
commit a7c3bdbf5d
8 changed files with 68 additions and 26 deletions

View file

@ -5,7 +5,6 @@
#include "common/api/atom_bindings.h"
#include "base/logging.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "vendor/node/src/node.h"
namespace atom {
@ -72,20 +71,4 @@ v8::Handle<v8::Value> AtomBindings::Binding(const v8::Arguments& args) {
v8::String::New("No such module")));
}
void AtomBindings::BindToFrame(WebKit::WebFrame* frame) {
v8::HandleScope handle_scope;
v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
if (context.IsEmpty())
return;
v8::Context::Scope scope(context);
v8::Handle<v8::Object> process =
context->Global()->Get(v8::String::New("process"))->ToObject();
DCHECK(!process.IsEmpty());
AtomBindings::BindTo(process);
}
} // namespace atom

View file

@ -23,9 +23,6 @@ class AtomBindings {
// load native code from atom-shell instead.
virtual void BindTo(v8::Handle<v8::Object> process);
// Call BindTo for process object of the frame.
void BindToFrame(WebKit::WebFrame* frame);
private:
static v8::Handle<v8::Value> Binding(const v8::Arguments& args);