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

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

Issue 2392343002: Plumbing in notification replies: PlatformNotificationService -> SW (Closed)
Patch Set: Send NullableString through IPC, remove settings check from ButtonClickWithReply, add TODO in messa… 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..384264e7faacda53eafd37aed9e6b2713d066720 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"
Peter Beverloo 2016/10/12 13:58:31 delete both (unused)
awdf 2016/10/12 17:04:01 Done.
#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,13 @@ 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));
}
// 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 +233,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 +364,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