Expose atom_api_renderer_ipc module API
This commit is contained in:
parent
a7b6332ed0
commit
c8629019f5
3 changed files with 39 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by the MIT license that can be
|
// Use of this source code is governed by the MIT license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include "atom/renderer/api/atom_api_renderer_ipc.h"
|
||||||
#include "atom/common/api/api_messages.h"
|
#include "atom/common/api/api_messages.h"
|
||||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||||
#include "atom/common/native_mate_converters/value_converter.h"
|
#include "atom/common/native_mate_converters/value_converter.h"
|
||||||
|
@ -15,7 +16,9 @@ using content::RenderView;
|
||||||
using blink::WebLocalFrame;
|
using blink::WebLocalFrame;
|
||||||
using blink::WebView;
|
using blink::WebView;
|
||||||
|
|
||||||
namespace {
|
namespace atom {
|
||||||
|
|
||||||
|
namespace api {
|
||||||
|
|
||||||
RenderView* GetCurrentRenderView() {
|
RenderView* GetCurrentRenderView() {
|
||||||
WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext();
|
WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext();
|
||||||
|
@ -69,6 +72,8 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
dict.SetMethod("sendSync", &SendSync);
|
dict.SetMethod("sendSync", &SendSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace api
|
||||||
|
|
||||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_ipc, Initialize)
|
} // namespace atom
|
||||||
|
|
||||||
|
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_renderer_ipc, atom::api::Initialize)
|
||||||
|
|
30
atom/renderer/api/atom_api_renderer_ipc.h
Normal file
30
atom/renderer/api/atom_api_renderer_ipc.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright (c) 2016 GitHub, Inc.
|
||||||
|
// Use of this source code is governed by the MIT license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_
|
||||||
|
#define ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_
|
||||||
|
|
||||||
|
#include "base/values.h"
|
||||||
|
#include "native_mate/arguments.h"
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
namespace api {
|
||||||
|
|
||||||
|
void Send(mate::Arguments* args,
|
||||||
|
const base::string16& channel,
|
||||||
|
const base::ListValue& arguments);
|
||||||
|
|
||||||
|
base::string16 SendSync(mate::Arguments* args,
|
||||||
|
const base::string16& channel,
|
||||||
|
const base::ListValue& arguments);
|
||||||
|
|
||||||
|
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||||
|
v8::Local<v8::Context> context, void* priv);
|
||||||
|
|
||||||
|
} // namespace api
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_RENDERER_API_ATOM_API_RENDERER_IPC_H_
|
|
@ -424,6 +424,7 @@
|
||||||
'atom/common/platform_util_linux.cc',
|
'atom/common/platform_util_linux.cc',
|
||||||
'atom/common/platform_util_mac.mm',
|
'atom/common/platform_util_mac.mm',
|
||||||
'atom/common/platform_util_win.cc',
|
'atom/common/platform_util_win.cc',
|
||||||
|
'atom/renderer/api/atom_api_renderer_ipc.h',
|
||||||
'atom/renderer/api/atom_api_renderer_ipc.cc',
|
'atom/renderer/api/atom_api_renderer_ipc.cc',
|
||||||
'atom/renderer/api/atom_api_spell_check_client.cc',
|
'atom/renderer/api/atom_api_spell_check_client.cc',
|
||||||
'atom/renderer/api/atom_api_spell_check_client.h',
|
'atom/renderer/api/atom_api_spell_check_client.h',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue