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 #include <set> | 10 #include <set> |
(...skipping 22 matching lines...) Expand all Loading... |
33 // Returns the active instance of the service in the browser process. Safe to | 33 // Returns the active instance of the service in the browser process. Safe to |
34 // be called from any thread. | 34 // be called from any thread. |
35 static PlatformNotificationServiceImpl* GetInstance(); | 35 static PlatformNotificationServiceImpl* GetInstance(); |
36 | 36 |
37 // To be called when a persistent notification has been clicked on. The | 37 // To be called when a persistent notification has been clicked on. The |
38 // Service Worker associated with the registration will be started if | 38 // Service Worker associated with the registration will be started if |
39 // needed, on which the event will be fired. Must be called on the UI thread. | 39 // needed, on which the event will be fired. Must be called on the UI thread. |
40 void OnPersistentNotificationClick( | 40 void OnPersistentNotificationClick( |
41 content::BrowserContext* browser_context, | 41 content::BrowserContext* browser_context, |
42 int64_t persistent_notification_id, | 42 int64_t persistent_notification_id, |
43 const GURL& origin) const; | 43 const GURL& origin, |
| 44 int action_index) const; |
44 | 45 |
45 // To be called when a persistent notification has been closed. The data | 46 // 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 // 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. Must be called on the | 48 // case, to make sure that it continues to be in sync. Must be called on the |
48 // UI thread. | 49 // UI thread. |
49 void OnPersistentNotificationClose( | 50 void OnPersistentNotificationClose( |
50 content::BrowserContext* browser_context, | 51 content::BrowserContext* browser_context, |
51 int64_t persistent_notification_id, | 52 int64_t persistent_notification_id, |
52 const GURL& origin) const; | 53 const GURL& origin) const; |
53 | 54 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 NotificationUIManager* notification_ui_manager_for_tests_; | 129 NotificationUIManager* notification_ui_manager_for_tests_; |
129 | 130 |
130 // Mapping between a persistent notification id and the id of the associated | 131 // Mapping between a persistent notification id and the id of the associated |
131 // message_center::Notification object. Must only be used on the UI thread. | 132 // message_center::Notification object. Must only be used on the UI thread. |
132 std::map<int64_t, std::string> persistent_notifications_; | 133 std::map<int64_t, std::string> persistent_notifications_; |
133 | 134 |
134 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); | 135 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
135 }; | 136 }; |
136 | 137 |
137 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ | 138 #endif // CHROME_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ |
OLD | NEW |