Index: content/child/notifications/notification_manager.h |
diff --git a/content/child/notifications/notification_manager.h b/content/child/notifications/notification_manager.h |
index b556c8e1318c7c3e136754f4f0d7ab478c34683f..da673a4597db165dc4c100ab90e434d1aebde1c5 100644 |
--- a/content/child/notifications/notification_manager.h |
+++ b/content/child/notifications/notification_manager.h |
@@ -56,10 +56,9 @@ class NotificationManager : public blink::WebNotificationManager, |
const blink::WebString& filter_tag, |
blink::WebServiceWorkerRegistration* service_worker_registration, |
blink::WebNotificationGetCallbacks* callbacks) override; |
- void close(blink::WebNotificationDelegate* delegate) override; |
- void closePersistent(const blink::WebSecurityOrigin& origin, |
- const blink::WebString& tag, |
- const blink::WebString& notification_id) override; |
+ void close(const blink::WebSecurityOrigin& origin, |
+ const blink::WebString& tag, |
+ const blink::WebString& notification_id) override; |
void notifyDelegateDestroyed( |
blink::WebNotificationDelegate* delegate) override; |
@@ -71,10 +70,12 @@ class NotificationManager : public blink::WebNotificationManager, |
NotificationDispatcher* notification_dispatcher); |
// IPC message handlers. |
- void OnDidShow(int notification_id); |
+ void OnDidShow(int non_persistent_notification_id, |
+ const std::string& notification_id); |
void OnDidShowPersistent(int request_id, bool success); |
- void OnDidClose(int notification_id); |
- void OnDidClick(int notification_id); |
+ void OnDidClose(int non_persistent_notification_id, |
+ const std::string& notification_id); |
+ void OnDidClick(int non_persistent_notification_id); |
void OnDidGetNotifications( |
int request_id, |
const std::vector<PersistentNotificationInfo>& notification_infos); |
@@ -90,21 +91,14 @@ class NotificationManager : public blink::WebNotificationManager, |
IDMap<blink::WebNotificationShowCallbacks, IDMapOwnPointer> |
pending_show_notification_requests_; |
- // Structure holding the information for active non-persistent notifications. |
- struct ActiveNotificationData { |
- ActiveNotificationData() = default; |
- ActiveNotificationData(blink::WebNotificationDelegate* delegate, |
- const GURL& origin, |
- const std::string& tag); |
- ~ActiveNotificationData(); |
- |
- blink::WebNotificationDelegate* delegate = nullptr; |
- GURL origin; |
- std::string tag; |
- }; |
- |
- // Map to store the delegate associated with a notification request Id. |
- std::unordered_map<int, ActiveNotificationData> active_page_notifications_; |
+ // Map from the notification ID to the associated delegate for non-persistent |
+ // notifications, for the purposes of triggering events. |
+ std::unordered_map<int, blink::WebNotificationDelegate*> |
+ non_persistent_notifications_; |
+ |
+ // Association from the notification ID string to the non-persistent |
+ // notification ID for non-persistent notifications. |
+ std::unordered_map<std::string, int> non_persistent_notification_ids_; |
DISALLOW_COPY_AND_ASSIGN(NotificationManager); |
}; |