2014-10-31 11:17:05 -07:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-05-30 10:31:27 +08: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 {
|
|
|
|
|
2014-05-30 14:37:53 +08:00
|
|
|
TrayIcon::TrayIcon() {
|
2014-05-30 10:31:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TrayIcon::~TrayIcon() {
|
|
|
|
}
|
|
|
|
|
2016-05-20 16:55:22 +09:00
|
|
|
void TrayIcon::SetPressedImage(ImageType image) {
|
2014-12-09 16:51:27 -08:00
|
|
|
}
|
|
|
|
|
2014-09-09 19:33:58 +08:00
|
|
|
void TrayIcon::SetTitle(const std::string& title) {
|
|
|
|
}
|
|
|
|
|
2016-07-26 13:51:43 -07:00
|
|
|
void TrayIcon::SetHighlightMode(TrayIcon::HighlightMode mode) {
|
2014-09-09 19:39:39 +08:00
|
|
|
}
|
|
|
|
|
2016-05-20 16:55:22 +09:00
|
|
|
void TrayIcon::DisplayBalloon(ImageType icon,
|
2014-11-28 18:30:43 +08:00
|
|
|
const base::string16& title,
|
|
|
|
const base::string16& contents) {
|
|
|
|
}
|
|
|
|
|
2015-12-02 18:43:11 +08:00
|
|
|
void TrayIcon::PopUpContextMenu(const gfx::Point& pos,
|
2016-07-02 11:47:40 +09:00
|
|
|
AtomMenuModel* menu_model) {
|
2015-07-16 10:50:53 +08:00
|
|
|
}
|
|
|
|
|
2016-06-21 15:40:30 +09:00
|
|
|
gfx::Rect TrayIcon::GetBounds() {
|
|
|
|
return gfx::Rect();
|
|
|
|
}
|
|
|
|
|
2015-07-27 03:15:51 -07:00
|
|
|
void TrayIcon::NotifyClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnClicked(bounds, modifiers);
|
2014-06-02 11:08:29 +08:00
|
|
|
}
|
|
|
|
|
2015-07-27 03:15:51 -07:00
|
|
|
void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDoubleClicked(bounds, modifiers);
|
2014-09-09 19:45:21 +08:00
|
|
|
}
|
|
|
|
|
2014-11-28 19:42:57 +08:00
|
|
|
void TrayIcon::NotifyBalloonShow() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonShow();
|
2014-11-28 19:42:57 +08:00
|
|
|
}
|
|
|
|
|
2014-11-28 18:50:31 +08:00
|
|
|
void TrayIcon::NotifyBalloonClicked() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClicked();
|
2014-11-28 18:50:31 +08:00
|
|
|
}
|
|
|
|
|
2014-11-28 19:42:57 +08:00
|
|
|
void TrayIcon::NotifyBalloonClosed() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnBalloonClosed();
|
2014-11-28 19:42:57 +08:00
|
|
|
}
|
|
|
|
|
2015-07-27 03:15:51 -07:00
|
|
|
void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnRightClicked(bounds, modifiers);
|
2015-07-15 19:23:12 +08:00
|
|
|
}
|
|
|
|
|
2015-11-10 10:02:50 -06:00
|
|
|
void TrayIcon::NotifyDrop() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDrop();
|
2015-11-10 10:02:50 -06:00
|
|
|
}
|
|
|
|
|
2015-10-18 00:32:13 -05:00
|
|
|
void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropFiles(files);
|
2015-07-19 12:12:28 +08:00
|
|
|
}
|
|
|
|
|
2016-07-14 18:21:39 +01:00
|
|
|
void TrayIcon::NotifyDropText(const std::string& text) {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDropText(text);
|
2016-07-14 18:21:39 +01:00
|
|
|
}
|
|
|
|
|
2015-11-05 18:45:43 -06:00
|
|
|
void TrayIcon::NotifyDragEntered() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEntered();
|
2015-11-05 18:45:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
void TrayIcon::NotifyDragExited() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragExited();
|
2015-11-05 18:45:43 -06:00
|
|
|
}
|
|
|
|
|
2015-11-10 10:02:50 -06:00
|
|
|
void TrayIcon::NotifyDragEnded() {
|
2017-01-24 12:34:39 +09:00
|
|
|
for (TrayIconObserver& observer : observers_)
|
|
|
|
observer.OnDragEnded();
|
2015-11-10 10:02:50 -06:00
|
|
|
}
|
|
|
|
|
2014-05-30 10:31:27 +08:00
|
|
|
} // namespace atom
|