2018-10-18 05:36:45 +02: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 13:46:59 -07:00
|
|
|
#include "shell/browser/api/event_emitter.h"
|
|
|
|
#include "shell/common/node_includes.h"
|
2018-10-18 05:36:45 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
v8::Local<v8::Object> CreateWithSender(v8::Isolate* isolate,
|
|
|
|
v8::Local<v8::Object> sender) {
|
2019-04-02 15:38:16 -07:00
|
|
|
return mate::internal::CreateJSEvent(isolate, sender, nullptr, base::nullopt);
|
2018-10-18 05:36:45 +02:00
|
|
|
}
|
|
|
|
|
2019-07-29 13:54:37 -07:00
|
|
|
v8::Local<v8::Object> CreateEmpty(v8::Isolate* isolate) {
|
|
|
|
return mate::internal::CreateEmptyJSEvent(isolate);
|
|
|
|
}
|
|
|
|
|
2018-10-18 05:36:45 +02: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 13:54:37 -07:00
|
|
|
dict.SetMethod("createEmpty", &CreateEmpty);
|
2018-10-18 05:36:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2019-03-08 23:59:52 +05:30
|
|
|
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_event, Initialize)
|