libnotify_notification.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (c) 2015 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 BRIGHTRAY_BROWSER_LINUX_LIBNOTIFY_NOTIFICATION_H_
  5. #define BRIGHTRAY_BROWSER_LINUX_LIBNOTIFY_NOTIFICATION_H_
  6. #include <string>
  7. #include <vector>
  8. #include "brightray/browser/linux/libnotify_loader.h"
  9. #include "brightray/browser/notification.h"
  10. #include "ui/base/glib/glib_signal.h"
  11. namespace brightray {
  12. class LibnotifyNotification : public Notification {
  13. public:
  14. LibnotifyNotification(NotificationDelegate* delegate,
  15. NotificationPresenter* presenter);
  16. ~LibnotifyNotification() override;
  17. static bool Initialize();
  18. // Notification:
  19. void Show(const NotificationOptions& options) override;
  20. void Dismiss() override;
  21. private:
  22. CHROMEG_CALLBACK_0(LibnotifyNotification,
  23. void,
  24. OnNotificationClosed,
  25. NotifyNotification*);
  26. CHROMEG_CALLBACK_1(LibnotifyNotification,
  27. void,
  28. OnNotificationView,
  29. NotifyNotification*,
  30. char*);
  31. NotifyNotification* notification_;
  32. DISALLOW_COPY_AND_ASSIGN(LibnotifyNotification);
  33. };
  34. } // namespace brightray
  35. #endif // BRIGHTRAY_BROWSER_LINUX_LIBNOTIFY_NOTIFICATION_H_