feat: add tray.focus() (#19548)

This commit is contained in:
Milan Burda 2019-08-09 16:43:48 +02:00 committed by Shelley Vohr
parent ed3b69ffb1
commit 03debb4ef9
7 changed files with 28 additions and 0 deletions

View file

@ -176,6 +176,15 @@ void NotifyIcon::RemoveBalloon() {
LOG(WARNING) << "Unable to remove status tray balloon.";
}
void NotifyIcon::Focus() {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);
BOOL result = Shell_NotifyIcon(NIM_SETFOCUS, &icon_data);
if (!result)
LOG(WARNING) << "Unable to focus tray icon.";
}
void NotifyIcon::PopUpContextMenu(const gfx::Point& pos,
AtomMenuModel* menu_model) {
// Returns if context menu isn't set.