Initialize node in browser process.

This commit is contained in:
Cheng Zhao 2013-04-13 18:39:09 +08:00
parent e49861b45b
commit f853fc3df5
7 changed files with 90 additions and 3 deletions

View file

@ -10,15 +10,21 @@
#include "brightray/browser/default_web_contents_delegate.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "common/node_bindings.h"
namespace atom {
AtomBrowserMainParts::AtomBrowserMainParts() {
AtomBrowserMainParts::AtomBrowserMainParts()
: node_bindings_(new NodeBindings) {
}
AtomBrowserMainParts::~AtomBrowserMainParts() {
}
void AtomBrowserMainParts::PostEarlyInitialization() {
node_bindings_->Initialize();
}
void AtomBrowserMainParts::PreMainMessageLoopRun() {
brightray::BrowserMainParts::PreMainMessageLoopRun();

View file

@ -6,17 +6,24 @@
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
#include "brightray/browser/browser_main_parts.h"
#include "common/node_bindings.h"
namespace atom {
class NodeBindings;
class AtomBrowserMainParts : public brightray::BrowserMainParts {
public:
AtomBrowserMainParts();
virtual ~AtomBrowserMainParts();
protected:
virtual void PostEarlyInitialization() OVERRIDE;
virtual void PreMainMessageLoopRun() OVERRIDE;
private:
scoped_ptr<NodeBindings> node_bindings_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);
};