Use JavaScript to open the main window.
This commit is contained in:
parent
b313d94a2f
commit
60528e53ee
11 changed files with 479 additions and 25 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "browser/api/atom_bindings.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "vendor/node/src/node.h"
|
||||
#include "vendor/node/src/node_internals.h"
|
||||
|
||||
|
@ -31,6 +32,21 @@ void AtomBindings::BindTo(v8::Handle<v8::Object> process) {
|
|||
node::SetMethod(process, "atom_binding", Binding);
|
||||
}
|
||||
|
||||
void AtomBindings::AfterLoad() {
|
||||
v8::HandleScope scope;
|
||||
v8::Context::Scope context_scope(node::g_context);
|
||||
|
||||
v8::Handle<v8::Object> global = node::g_context->Global();
|
||||
v8::Handle<v8::Object> atom =
|
||||
global->Get(v8::String::New("__atom"))->ToObject();
|
||||
DCHECK(!atom.IsEmpty());
|
||||
|
||||
browser_main_parts_ = v8::Persistent<v8::Object>::New(
|
||||
node_isolate,
|
||||
atom->Get(v8::String::New("browserMainParts"))->ToObject());
|
||||
DCHECK(!browser_main_parts_.IsEmpty());
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Handle<v8::Value> AtomBindings::Binding(const v8::Arguments& args) {
|
||||
v8::HandleScope scope;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue