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

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: Addressed comments 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 348e8093ab2dc5bbbe91d820e0b3897377d564c9..0074cb3dec087abc6f177754d6e4d3588c9203ad 100644
--- a/content/renderer/service_worker/service_worker_context_client.cc
+++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -255,6 +255,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)
@@ -524,6 +526,13 @@ void ServiceWorkerContextClient::didHandleNotificationClickEvent(
GetRoutingID(), request_id));
}
+void ServiceWorkerContextClient::didHandleNotificationCloseEvent(
+ int request_id,
+ blink::WebServiceWorkerEventResult result) {
+ Send(new ServiceWorkerHostMsg_NotificationCloseEventFinished(GetRoutingID(),
+ request_id));
+}
+
void ServiceWorkerContextClient::didHandlePushEvent(
int request_id,
blink::WebServiceWorkerEventResult result) {
@@ -759,6 +768,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 std::string& data) {
TRACE_EVENT0("ServiceWorker",

Powered by Google App Engine
This is Rietveld 408576698