Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
index 53cfd751b51b895f13424a62c68711d1197b145f..e6955c1fe724d70f47b1fa1c2cf2133334bd0a8e 100644 |
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
@@ -146,13 +146,23 @@ void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, |
{ |
WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID); |
NotificationEventInit eventInit; |
- eventInit.setNotification(Notification::create(workerGlobalScope(), notificationID, data)); |
+ eventInit.setNotification(Notification::create(workerGlobalScope(), notificationID, data, true /* showing */)); |
if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) |
eventInit.setAction(data.actions[actionIndex].action); |
RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::notificationclick, eventInit, observer)); |
workerGlobalScope()->dispatchExtendableEvent(event.release(), observer); |
} |
+void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent(int eventID, int64_t notificationID, const WebNotificationData& data) |
+{ |
+ WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::NotificationClose, eventID); |
+ NotificationEventInit eventInit; |
+ eventInit.setAction(WTF::String()); |
Peter Beverloo
2016/01/28 16:14:23
Yes, a comment would be useful. In-line would be
Nina
2016/02/01 17:59:06
Done.
|
+ eventInit.setNotification(Notification::create(workerGlobalScope(), notificationID, data, false /* showing */)); |
+ RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::notificationclose, eventInit, observer)); |
+ workerGlobalScope()->dispatchExtendableEvent(event.release(), observer); |
+} |
+ |
void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebString& data) |
{ |
WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::Push, eventID); |