tray_icon.cc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. gfx::Rect TrayIcon::GetBounds() {
  10. return {};
  11. }
  12. void TrayIcon::NotifyClicked(const gfx::Rect& bounds,
  13. const gfx::Point& location,
  14. int modifiers) {
  15. for (TrayIconObserver& observer : observers_)
  16. observer.OnClicked(bounds, location, modifiers);
  17. }
  18. void TrayIcon::NotifyDoubleClicked(const gfx::Rect& bounds, int modifiers) {
  19. for (TrayIconObserver& observer : observers_)
  20. observer.OnDoubleClicked(bounds, modifiers);
  21. }
  22. void TrayIcon::NotifyMiddleClicked(const gfx::Rect& bounds, int modifiers) {
  23. for (TrayIconObserver& observer : observers_)
  24. observer.OnMiddleClicked(bounds, modifiers);
  25. }
  26. void TrayIcon::NotifyBalloonShow() {
  27. for (TrayIconObserver& observer : observers_)
  28. observer.OnBalloonShow();
  29. }
  30. void TrayIcon::NotifyBalloonClicked() {
  31. for (TrayIconObserver& observer : observers_)
  32. observer.OnBalloonClicked();
  33. }
  34. void TrayIcon::NotifyBalloonClosed() {
  35. for (TrayIconObserver& observer : observers_)
  36. observer.OnBalloonClosed();
  37. }
  38. void TrayIcon::NotifyRightClicked(const gfx::Rect& bounds, int modifiers) {
  39. for (TrayIconObserver& observer : observers_)
  40. observer.OnRightClicked(bounds, modifiers);
  41. }
  42. void TrayIcon::NotifyDrop() {
  43. for (TrayIconObserver& observer : observers_)
  44. observer.OnDrop();
  45. }
  46. void TrayIcon::NotifyDropFiles(const std::vector<std::string>& files) {
  47. for (TrayIconObserver& observer : observers_)
  48. observer.OnDropFiles(files);
  49. }
  50. void TrayIcon::NotifyDropText(const std::string& text) {
  51. for (TrayIconObserver& observer : observers_)
  52. observer.OnDropText(text);
  53. }
  54. void TrayIcon::NotifyMouseUp(const gfx::Point& location, int modifiers) {
  55. for (TrayIconObserver& observer : observers_)
  56. observer.OnMouseUp(location, modifiers);
  57. }
  58. void TrayIcon::NotifyMouseDown(const gfx::Point& location, int modifiers) {
  59. for (TrayIconObserver& observer : observers_)
  60. observer.OnMouseDown(location, modifiers);
  61. }
  62. void TrayIcon::NotifyMouseEntered(const gfx::Point& location, int modifiers) {
  63. for (TrayIconObserver& observer : observers_)
  64. observer.OnMouseEntered(location, modifiers);
  65. }
  66. void TrayIcon::NotifyMouseExited(const gfx::Point& location, int modifiers) {
  67. for (TrayIconObserver& observer : observers_)
  68. observer.OnMouseExited(location, modifiers);
  69. }
  70. void TrayIcon::NotifyMouseMoved(const gfx::Point& location, int modifiers) {
  71. for (TrayIconObserver& observer : observers_)
  72. observer.OnMouseMoved(location, modifiers);
  73. }
  74. void TrayIcon::NotifyDragEntered() {
  75. for (TrayIconObserver& observer : observers_)
  76. observer.OnDragEntered();
  77. }
  78. void TrayIcon::NotifyDragExited() {
  79. for (TrayIconObserver& observer : observers_)
  80. observer.OnDragExited();
  81. }
  82. void TrayIcon::NotifyDragEnded() {
  83. for (TrayIconObserver& observer : observers_)
  84. observer.OnDragEnded();
  85. }
  86. } // namespace electron