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

Unified Diff: content/browser/notifications/notification_event_dispatcher_impl.cc

Issue 2392343002: Plumbing in notification replies: PlatformNotificationService -> SW (Closed)
Patch Set: Remove todo as it doesn't seem necessary after all Created 4 years, 2 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/browser/notifications/notification_event_dispatcher_impl.cc
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc
index 9eb1ade75ffd3c59c82fb1d227f5de18b617899b..40fa0e4fcfdcf2b37bcd6a9d0dd58ac070b0aed1 100644
--- a/content/browser/notifications/notification_event_dispatcher_impl.cc
+++ b/content/browser/notifications/notification_event_dispatcher_impl.cc
@@ -5,6 +5,8 @@
#include "content/browser/notifications/notification_event_dispatcher_impl.h"
#include "base/callback.h"
+#include "base/strings/nullable_string16.h"
+#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/browser/notifications/platform_notification_context_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
@@ -203,6 +205,7 @@ void DispatchNotificationClickEventOnWorker(
const scoped_refptr<ServiceWorkerVersion>& service_worker,
const NotificationDatabaseData& notification_database_data,
int action_index,
+ const base::NullableString16& reply,
const ServiceWorkerVersion::StatusCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
int request_id = service_worker->StartRequest(
@@ -212,12 +215,14 @@ void DispatchNotificationClickEventOnWorker(
request_id,
ServiceWorkerMsg_NotificationClickEvent(
request_id, notification_database_data.notification_id,
- notification_database_data.notification_data, action_index));
+ notification_database_data.notification_data, action_index,
+ reply.is_null() ? base::ASCIIToUTF16("") : reply.string()));
Peter Beverloo 2016/10/11 14:22:56 Why don't we just pass the NullableString16 over I
awdf 2016/10/11 15:51:27 Thinking about it, I'm not 100% sure the differenc
awdf 2016/10/12 13:26:42 Done (As discussed on the doc, the difference can
}
// Dispatches the notification click event on the |service_worker_registration|.
void DoDispatchNotificationClickEvent(
int action_index,
+ const base::NullableString16& reply,
const NotificationDispatchCompleteCallback& dispatch_complete_callback,
const scoped_refptr<PlatformNotificationContext>& notification_context,
const ServiceWorkerRegistration* service_worker_registration,
@@ -229,7 +234,7 @@ void DoDispatchNotificationClickEvent(
base::Bind(
&DispatchNotificationClickEventOnWorker,
make_scoped_refptr(service_worker_registration->active_version()),
- notification_database_data, action_index, status_callback),
+ notification_database_data, action_index, reply, status_callback),
status_callback);
}
@@ -360,10 +365,11 @@ void NotificationEventDispatcherImpl::DispatchNotificationClickEvent(
const std::string& notification_id,
const GURL& origin,
int action_index,
+ const base::NullableString16& reply,
const NotificationDispatchCompleteCallback& dispatch_complete_callback) {
DispatchNotificationEvent(
browser_context, notification_id, origin,
- base::Bind(&DoDispatchNotificationClickEvent, action_index,
+ base::Bind(&DoDispatchNotificationClickEvent, action_index, reply,
dispatch_complete_callback),
dispatch_complete_callback);
}

Powered by Google App Engine
This is Rietveld 408576698