2014-10-31 12:17:05 -06:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-05-29 20:31:27 -06:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 14:46:59 -06:00
|
|
|
#include "shell/browser/ui/tray_icon.h"
|
2014-05-29 20:31:27 -06:00
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
namespace electron {
|
2014-05-29 20:31:27 -06:00
|
|
|
|
2019-08-08 15:43:33 -06:00
|
|
|
TrayIcon::BalloonOptions::BalloonOptions() = default;
|
|
|
|
|
2019-09-16 16:12:00 -06:00
|
|
|
TrayIcon::TrayIcon() = default;
|
2014-05-29 20:31:27 -06:00
|
|
|
|
2019-09-16 16:12:00 -06:00
|
|
|
TrayIcon::~TrayIcon() = default;
|
2014-05-29 20:31:27 -06:00
|
|
|
|
2018-04-17 19:55:30 -06:00
|
|
|
void TrayIcon::SetPressedImage(ImageType image) {}
|
2014-12-09 17:51:27 -07:00
|
|
|
|
2019-08-08 15:43:33 -06:00
|
|
|
void TrayIcon::DisplayBalloon(const BalloonOptions& options) {}
|
2014-11-28 03:30:43 -07:00
|
|
|
|
2019-08-05 09:52:47 -06:00
|
|
|
void TrayIcon::RemoveBalloon() {}
|
|
|
|
|
2019-08-09 08:43:48 -06:00
|
|
|
void TrayIcon::Focus() {}
|
|
|
|
|
2015-12-02 03:43:11 -07:00
|
|
|
void TrayIcon::PopUpContextMenu(const gfx::Point& pos,
|
2023-08-01 00:07:30 -06:00
|
|
|
base::WeakPtr<ElectronMenuModel> menu_model) {}
|
2015-07-15 20:50:53 -06:00
|
|
|
|
2020-01-22 16:25:17 -07:00
|
|
|
void TrayIcon::CloseContextMenu() {}
|
|
|
|
|
2016-06-21 00:40:30 -06:00
|
|
|
gfx::Rect TrayIcon::GetBounds() {
|
|
|
|
return gfx::Rect();
|
|
|
|
}
|
|
|
|
|
2017-10-04 20:49:26 -06:00
|
|
|
void TrayIcon::NotifyClicked(const gfx::Rect& bounds,
|
|
|
|
const gfx::Point& location,
|
|
|
|
int modifiers) {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-08-26 12:04:58 -06:00
|
|
|
observer.OnClicked(bounds, location, modifiers);
|
2014-06-01 21:08:29 -06:00
|
|
|
}
|
|
|
|
|
2015-07-27 04:15:51 -06:00
|
|
|
void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDoubleClicked(bounds, modifiers);
|
2014-09-09 05:45:21 -06:00
|
|
|
}
|
|
|
|
|
2023-09-27 12:21:15 -06:00
|
|
|
void TrayIcon::NotifyMiddleClicked(const gfx::Rect& bounds, int modifiers) {
|
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnMiddleClicked(bounds, modifiers);
|
|
|
|
}
|
|
|
|
|
2014-11-28 04:42:57 -07:00
|
|
|
void TrayIcon::NotifyBalloonShow() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonShow();
|
2014-11-28 04:42:57 -07:00
|
|
|
}
|
|
|
|
|
2014-11-28 03:50:31 -07:00
|
|
|
void TrayIcon::NotifyBalloonClicked() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClicked();
|
2014-11-28 03:50:31 -07:00
|
|
|
}
|
|
|
|
|
2014-11-28 04:42:57 -07:00
|
|
|
void TrayIcon::NotifyBalloonClosed() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClosed();
|
2014-11-28 04:42:57 -07:00
|
|
|
}
|
|
|
|
|
2015-07-27 04:15:51 -06:00
|
|
|
void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnRightClicked(bounds, modifiers);
|
2015-07-15 05:23:12 -06:00
|
|
|
}
|
|
|
|
|
2015-11-10 09:02:50 -07:00
|
|
|
void TrayIcon::NotifyDrop() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDrop();
|
2015-11-10 09:02:50 -07:00
|
|
|
}
|
|
|
|
|
2015-10-17 23:32:13 -06:00
|
|
|
void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropFiles(files);
|
2015-07-18 22:12:28 -06:00
|
|
|
}
|
|
|
|
|
2016-07-14 11:21:39 -06:00
|
|
|
void TrayIcon::NotifyDropText(const std::string& text) {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropText(text);
|
2016-07-14 11:21:39 -06:00
|
|
|
}
|
|
|
|
|
2020-01-17 09:28:34 -07:00
|
|
|
void TrayIcon::NotifyMouseUp(const gfx::Point& location, int modifiers) {
|
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnMouseUp(location, modifiers);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TrayIcon::NotifyMouseDown(const gfx::Point& location, int modifiers) {
|
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnMouseDown(location, modifiers);
|
|
|
|
}
|
|
|
|
|
2017-06-28 13:09:12 -06:00
|
|
|
void TrayIcon::NotifyMouseEntered(const gfx::Point& location, int modifiers) {
|
2017-06-14 16:00:29 -06:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-06-28 13:09:12 -06:00
|
|
|
observer.OnMouseEntered(location, modifiers);
|
2017-06-14 16:00:29 -06:00
|
|
|
}
|
|
|
|
|
2017-06-28 13:09:12 -06:00
|
|
|
void TrayIcon::NotifyMouseExited(const gfx::Point& location, int modifiers) {
|
2017-06-14 16:00:29 -06:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-06-28 13:09:12 -06:00
|
|
|
observer.OnMouseExited(location, modifiers);
|
2017-06-14 16:00:29 -06:00
|
|
|
}
|
|
|
|
|
2017-08-26 12:04:58 -06:00
|
|
|
void TrayIcon::NotifyMouseMoved(const gfx::Point& location, int modifiers) {
|
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnMouseMoved(location, modifiers);
|
|
|
|
}
|
|
|
|
|
2015-11-05 17:45:43 -07:00
|
|
|
void TrayIcon::NotifyDragEntered() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEntered();
|
2015-11-05 17:45:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void TrayIcon::NotifyDragExited() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragExited();
|
2015-11-05 17:45:43 -07:00
|
|
|
}
|
|
|
|
|
2015-11-10 09:02:50 -07:00
|
|
|
void TrayIcon::NotifyDragEnded() {
|
2017-01-23 20:34:39 -07:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEnded();
|
2015-11-10 09:02:50 -07:00
|
|
|
}
|
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
} // namespace electron
|