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

Unified Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits 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: content/renderer/service_worker/service_worker_context_client.cc
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc
index ab4e41723045d937ce82964044d470f28ff92ae3..24621158963329a4dc186dc2c7810d7a1ea28340 100644
--- a/content/renderer/service_worker/service_worker_context_client.cc
+++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -258,6 +258,8 @@ void ServiceWorkerContextClient::OnMessageReceived(
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_InstallEvent, OnInstallEvent)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationClickEvent,
OnNotificationClickEvent)
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_NotificationCloseEvent,
+ OnNotificationCloseEvent)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_PushEvent, OnPushEvent)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_GeofencingEvent, OnGeofencingEvent)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_MessageToWorker, OnPostMessage)
@@ -534,6 +536,13 @@ void ServiceWorkerContextClient::didHandleNotificationClickEvent(
GetRoutingID(), request_id, result));
}
+void ServiceWorkerContextClient::didHandleNotificationCloseEvent(
+ int request_id,
+ blink::WebServiceWorkerEventResult result) {
+ Send(new ServiceWorkerHostMsg_NotificationCloseEventFinished(
+ GetRoutingID(), request_id, result));
+}
+
void ServiceWorkerContextClient::didHandlePushEvent(
int request_id,
blink::WebServiceWorkerEventResult result) {
@@ -786,6 +795,17 @@ void ServiceWorkerContextClient::OnNotificationClickEvent(
action_index);
}
+void ServiceWorkerContextClient::OnNotificationCloseEvent(
+ int request_id,
+ int64_t persistent_notification_id,
+ const PlatformNotificationData& notification_data) {
+ TRACE_EVENT0("ServiceWorker",
+ "ServiceWorkerContextClient::OnNotificationCloseEvent");
+ proxy_->dispatchNotificationCloseEvent(
+ request_id, persistent_notification_id,
+ ToWebNotificationData(notification_data));
+}
+
void ServiceWorkerContextClient::OnPushEvent(int request_id,
const PushEventPayload& payload) {
TRACE_EVENT0("ServiceWorker",

Powered by Google App Engine
This is Rietveld 408576698