refactor: ginify Tray (#22822)

* refactor: ginify Tray

* lint

* improve argument parsing logic

* remove redundant imports from tray.js

* new Tray produces an instanceof Tray

* make Constructible generic

* lint

* clean up on exit
This commit is contained in:
Jeremy Apthorp 2020-03-29 18:32:02 -07:00 committed by GitHub
parent 76ae3b7ecb
commit a3e28788ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 380 additions and 88 deletions

View file

@ -7,6 +7,7 @@
#include <map>
#include <utility>
#include "shell/browser/api/ui_event.h"
#include "shell/browser/native_window.h"
#include "shell/common/gin_converters/accelerator_converter.h"
#include "shell/common/gin_converters/callback_converter.h"
@ -100,9 +101,7 @@ bool Menu::ShouldRegisterAcceleratorForCommandId(int command_id) const {
void Menu::ExecuteCommand(int command_id, int flags) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
execute_command_.Run(
GetWrapper(),
gin_helper::internal::CreateEventFromFlags(isolate(), flags), command_id);
execute_command_.Run(GetWrapper(), CreateEventFromFlags(flags), command_id);
}
void Menu::OnMenuWillShow(ui::SimpleMenuModel* source) {