chore: remove native_mate (Part 3) (#20131)

* use gin converter in atom_api_menu

* please only put necessary includes in header

Having include in header means they have dependency relationship,
putting arbitrary includes really really really really really makes
refacoring much harder.

* remove some simple uses of callback_converter_deprecated.h

* use gin callback converter in file_dialog code

* use gin in ErrorThrower

* use gin in atom_bundle_mover

* fix mistake in node stream

* deprecate native_mate version of event_emitter_caller

* use gin in node_bindings

* remove usages of native_mate event_emitter_caller.h except for EventEmitter

* fix compilation on Windows

* gin::Arguments behaves differently on GetNext

* just use StringToV8
This commit is contained in:
Cheng Zhao 2019-09-06 14:52:54 +09:00 committed by GitHub
parent 7be1905023
commit 2c23e44ed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 515 additions and 323 deletions

View file

@ -8,7 +8,7 @@
#include <vector>
#include "electron/buildflags/buildflags.h"
#include "gin/converter.h"
#include "gin/dictionary.h"
#include "native_mate/handle.h"
#include "native_mate/persistent_dictionary.h"
#include "shell/browser/api/atom_api_browser_view.h"
@ -16,7 +16,8 @@
#include "shell/browser/api/atom_api_view.h"
#include "shell/browser/api/atom_api_web_contents.h"
#include "shell/common/color_util.h"
#include "shell/common/native_mate_converters/callback_converter_deprecated.h"
#include "shell/common/gin_converters/callback_converter.h"
#include "shell/common/gin_converters/image_converter.h"
#include "shell/common/native_mate_converters/file_path_converter.h"
#include "shell/common/native_mate_converters/gfx_converter.h"
#include "shell/common/native_mate_converters/image_converter.h"
@ -35,6 +36,9 @@
#include "ui/base/win/shell.h"
#endif
// TODO(zcbenz): Remove this after removing mate::ObjectTemplateBuilder.
#include "shell/common/native_mate_converters/callback_converter_deprecated.h"
#if defined(OS_WIN)
namespace mate {
@ -43,8 +47,8 @@ struct Converter<electron::TaskbarHost::ThumbarButton> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
electron::TaskbarHost::ThumbarButton* out) {
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
gin::Dictionary dict;
if (!gin::ConvertFromV8(isolate, val, &dict))
return false;
dict.Get("click", &(out->clicked_callback));
dict.Get("tooltip", &(out->tooltip));