Emit("double-clicked");
}
+void Tray::OnBalloonClicked() {
+ Emit("balloon-clicked");
+}
+
void Tray::Destroy() {
tray_icon_.reset();
}
// TrayIconObserver:
void OnClicked() override;
void OnDoubleClicked() override;
+ void OnBalloonClicked() override;
void Destroy();
void SetImage(mate::Arguments* args, const gfx::ImageSkia& image);
FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnDoubleClicked());
}
+void TrayIcon::NotifyBalloonClicked() {
+ FOR_EACH_OBSERVER(TrayIconObserver, observers_, OnBalloonClicked());
+}
+
} // namespace atom
void RemoveObserver(TrayIconObserver* obs) { observers_.RemoveObserver(obs); }
void NotifyClicked();
void NotifyDoubleClicked();
+ void NotifyBalloonClicked();
protected:
TrayIcon();
public:
virtual void OnClicked() {}
virtual void OnDoubleClicked() {}
+ virtual void OnBalloonClicked() {}
protected:
virtual ~TrayIconObserver() {}
ui::MENU_SOURCE_MOUSE));
}
+void NotifyIcon::HandleBalloonClickEvent() {
+ NotifyBalloonClicked();
+}
+
void NotifyIcon::ResetIcon() {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);
// otherwise displays the context menu if there is one.
void HandleClickEvent(const gfx::Point& cursor_pos, bool left_button_click);
+ // Handles a click on the balloon from the user.
+ void HandleBalloonClickEvent();
+
// Re-creates the status tray icon now after the taskbar has been created.
void ResetIcon();
return TRUE;
switch (lparam) {
+ case TB_INDETERMINATE:
+ win_icon->HandleBalloonClickEvent();
+ return TRUE;
+
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_CONTEXTMENU: