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

Side by Side Diff: chrome/test/data/extensions/api_test/notifications/galore/app/controller.js

Issue 187803005: Remove uses of the Legacy Notification API and tests on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 Galore = Galore || {}; 5 var Galore = Galore || {};
6 6
7 Galore.controller = { 7 Galore.controller = {
8 /** @constructor */ 8 /** @constructor */
9 create: function() { 9 create: function() {
10 var controller = Object.create(this); 10 var controller = Object.create(this);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 this.createWebKitNotification_(expanded); 116 this.createWebKitNotification_(expanded);
117 else 117 else
118 this.createRichNotification_(expanded, id, type, priority); 118 this.createRichNotification_(expanded, id, type, priority);
119 }, 119 },
120 120
121 /** @private */ 121 /** @private */
122 createWebKitNotification_: function(options) { 122 createWebKitNotification_: function(options) {
123 var iconUrl = options.iconUrl; 123 var iconUrl = options.iconUrl;
124 var title = options.title; 124 var title = options.title;
125 var message = options.message; 125 var message = options.message;
126 webkitNotifications.createNotification(iconUrl, title, message).show(); 126 new Notification(title, {
127 body: message,
128 icon: iconUrl
129 });
127 this.handleEvent_('create', '?', 'title: "' + title + '"'); 130 this.handleEvent_('create', '?', 'title: "' + title + '"');
128 }, 131 },
129 132
130 /** @private */ 133 /** @private */
131 createRichNotification_: function(options, id, type, priority) { 134 createRichNotification_: function(options, id, type, priority) {
132 this.api.create(id, options, function() { 135 this.api.create(id, options, function() {
133 var argument1 = 'type: "' + type + '"'; 136 var argument1 = 'type: "' + type + '"';
134 var argument2 = 'priority: ' + priority; 137 var argument2 = 'priority: ' + priority;
135 var argument3 = 'title: "' + options.title + '"'; 138 var argument3 = 'title: "' + options.title + '"';
136 this.handleEvent_('create', id, argument1, argument2, argument3); 139 this.handleEvent_('create', id, argument1, argument2, argument3);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 getApi_: function(data) { 234 getApi_: function(data) {
232 var path = data[0].api || 'notifications'; 235 var path = data[0].api || 'notifications';
233 var api = chrome; 236 var api = chrome;
234 path.split('.').forEach(function(key) { api = api && api[key]; }); 237 path.split('.').forEach(function(key) { api = api && api[key]; });
235 if (!api) 238 if (!api)
236 this.view.logError('No API found - chrome.' + path + ' is undefined'); 239 this.view.logError('No API found - chrome.' + path + ' is undefined');
237 return api; 240 return api;
238 } 241 }
239 242
240 }; 243 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698