tray_icon_gtk.h 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef ATOM_BROWSER_UI_TRAY_ICON_GTK_H_
  5. #define ATOM_BROWSER_UI_TRAY_ICON_GTK_H_
  6. #include <string>
  7. #include "atom/browser/ui/tray_icon.h"
  8. #include "ui/views/linux_ui/status_icon_linux.h"
  9. namespace views {
  10. class StatusIconLinux;
  11. }
  12. namespace atom {
  13. class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
  14. public:
  15. TrayIconGtk();
  16. ~TrayIconGtk() override;
  17. // TrayIcon:
  18. void SetImage(const gfx::Image& image) override;
  19. void SetToolTip(const std::string& tool_tip) override;
  20. void SetContextMenu(AtomMenuModel* menu_model) override;
  21. private:
  22. // views::StatusIconLinux::Delegate:
  23. void OnClick() override;
  24. bool HasClickAction() override;
  25. std::unique_ptr<views::StatusIconLinux> icon_;
  26. DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);
  27. };
  28. } // namespace atom
  29. #endif // ATOM_BROWSER_UI_TRAY_ICON_GTK_H_