platform_notification_service.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright (c) 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE-CHROMIUM file.
  4. #ifndef BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
  5. #define BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
  6. #include <set>
  7. #include <string>
  8. #include "content/public/browser/browser_context.h"
  9. #include "content/public/browser/platform_notification_service.h"
  10. namespace brightray {
  11. class BrowserClient;
  12. class PlatformNotificationService
  13. : public content::PlatformNotificationService {
  14. public:
  15. explicit PlatformNotificationService(BrowserClient* browser_client);
  16. ~PlatformNotificationService() override;
  17. protected:
  18. // content::PlatformNotificationService:
  19. blink::mojom::PermissionStatus CheckPermissionOnUIThread(
  20. content::BrowserContext* browser_context,
  21. const GURL& origin,
  22. int render_process_id) override;
  23. blink::mojom::PermissionStatus CheckPermissionOnIOThread(
  24. content::ResourceContext* resource_context,
  25. const GURL& origin,
  26. int render_process_id) override;
  27. void DisplayNotification(
  28. content::BrowserContext* browser_context,
  29. const std::string& notification_id,
  30. const GURL& origin,
  31. const content::PlatformNotificationData& notification_data,
  32. const content::NotificationResources& notification_resources,
  33. base::Closure* cancel_callback) override;
  34. void DisplayPersistentNotification(
  35. content::BrowserContext* browser_context,
  36. const std::string& notification_id,
  37. const GURL& service_worker_scope,
  38. const GURL& origin,
  39. const content::PlatformNotificationData& notification_data,
  40. const content::NotificationResources& notification_resources) override;
  41. void ClosePersistentNotification(content::BrowserContext* browser_context,
  42. const std::string& notification_id) override;
  43. void GetDisplayedNotifications(
  44. content::BrowserContext* browser_context,
  45. const DisplayedNotificationsCallback& callback) override;
  46. private:
  47. BrowserClient* browser_client_;
  48. int render_process_id_;
  49. DISALLOW_COPY_AND_ASSIGN(PlatformNotificationService);
  50. };
  51. } // namespace brightray
  52. #endif // BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_