mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* fix: backport boringssl patches for node compat * refactor: prevent node macros from overriding base (#17178) * fix: backport boring ssl patch OPENSSL_clear_free * refactor: load electron builtin modules with process._linkedBinding (#17247) * refactor: load electron builtin modules with process._linkedBinding NODE_BUILTING_MODULE_CONTEXT_AWARE and process.binding are removed in https://github.com/nodejs/node/pull/25829. This changes uses the alternative available without any functionality change. * chore: roll node * fix: add boringssl backport to support node upgrade * fix: Update node_includes.h, add DCHECK macros * fix: Update node Debug Options parser usage * fix: Fix asar setup * fix: using v8Util in isolated context * fix: make "process" available in preload scripts * fix: use proper options parser and remove setting of _breakFirstLine _breakFirstLine was being set on the process, but that has changed in node 12 and so is no longer needed. Node will handle it properly when --inspect-brk is provided * fix: process.binding => _linkedBinding in sandboxed isolated preload * chore: update node dep sha * fix: make original-fs work with streams
58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
// 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 "atom/browser/api/views/atom_api_md_text_button.h"
|
|
|
|
#include "atom/common/api/constructor.h"
|
|
#include "base/strings/utf_string_conversions.h"
|
|
#include "native_mate/dictionary.h"
|
|
|
|
#include "atom/common/node_includes.h"
|
|
|
|
namespace atom {
|
|
|
|
namespace api {
|
|
|
|
MdTextButton::MdTextButton(const std::string& text)
|
|
: LabelButton(views::MdTextButton::Create(this, base::UTF8ToUTF16(text))) {}
|
|
|
|
MdTextButton::~MdTextButton() {}
|
|
|
|
// static
|
|
mate::WrappableBase* MdTextButton::New(mate::Arguments* args,
|
|
const std::string& text) {
|
|
// Constructor call.
|
|
auto* view = new MdTextButton(text);
|
|
view->InitWith(args->isolate(), args->GetThis());
|
|
return view;
|
|
}
|
|
|
|
// static
|
|
void MdTextButton::BuildPrototype(v8::Isolate* isolate,
|
|
v8::Local<v8::FunctionTemplate> prototype) {
|
|
prototype->SetClassName(mate::StringToV8(isolate, "MdTextButton"));
|
|
}
|
|
|
|
} // namespace api
|
|
|
|
} // namespace atom
|
|
|
|
namespace {
|
|
|
|
using atom::api::MdTextButton;
|
|
|
|
void Initialize(v8::Local<v8::Object> exports,
|
|
v8::Local<v8::Value> unused,
|
|
v8::Local<v8::Context> context,
|
|
void* priv) {
|
|
v8::Isolate* isolate = context->GetIsolate();
|
|
mate::Dictionary dict(isolate, exports);
|
|
dict.Set("MdTextButton", mate::CreateConstructor<MdTextButton>(
|
|
isolate, base::Bind(&MdTextButton::New)));
|
|
}
|
|
|
|
} // namespace
|
|
|
|
NODE_LINKED_MODULE_CONTEXT_AWARE(atom_browser_md_text_button, Initialize)
|