2018-10-18 03:36:45 +00:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "native_mate/dictionary.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/api/event_emitter.h"
|
|
|
|
#include "shell/common/node_includes.h"
|
2018-10-18 03:36:45 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
v8::Local<v8::Object> CreateWithSender(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Object> sender) {
|
2019-04-02 22:38:16 +00:00
|
|
|
return mate::internal::CreateJSEvent(isolate, sender, nullptr, base::nullopt);
|
2018-10-18 03:36:45 +00:00
|
|
|
}
|
|
|
|
|
2019-07-29 20:54:37 +00:00
|
|
|
v8::Local<v8::Object> CreateEmpty(v8::Isolate* isolate) {
|
|
|
|
return mate::internal::CreateEmptyJSEvent(isolate);
|
|
|
|
}
|
|
|
|
|
2018-10-18 03:36:45 +00:00
|
|
|
void Initialize(v8::Local<v8::Object> exports,
|
|
|
|
v8::Local<v8::Value> unused,
|
|
|
|
v8::Local<v8::Context> context,
|
|
|
|
void* priv) {
|
|
|
|
mate::Dictionary dict(context->GetIsolate(), exports);
|
|
|
|
dict.SetMethod("createWithSender", &CreateWithSender);
|
2019-07-29 20:54:37 +00:00
|
|
|
dict.SetMethod("createEmpty", &CreateEmpty);
|
2018-10-18 03:36:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2019-03-08 18:29:52 +00:00
|
|
|
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_event, Initialize)
|