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

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

Issue 784383002: Support persistent notifications in the PlatformNotificationServiceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-chrome-base
Patch Set: adds browser tests Created 6 years 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
(Empty)
1 // Service Worker to be used with the platform_notification_service.html page.
2 var messagePort = null;
3
4 addEventListener('message', function (event) {
5 messagePort = event.data;
6 messagePort.postMessage('ready');
7 });
8
9 // The notificationclick event will be invoked when a persistent notification
10 // has been clicked on. When this happens, the title determines whether this
11 // Service Worker has to act upon this.
12 addEventListener('notificationclick', function (event) {
13 if (event.notification.title == 'action_close')
14 event.notification.close();
15
16 messagePort.postMessage(event.notification.title);
17 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698