| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual blink::mojom::PermissionStatus CheckPermissionOnIOThread( | 48 virtual blink::mojom::PermissionStatus CheckPermissionOnIOThread( |
| 49 ResourceContext* resource_context, | 49 ResourceContext* resource_context, |
| 50 const GURL& origin, | 50 const GURL& origin, |
| 51 int render_process_id) = 0; | 51 int render_process_id) = 0; |
| 52 | 52 |
| 53 // Displays the notification described in |notification_data| to the user. A | 53 // Displays the notification described in |notification_data| to the user. A |
| 54 // closure through which the notification can be closed will be stored in the | 54 // closure through which the notification can be closed will be stored in the |
| 55 // |cancel_callback| argument. This method must be called on the UI thread. | 55 // |cancel_callback| argument. This method must be called on the UI thread. |
| 56 virtual void DisplayNotification( | 56 virtual void DisplayNotification( |
| 57 BrowserContext* browser_context, | 57 BrowserContext* browser_context, |
| 58 const std::string& notification_id, |
| 58 const GURL& origin, | 59 const GURL& origin, |
| 59 const PlatformNotificationData& notification_data, | 60 const PlatformNotificationData& notification_data, |
| 60 const NotificationResources& notification_resources, | 61 const NotificationResources& notification_resources, |
| 61 std::unique_ptr<DesktopNotificationDelegate> delegate, | 62 std::unique_ptr<DesktopNotificationDelegate> delegate, |
| 62 base::Closure* cancel_callback) = 0; | 63 base::Closure* cancel_callback) = 0; |
| 63 | 64 |
| 64 // Displays the persistent notification described in |notification_data| to | 65 // Displays the persistent notification described in |notification_data| to |
| 65 // the user. This method must be called on the UI thread. | 66 // the user. This method must be called on the UI thread. |
| 66 virtual void DisplayPersistentNotification( | 67 virtual void DisplayPersistentNotification( |
| 67 BrowserContext* browser_context, | 68 BrowserContext* browser_context, |
| 68 int64_t persistent_notification_id, | 69 const std::string& notification_id, |
| 69 const GURL& service_worker_origin, | 70 const GURL& service_worker_origin, |
| 70 const GURL& origin, | 71 const GURL& origin, |
| 71 const PlatformNotificationData& notification_data, | 72 const PlatformNotificationData& notification_data, |
| 72 const NotificationResources& notification_resources) = 0; | 73 const NotificationResources& notification_resources) = 0; |
| 73 | 74 |
| 74 // Closes the persistent notification identified by | 75 // Closes the persistent notification identified by |
| 75 // |persistent_notification_id|. This method must be called on the UI thread. | 76 // |persistent_notification_id|. This method must be called on the UI thread. |
| 76 virtual void ClosePersistentNotification( | 77 virtual void ClosePersistentNotification( |
| 77 BrowserContext* browser_context, | 78 BrowserContext* browser_context, |
| 78 int64_t persistent_notification_id) = 0; | 79 const std::string& notification_id) = 0; |
| 79 | 80 |
| 80 // Writes the ids of all currently displaying persistent notifications for the | 81 // Writes the ids of all currently displaying persistent notifications for the |
| 81 // given |browser_context| to |displayed_notifications|. Returns whether the | 82 // given |browser_context| to |displayed_notifications|. Returns whether the |
| 82 // platform is able to provide such a set. | 83 // platform is able to provide such a set. |
| 83 virtual bool GetDisplayedPersistentNotifications( | 84 virtual bool GetDisplayedPersistentNotifications( |
| 84 BrowserContext* browser_context, | 85 BrowserContext* browser_context, |
| 85 std::set<std::string>* displayed_notifications) = 0; | 86 std::set<std::string>* displayed_notifications) = 0; |
| 86 }; | 87 }; |
| 87 | 88 |
| 88 } // namespace content | 89 } // namespace content |
| 89 | 90 |
| 90 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ | 91 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_ |
| OLD | NEW |