2013-04-21 06:53:26 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_
|
|
|
|
#define ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_
|
|
|
|
|
2013-09-20 14:55:42 +00:00
|
|
|
#include "base/string16.h"
|
2013-04-21 06:53:26 +00:00
|
|
|
#include "common/api/atom_bindings.h"
|
|
|
|
|
2013-04-22 13:32:48 +00:00
|
|
|
namespace base {
|
|
|
|
class ListValue;
|
|
|
|
}
|
|
|
|
|
2013-09-22 01:52:58 +00:00
|
|
|
namespace IPC {
|
|
|
|
class Message;
|
|
|
|
class Sender;
|
|
|
|
}
|
|
|
|
|
2013-04-21 06:53:26 +00:00
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
class AtomBrowserBindings : public AtomBindings {
|
|
|
|
public:
|
|
|
|
AtomBrowserBindings();
|
|
|
|
virtual ~AtomBrowserBindings();
|
|
|
|
|
|
|
|
// Called when the node.js main script has been loaded.
|
|
|
|
virtual void AfterLoad();
|
|
|
|
|
2013-04-22 13:32:48 +00:00
|
|
|
// Called when received a message from renderer.
|
2013-04-23 04:18:07 +00:00
|
|
|
void OnRendererMessage(int process_id,
|
|
|
|
int routing_id,
|
2013-09-20 14:55:42 +00:00
|
|
|
const string16& channel,
|
2013-04-23 04:18:07 +00:00
|
|
|
const base::ListValue& args);
|
2013-04-22 13:32:48 +00:00
|
|
|
|
2013-04-23 13:52:19 +00:00
|
|
|
// Called when received a synchronous message from renderer.
|
|
|
|
void OnRendererMessageSync(int process_id,
|
|
|
|
int routing_id,
|
2013-09-20 14:55:42 +00:00
|
|
|
const string16& channel,
|
2013-04-23 13:52:19 +00:00
|
|
|
const base::ListValue& args,
|
2013-09-22 01:52:58 +00:00
|
|
|
IPC::Sender* sender,
|
|
|
|
IPC::Message* message);
|
2013-04-23 13:52:19 +00:00
|
|
|
|
2013-04-21 06:53:26 +00:00
|
|
|
// The require('atom').browserMainParts object.
|
|
|
|
v8::Handle<v8::Object> browser_main_parts() {
|
|
|
|
return browser_main_parts_;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
v8::Persistent<v8::Object> browser_main_parts_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomBrowserBindings);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_API_ATOM_BINDINGS_
|