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

@ -177,8 +177,11 @@ void Menu::SendActionToFirstResponder(const std::string& action) {
}
// static
gin_helper::WrappableBase* Menu::New(gin::Arguments* args) {
return new MenuMac(args);
gin::Handle<Menu> Menu::New(gin::Arguments* args) {
auto handle =
gin::CreateHandle(args->isolate(), static_cast<Menu*>(new MenuMac(args)));
gin_helper::CallMethod(args->isolate(), handle.get(), "_init");
return handle;
}
} // namespace api