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 CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Returns the active instance of the service in the browser process. Safe to | 31 // Returns the active instance of the service in the browser process. Safe to |
32 // be called from any thread. | 32 // be called from any thread. |
33 static PlatformNotificationServiceImpl* GetInstance(); | 33 static PlatformNotificationServiceImpl* GetInstance(); |
34 | 34 |
35 // To be called when a persistent notification has been clicked on. The | 35 // To be called when a persistent notification has been clicked on. The |
36 // Service Worker associated with the registration will be started if | 36 // Service Worker associated with the registration will be started if |
37 // needed, on which the event will be fired. Must be called on the UI thread. | 37 // needed, on which the event will be fired. Must be called on the UI thread. |
38 void OnPersistentNotificationClick( | 38 void OnPersistentNotificationClick( |
39 content::BrowserContext* browser_context, | 39 content::BrowserContext* browser_context, |
40 int64_t persistent_notification_id, | 40 int64_t persistent_notification_id, |
41 const GURL& origin, | 41 const GURL& origin) const; |
42 const base::Callback<void(content::PersistentNotificationStatus)>& | |
43 callback) const; | |
44 | 42 |
45 // Returns the Notification UI Manager through which notifications can be | 43 // Returns the Notification UI Manager through which notifications can be |
46 // displayed to the user. Can be overridden for testing. | 44 // displayed to the user. Can be overridden for testing. |
47 NotificationUIManager* GetNotificationUIManager() const; | 45 NotificationUIManager* GetNotificationUIManager() const; |
48 | 46 |
49 // content::PlatformNotificationService implementation. | 47 // content::PlatformNotificationService implementation. |
50 blink::WebNotificationPermission CheckPermissionOnUIThread( | 48 blink::WebNotificationPermission CheckPermissionOnUIThread( |
51 content::BrowserContext* browser_context, | 49 content::BrowserContext* browser_context, |
52 const GURL& origin, | 50 const GURL& origin, |
53 int render_process_id) override; | 51 int render_process_id) override; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 NotificationUIManager* notification_ui_manager_for_tests_; | 114 NotificationUIManager* notification_ui_manager_for_tests_; |
117 | 115 |
118 // Mapping between a persistent notification id and the id of the associated | 116 // Mapping between a persistent notification id and the id of the associated |
119 // message_center::Notification object. Must only be used on the UI thread. | 117 // message_center::Notification object. Must only be used on the UI thread. |
120 std::map<int64_t, std::string> persistent_notifications_; | 118 std::map<int64_t, std::string> persistent_notifications_; |
121 | 119 |
122 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); | 120 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
123 }; | 121 }; |
124 | 122 |
125 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 123 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
OLD | NEW |