electron/browser/api/atom_browser_bindings.h
Cheng Zhao 409a431892 Huge commit to use new V8 and Content APIs.
Still got a lots of linking errors!
2013-12-11 15:48:19 +08:00

59 lines
1.6 KiB
C++

// 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_
#include "base/strings/string16.h"
#include "common/api/atom_bindings.h"
#include "common/v8/scoped_persistent.h"
namespace base {
class ListValue;
}
namespace IPC {
class Message;
}
namespace atom {
class NativeWindow;
class AtomBrowserBindings : public AtomBindings {
public:
AtomBrowserBindings();
virtual ~AtomBrowserBindings();
// Called when the node.js main script has been loaded.
virtual void AfterLoad();
// Called when received a message from renderer.
void OnRendererMessage(int process_id,
int routing_id,
const string16& channel,
const base::ListValue& args);
// Called when received a synchronous message from renderer.
void OnRendererMessageSync(int process_id,
int routing_id,
const string16& channel,
const base::ListValue& args,
NativeWindow* sender,
IPC::Message* message);
// The require('atom').browserMainParts object.
v8::Handle<v8::Object> browser_main_parts() {
return browser_main_parts_.NewHandle();
}
private:
ScopedPersistent<v8::Object> browser_main_parts_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserBindings);
};
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_BINDINGS_