tray_icon.cc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Copyright (c) 2014 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "shell/browser/ui/tray_icon.h"
  5. namespace electron {
  6. TrayIcon::BalloonOptions::BalloonOptions() = default;
  7. TrayIcon::TrayIcon() = default;
  8. TrayIcon::~TrayIcon() = default;
  9. void TrayIcon::SetPressedImage(ImageType image) {}
  10. void TrayIcon::DisplayBalloon(const BalloonOptions& options) {}
  11. void TrayIcon::RemoveBalloon() {}
  12. void TrayIcon::Focus() {}
  13. void TrayIcon::PopUpContextMenu(const gfx::Point& pos,
  14. base::WeakPtr<ElectronMenuModel> menu_model) {}
  15. void TrayIcon::CloseContextMenu() {}
  16. gfx::Rect TrayIcon::GetBounds() {
  17. return gfx::Rect();
  18. }
  19. void TrayIcon::NotifyClicked(const gfx::Rect& bounds,
  20. const gfx::Point& location,
  21. int modifiers) {
  22. for (TrayIconObserver& observer : observers_)
  23. observer.OnClicked(bounds, location, modifiers);
  24. }
  25. void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
  26. for (TrayIconObserver& observer : observers_)
  27. observer.OnDoubleClicked(bounds, modifiers);
  28. }
  29. void TrayIcon::NotifyMiddleClicked(const gfx::Rect& bounds, int modifiers) {
  30. for (TrayIconObserver& observer : observers_)
  31. observer.OnMiddleClicked(bounds, modifiers);
  32. }
  33. void TrayIcon::NotifyBalloonShow() {
  34. for (TrayIconObserver& observer : observers_)
  35. observer.OnBalloonShow();
  36. }
  37. void TrayIcon::NotifyBalloonClicked() {
  38. for (TrayIconObserver& observer : observers_)
  39. observer.OnBalloonClicked();
  40. }
  41. void TrayIcon::NotifyBalloonClosed() {
  42. for (TrayIconObserver& observer : observers_)
  43. observer.OnBalloonClosed();
  44. }
  45. void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
  46. for (TrayIconObserver& observer : observers_)
  47. observer.OnRightClicked(bounds, modifiers);
  48. }
  49. void TrayIcon::NotifyDrop() {
  50. for (TrayIconObserver& observer : observers_)
  51. observer.OnDrop();
  52. }
  53. void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
  54. for (TrayIconObserver& observer : observers_)
  55. observer.OnDropFiles(files);
  56. }
  57. void TrayIcon::NotifyDropText(const std::string& text) {
  58. for (TrayIconObserver& observer : observers_)
  59. observer.OnDropText(text);
  60. }
  61. void TrayIcon::NotifyMouseUp(const gfx::Point& location, int modifiers) {
  62. for (TrayIconObserver& observer : observers_)
  63. observer.OnMouseUp(location, modifiers);
  64. }
  65. void TrayIcon::NotifyMouseDown(const gfx::Point& location, int modifiers) {
  66. for (TrayIconObserver& observer : observers_)
  67. observer.OnMouseDown(location, modifiers);
  68. }
  69. void TrayIcon::NotifyMouseEntered(const gfx::Point& location, int modifiers) {
  70. for (TrayIconObserver& observer : observers_)
  71. observer.OnMouseEntered(location, modifiers);
  72. }
  73. void TrayIcon::NotifyMouseExited(const gfx::Point& location, int modifiers) {
  74. for (TrayIconObserver& observer : observers_)
  75. observer.OnMouseExited(location, modifiers);
  76. }
  77. void TrayIcon::NotifyMouseMoved(const gfx::Point& location, int modifiers) {
  78. for (TrayIconObserver& observer : observers_)
  79. observer.OnMouseMoved(location, modifiers);
  80. }
  81. void TrayIcon::NotifyDragEntered() {
  82. for (TrayIconObserver& observer : observers_)
  83. observer.OnDragEntered();
  84. }
  85. void TrayIcon::NotifyDragExited() {
  86. for (TrayIconObserver& observer : observers_)
  87. observer.OnDragExited();
  88. }
  89. void TrayIcon::NotifyDragEnded() {
  90. for (TrayIconObserver& observer : observers_)
  91. observer.OnDragEnded();
  92. }
  93. } // namespace electron