refactor: ginify Menu (#22916)

This commit is contained in:
Jeremy Apthorp 2020-04-02 16:07:56 -07:00 committed by GitHub
parent 1d158399a6
commit 6159066c26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 241 additions and 150 deletions

View file

@ -84,8 +84,11 @@ void MenuViews::OnClosed(int32_t window_id, base::OnceClosure callback) {
}
// static
gin_helper::WrappableBase* Menu::New(gin::Arguments* args) {
return new MenuViews(args);
gin::Handle<Menu> Menu::New(gin::Arguments* args) {
auto handle = gin::CreateHandle(args->isolate(),
static_cast<Menu*>(new MenuViews(args)));
gin_helper::CallMethod(args->isolate(), handle.get(), "_init");
return handle;
}
} // namespace api