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

Side by Side Diff: chrome/test/data/notifications/android_test_worker.js

Issue 2418153002: Hooking up Android N inline notification replies end-to-end (Closed)
Patch Set: Reformat getNotificationReply 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var messagePort = null; 5 var messagePort = null;
6 6
7 addEventListener('message', function(event) { 7 addEventListener('message', function(event) {
8 messagePort = event.data; 8 messagePort = event.data;
9 messagePort.postMessage('ready'); 9 messagePort.postMessage('ready');
10 }); 10 });
11 11
12 addEventListener('notificationclick', function(event) { 12 addEventListener('notificationclick', function(event) {
13 if (event.notification.data === 'ACTION_CREATE_TAB') 13 if (event.notification.data === 'ACTION_CREATE_TAB')
14 clients.openWindow('https://chrome.com/'); 14 clients.openWindow('https://chrome.com/');
15 else if (event.notification.data === 'ACTION_REPLY')
16 messagePort.postMessage('reply: ' + event.reply)
15 17
16 event.notification.close(); 18 event.notification.close();
17 }); 19 });
OLDNEW
« no previous file with comments | « chrome/test/data/notifications/android_test.html ('k') | chrome/test/data/notifications/notification_test_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698