Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trivial rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698