chore: remove native_mate (Part 6) (#20391)

This commit is contained in:
Cheng Zhao 2019-10-02 09:30:55 +09:00 committed by GitHub
parent 01ed55ff02
commit 4ac4b34ae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 74 additions and 40 deletions

View file

@ -5,7 +5,6 @@
#ifndef SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_
#define SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_
#include "native_mate/handle.h"
#include "shell/browser/api/event_emitter.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_observer.h"
@ -50,7 +49,7 @@ class NativeTheme : public mate::EventEmitter<NativeTheme>,
} // namespace electron
namespace mate {
namespace gin {
template <>
struct Converter<ui::NativeTheme::ThemeSource> {
@ -61,6 +60,20 @@ struct Converter<ui::NativeTheme::ThemeSource> {
ui::NativeTheme::ThemeSource* out);
};
} // namespace mate
// TODO(zcbenz): Remove this after converting NativeTheme to gin::Wrapper.
template <>
struct Converter<electron::api::NativeTheme*> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
electron::api::NativeTheme** out) {
return mate::ConvertFromV8(isolate, val, out);
}
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
electron::api::NativeTheme* in) {
return mate::ConvertToV8(isolate, in);
}
};
} // namespace gin
#endif // SHELL_BROWSER_API_ATOM_API_NATIVE_THEME_H_