Index: content/browser/notifications/notification_event_dispatcher_impl.cc |
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc |
index d48491ce2b8601fec05914a56db6f459fb435cf5..bc510dd57d046742fe8d8f4b7af2489f711b6cc2 100644 |
--- a/content/browser/notifications/notification_event_dispatcher_impl.cc |
+++ b/content/browser/notifications/notification_event_dispatcher_impl.cc |
@@ -95,10 +95,21 @@ void DispatchNotificationClickEventOnRegistration( |
service_worker_registration); |
DCHECK(service_worker_registration->active_version()); |
- service_worker_registration->active_version() |
- ->DispatchNotificationClickEvent( |
- dispatch_event_callback, notification_database_data.notification_id, |
- notification_database_data.notification_data, action_index); |
+ // TODO(nsatragno): refactor this class to avoid passing whether it's a |
+ // close or click notification through the action_index. |
+ if (action_index == -2) { |
Nina
2016/01/21 13:55:36
This is the thing I like the least about my CL. Th
|
+ service_worker_registration->active_version() |
+ ->DispatchNotificationCloseEvent( |
+ dispatch_event_callback, |
+ notification_database_data.notification_id, |
+ notification_database_data.notification_data); |
+ } else { |
+ service_worker_registration->active_version() |
+ ->DispatchNotificationClickEvent( |
+ dispatch_event_callback, |
+ notification_database_data.notification_id, |
+ notification_database_data.notification_data, action_index); |
+ } |
return; |
} |
@@ -230,4 +241,14 @@ void NotificationEventDispatcherImpl::DispatchNotificationClickEvent( |
service_worker_context, notification_context)); |
} |
+void NotificationEventDispatcherImpl::DispatchNotificationCloseEvent( |
+ BrowserContext* browser_context, |
+ int64_t persistent_notification_id, |
+ const GURL& origin, |
+ const NotificationClickDispatchCompleteCallback& |
+ dispatch_complete_callback) { |
+ DispatchNotificationClickEvent(browser_context, persistent_notification_id, |
+ origin, -2, dispatch_complete_callback); |
+} |
+ |
} // namespace content |