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

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

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: it works \o/ Created 4 years, 8 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 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);
}
« no previous file with comments | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | third_party/WebKit/Source/web/web.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698