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 24 matching lines...) Expand all Loading... | |
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, |
42 const base::Callback<void(content::PersistentNotificationStatus)>& | 42 const base::Callback<void(content::PersistentNotificationStatus)>& |
43 callback) const; | 43 callback) const; |
44 | 44 |
45 // To be called when a persistent notification has been closed. The data | |
46 // associated with the notification has to be pruned from the database in this | |
47 // case, to make sure that it continues to be in sync. | |
johnme
2015/04/10 11:54:39
Nit: Must be called on the UI thread.
Peter Beverloo
2015/04/20 16:47:20
Done.
| |
48 void OnPersistentNotificationClose( | |
49 content::BrowserContext* browser_context, | |
johnme
2015/04/10 11:54:39
Why not just take a Profile* since this is the chr
Peter Beverloo
2015/04/20 16:47:20
It only needs to know about the BrowserContext*, s
| |
50 int64_t persistent_notification_id, | |
51 const GURL& origin) const; | |
52 | |
45 // Returns the Notification UI Manager through which notifications can be | 53 // Returns the Notification UI Manager through which notifications can be |
46 // displayed to the user. Can be overridden for testing. | 54 // displayed to the user. Can be overridden for testing. |
47 NotificationUIManager* GetNotificationUIManager() const; | 55 NotificationUIManager* GetNotificationUIManager() const; |
48 | 56 |
49 // content::PlatformNotificationService implementation. | 57 // content::PlatformNotificationService implementation. |
50 blink::WebNotificationPermission CheckPermissionOnUIThread( | 58 blink::WebNotificationPermission CheckPermissionOnUIThread( |
51 content::BrowserContext* browser_context, | 59 content::BrowserContext* browser_context, |
52 const GURL& origin, | 60 const GURL& origin, |
53 int render_process_id) override; | 61 int render_process_id) override; |
54 blink::WebNotificationPermission CheckPermissionOnIOThread( | 62 blink::WebNotificationPermission CheckPermissionOnIOThread( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 NotificationUIManager* notification_ui_manager_for_tests_; | 124 NotificationUIManager* notification_ui_manager_for_tests_; |
117 | 125 |
118 // Mapping between a persistent notification id and the id of the associated | 126 // 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. | 127 // message_center::Notification object. Must only be used on the UI thread. |
120 std::map<int64_t, std::string> persistent_notifications_; | 128 std::map<int64_t, std::string> persistent_notifications_; |
121 | 129 |
122 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); | 130 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
123 }; | 131 }; |
124 | 132 |
125 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 133 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
OLD | NEW |