| 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 02446d03530e6aedbe579f1001ad66c56b77fb0f..c9201b73aa953d9921403ca24eb7c8ccaf0aa36a 100644
|
| --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
|
| @@ -57,7 +57,7 @@
|
| #include "modules/serviceworkers/ServiceWorkerWindowClient.h"
|
| #include "modules/serviceworkers/WaitUntilObserver.h"
|
| #include "platform/RuntimeEnabledFeatures.h"
|
| -#include "public/platform/modules/notifications/WebNotificationData.h"
|
| +#include "public/platform/modules/notifications/notification.mojom-blink.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h"
|
| #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h"
|
| #include "public/web/WebSerializedScriptValue.h"
|
| @@ -177,23 +177,23 @@ void ServiceWorkerGlobalScopeProxy::dispatchInstallEvent(int eventID)
|
| workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| }
|
|
|
| -void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, int64_t notificationID, const WebNotificationData& data, int actionIndex)
|
| +void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, mojom::blink::NotificationPtr notification, int actionIndex)
|
| {
|
| WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID);
|
| NotificationEventInit eventInit;
|
| - 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);
|
| + if (actionIndex >= 0 && actionIndex < static_cast<int>(notification->actions.size()))
|
| + eventInit.setAction(notification->actions[actionIndex]->action);
|
| + eventInit.setNotification(Notification::create(workerGlobalScope(), std::move(notification), true /* showing */));
|
| Event* event = NotificationEvent::create(EventTypeNames::notificationclick, eventInit, observer);
|
| workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| }
|
|
|
| -void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent(int eventID, int64_t notificationID, const WebNotificationData& data)
|
| +void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent(int eventID, mojom::blink::NotificationPtr notification)
|
| {
|
| WaitUntilObserver* observer = WaitUntilObserver::create(workerGlobalScope(), WaitUntilObserver::NotificationClose, eventID);
|
| NotificationEventInit eventInit;
|
| eventInit.setAction(WTF::String()); // initialize as null.
|
| - eventInit.setNotification(Notification::create(workerGlobalScope(), notificationID, data, false /* showing */));
|
| + eventInit.setNotification(Notification::create(workerGlobalScope(), std::move(notification), false /* showing */));
|
| Event* event = NotificationEvent::create(EventTypeNames::notificationclose, eventInit, observer);
|
| workerGlobalScope()->dispatchExtendableEvent(event, observer);
|
| }
|
|
|