Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: lib/notificationHelper.js

Issue 29334223: Issue 3532 - Generate animation images at runtime (Closed)
Left Patch Set: We don't need to convert icons to data URLs Created Jan. 26, 2016, 4:56 p.m.
Right Patch Set: Addressed final nits Created Jan. 26, 2016, 10:57 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/icon.js ('k') | metadata.chrome » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (canUseChromeNotifications) 193 if (canUseChromeNotifications)
194 { 194 {
195 activeButtons = getNotificationButtons(activeNotification.type, texts.mess age); 195 activeButtons = getNotificationButtons(activeNotification.type, texts.mess age);
196 chrome.notifications.create("", { 196 chrome.notifications.create("", {
197 type: "basic", 197 type: "basic",
198 title: title, 198 title: title,
199 iconUrl: iconUrl, 199 iconUrl: iconUrl,
200 message: message, 200 message: message,
201 buttons: activeButtons.map(button => ({title: button.title})), 201 buttons: activeButtons.map(button => ({title: button.title})),
202 priority: 2 // We use the highest priority to prevent the notification f rom closing automatically 202 priority: 2 // We use the highest priority to prevent the notification f rom closing automatically
203 }, function() {}); 203 });
204 } 204 }
205 else if ("Notification" in window && activeNotification.type != "question") 205 else if ("Notification" in window && activeNotification.type != "question")
206 { 206 {
207 if (linkCount > 0) 207 if (linkCount > 0)
208 message += " " + ext.i18n.getMessage("notification_without_buttons"); 208 message += " " + ext.i18n.getMessage("notification_without_buttons");
209 209
210 let notification = new Notification( 210 let notification = new Notification(
211 title, 211 title,
212 { 212 {
213 lang: Utils.appLocale, 213 lang: Utils.appLocale,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 * @param {string} notificationType 275 * @param {string} notificationType
276 * @return {boolean} 276 * @return {boolean}
277 */ 277 */
278 exports.shouldDisplay = function(method, notificationType) 278 exports.shouldDisplay = function(method, notificationType)
279 { 279 {
280 let methods = displayMethods[notificationType] || defaultDisplayMethods; 280 let methods = displayMethods[notificationType] || defaultDisplayMethods;
281 return methods.indexOf(method) > -1; 281 return methods.indexOf(method) > -1;
282 }; 282 };
283 283
284 NotificationStorage.addShowListener(showNotification); 284 NotificationStorage.addShowListener(showNotification);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld