feat: add tray.closeContextMenu() (#21807)
This commit is contained in:
parent
87af95be3e
commit
b90537a629
10 changed files with 45 additions and 2 deletions
|
@ -194,6 +194,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)closeContextMenu {
|
||||
if (menuController_) {
|
||||
[menuController_ cancel];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)rightMouseUp:(NSEvent*)event {
|
||||
trayIcon_->NotifyRightClicked(
|
||||
gfx::ScreenRectFromNSRect(event.window.frame),
|
||||
|
@ -315,6 +321,10 @@ void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos,
|
|||
base::Unretained(menu_model)));
|
||||
}
|
||||
|
||||
void TrayIconCocoa::CloseContextMenu() {
|
||||
[status_item_view_ closeContextMenu];
|
||||
}
|
||||
|
||||
void TrayIconCocoa::SetContextMenu(AtomMenuModel* menu_model) {
|
||||
if (menu_model) {
|
||||
// Create native menu.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue