Renderer can now use process.send to send messages to browser.

This commit is contained in:
Cheng Zhao 2013-04-22 21:32:48 +08:00
commit 66a0abe799
17 changed files with 167 additions and 54 deletions

View file

@ -5,6 +5,7 @@
#include "browser/api/atom_browser_bindings.h"
#include "base/logging.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
#include "vendor/node/src/node.h"
#include "vendor/node/src/node_internals.h"
@ -35,4 +36,10 @@ void AtomBrowserBindings::AfterLoad() {
DCHECK(!browser_main_parts_.IsEmpty());
}
void AtomBrowserBindings::OnRendererMessage(
int routing_id, const base::ListValue& args) {
LOG(ERROR) << "OnRendererMessage routing_id:" << routing_id
<< " args:" << args;
}
} // namespace atom

View file

@ -7,6 +7,10 @@
#include "common/api/atom_bindings.h"
namespace base {
class ListValue;
}
namespace atom {
class AtomBrowserBindings : public AtomBindings {
@ -17,6 +21,9 @@ class AtomBrowserBindings : public AtomBindings {
// Called when the node.js main script has been loaded.
virtual void AfterLoad();
// Called when received a message from renderer.
void OnRendererMessage(int routing_id, const base::ListValue& args);
// The require('atom').browserMainParts object.
v8::Handle<v8::Object> browser_main_parts() {
return browser_main_parts_;