summaryrefslogtreecommitdiffstats
path: root/content/browser/service_worker
diff options
context:
space:
mode:
authorjohnme <johnme@chromium.org>2015-08-06 09:08:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-06 16:08:33 +0000
commit038cc944e555856f791b2fbc828a5fde93220ef6 (patch)
tree3a751a89a9f7a55e3f8660a0dac9c97223097355 /content/browser/service_worker
parenta1e307e62d831f0dd531c5a95384af54e17c1532 (diff)
downloadchromium_src-038cc944e555856f791b2fbc828a5fde93220ef6.zip
chromium_src-038cc944e555856f791b2fbc828a5fde93220ef6.tar.gz
chromium_src-038cc944e555856f791b2fbc828a5fde93220ef6.tar.bz2
Plumb notification action index for desktop SW notificationclick
Spec: https://github.com/whatwg/notifications/pull/48 Intent to implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/6tlbJW0NjEA/LF0kPfJx7c0J Part of a sequence of patches: - https://codereview.chromium.org/1254423011 (blink) - https://codereview.chromium.org/1263043002 (blink) - https://codereview.chromium.org/1263043003 (blink) - https://codereview.chromium.org/1268813007 (blink) - https://codereview.chromium.org/1267673003 (chromium) - https://codereview.chromium.org/1262893005 (blink) - this patch (chromium) - https://codereview.chromium.org/1262893006 (chromium) - https://codereview.chromium.org/1264403002 (blink) BUG=513671 Review URL: https://codereview.chromium.org/1269923003 Cr-Commit-Position: refs/heads/master@{#342121}
Diffstat (limited to 'content/browser/service_worker')
-rw-r--r--content/browser/service_worker/service_worker_version.cc9
-rw-r--r--content/browser/service_worker/service_worker_version.h3
2 files changed, 8 insertions, 4 deletions
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 4ff04c8..03b15bb 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -826,7 +826,8 @@ void ServiceWorkerVersion::DispatchSyncEvent(SyncRegistrationPtr registration,
void ServiceWorkerVersion::DispatchNotificationClickEvent(
const StatusCallback& callback,
int64_t persistent_notification_id,
- const PlatformNotificationData& notification_data) {
+ const PlatformNotificationData& notification_data,
+ int action_index) {
DCHECK_EQ(ACTIVATED, status()) << status();
if (running_status() != RUNNING) {
// Schedule calling this method after starting the worker.
@@ -834,7 +835,8 @@ void ServiceWorkerVersion::DispatchNotificationClickEvent(
&RunTaskAfterStartWorker, weak_factory_.GetWeakPtr(), callback,
base::Bind(&self::DispatchNotificationClickEvent,
weak_factory_.GetWeakPtr(), callback,
- persistent_notification_id, notification_data)));
+ persistent_notification_id, notification_data,
+ action_index)));
return;
}
@@ -842,7 +844,8 @@ void ServiceWorkerVersion::DispatchNotificationClickEvent(
REQUEST_NOTIFICATION_CLICK);
ServiceWorkerStatusCode status =
embedded_worker_->SendMessage(ServiceWorkerMsg_NotificationClickEvent(
- request_id, persistent_notification_id, notification_data));
+ request_id, persistent_notification_id, notification_data,
+ action_index));
if (status != SERVICE_WORKER_OK) {
notification_click_requests_.Remove(request_id);
RunSoon(base::Bind(callback, status));
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index a1bb88e..36f7f61 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -220,7 +220,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
void DispatchNotificationClickEvent(
const StatusCallback& callback,
int64_t persistent_notification_id,
- const PlatformNotificationData& notification_data);
+ const PlatformNotificationData& notification_data,
+ int action_index);
// Sends push event to the associated embedded worker and asynchronously calls
// |callback| when it errors out or it gets a response from the worker to