2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-05-30 02:31:27 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "atom/browser/ui/tray_icon.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
TrayIcon::TrayIcon() {}
|
2014-05-30 02:31:27 +00:00
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
TrayIcon::~TrayIcon() {}
|
2014-05-30 02:31:27 +00:00
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
void TrayIcon::SetPressedImage(ImageType image) {}
|
2014-12-10 00:51:27 +00:00
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
void TrayIcon::SetTitle(const std::string& title) {}
|
2014-09-09 11:33:58 +00:00
|
|
|
|
2018-04-18 01:55:30 +00:00
|
|
|
void TrayIcon::SetHighlightMode(TrayIcon::HighlightMode mode) {}
|
2014-09-09 11:39:39 +00:00
|
|
|
|
2016-05-20 07:55:22 +00:00
|
|
|
void TrayIcon::DisplayBalloon(ImageType icon,
|
2014-11-28 10:30:43 +00:00
|
|
|
const base::string16& title,
|
2018-04-18 01:55:30 +00:00
|
|
|
const base::string16& contents) {}
|
2014-11-28 10:30:43 +00:00
|
|
|
|
2015-12-02 10:43:11 +00:00
|
|
|
void TrayIcon::PopUpContextMenu(const gfx::Point& pos,
|
2018-04-18 01:55:30 +00:00
|
|
|
AtomMenuModel* menu_model) {}
|
2015-07-16 02:50:53 +00:00
|
|
|
|
2016-06-21 06:40:30 +00:00
|
|
|
gfx::Rect TrayIcon::GetBounds() {
|
|
|
|
return gfx::Rect();
|
|
|
|
}
|
|
|
|
|
2017-10-05 02:49:26 +00:00
|
|
|
void TrayIcon::NotifyClicked(const gfx::Rect& bounds,
|
|
|
|
const gfx::Point& location,
|
|
|
|
int modifiers) {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-08-26 18:04:58 +00:00
|
|
|
observer.OnClicked(bounds, location, modifiers);
|
2014-06-02 03:08:29 +00:00
|
|
|
}
|
|
|
|
|
2015-07-27 10:15:51 +00:00
|
|
|
void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDoubleClicked(bounds, modifiers);
|
2014-09-09 11:45:21 +00:00
|
|
|
}
|
|
|
|
|
2014-11-28 11:42:57 +00:00
|
|
|
void TrayIcon::NotifyBalloonShow() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonShow();
|
2014-11-28 11:42:57 +00:00
|
|
|
}
|
|
|
|
|
2014-11-28 10:50:31 +00:00
|
|
|
void TrayIcon::NotifyBalloonClicked() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClicked();
|
2014-11-28 10:50:31 +00:00
|
|
|
}
|
|
|
|
|
2014-11-28 11:42:57 +00:00
|
|
|
void TrayIcon::NotifyBalloonClosed() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClosed();
|
2014-11-28 11:42:57 +00:00
|
|
|
}
|
|
|
|
|
2015-07-27 10:15:51 +00:00
|
|
|
void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnRightClicked(bounds, modifiers);
|
2015-07-15 11:23:12 +00:00
|
|
|
}
|
|
|
|
|
2015-11-10 16:02:50 +00:00
|
|
|
void TrayIcon::NotifyDrop() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDrop();
|
2015-11-10 16:02:50 +00:00
|
|
|
}
|
|
|
|
|
2015-10-18 05:32:13 +00:00
|
|
|
void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropFiles(files);
|
2015-07-19 04:12:28 +00:00
|
|
|
}
|
|
|
|
|
2016-07-14 17:21:39 +00:00
|
|
|
void TrayIcon::NotifyDropText(const std::string& text) {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropText(text);
|
2016-07-14 17:21:39 +00:00
|
|
|
}
|
|
|
|
|
2017-06-28 19:09:12 +00:00
|
|
|
void TrayIcon::NotifyMouseEntered(const gfx::Point& location, int modifiers) {
|
2017-06-14 22:00:29 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-06-28 19:09:12 +00:00
|
|
|
observer.OnMouseEntered(location, modifiers);
|
2017-06-14 22:00:29 +00:00
|
|
|
}
|
|
|
|
|
2017-06-28 19:09:12 +00:00
|
|
|
void TrayIcon::NotifyMouseExited(const gfx::Point& location, int modifiers) {
|
2017-06-14 22:00:29 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
2017-06-28 19:09:12 +00:00
|
|
|
observer.OnMouseExited(location, modifiers);
|
2017-06-14 22:00:29 +00:00
|
|
|
}
|
|
|
|
|
2017-08-26 18:04:58 +00:00
|
|
|
void TrayIcon::NotifyMouseMoved(const gfx::Point& location, int modifiers) {
|
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnMouseMoved(location, modifiers);
|
|
|
|
}
|
|
|
|
|
2015-11-06 00:45:43 +00:00
|
|
|
void TrayIcon::NotifyDragEntered() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEntered();
|
2015-11-06 00:45:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TrayIcon::NotifyDragExited() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragExited();
|
2015-11-06 00:45:43 +00:00
|
|
|
}
|
|
|
|
|
2015-11-10 16:02:50 +00:00
|
|
|
void TrayIcon::NotifyDragEnded() {
|
2017-01-24 03:34:39 +00:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEnded();
|
2015-11-10 16:02:50 +00:00
|
|
|
}
|
|
|
|
|
2014-05-30 02:31:27 +00:00
|
|
|
} // namespace atom
|