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

Delta Between Two Patch Sets: lib/notificationHelper.js

Issue 5733084272001024: Issue 2368 - Update adblockplus dependency to revision feb391127fe4 (Closed)
Left Patch Set: Created June 12, 2015, 7:26 a.m.
Right Patch Set: Hint that there may not be a notification for the supplied URL Created June 12, 2015, 6:23 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 | « dependencies ('k') | webrequest.js » ('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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 * Initializes the notification system. 213 * Initializes the notification system.
214 */ 214 */
215 exports.initNotifications = function() 215 exports.initNotifications = function()
216 { 216 {
217 if (canUseChromeNotifications) 217 if (canUseChromeNotifications)
218 initChromeNotifications(); 218 initChromeNotifications();
219 initAntiAdblockNotification(); 219 initAntiAdblockNotification();
220 }; 220 };
221 221
222 /** 222 /**
223 * Shows the next notification from the queue if any. 223 * Shows the next notification (if any) for the supplied URL.
224 * 224 *
225 * @param {URL} [url] URL to match notifications to (optional) 225 * @param {URL} url URL to match notifications to
226 */ 226 */
227 exports.showNextNotification = function(url) 227 exports.showNextNotificationForUrl = function(url)
228 { 228 {
229 NotificationStorage.showNext(url && stringifyURL(url)); 229 NotificationStorage.showNext(stringifyURL(url));
Sebastian Noack 2015/06/12 09:42:06 Oh wait, I were too quick. The case where url isn'
Sebastian Noack 2015/06/12 09:42:42 s/rudimentary/mandatory/
Felix Dahlke 2015/06/12 17:01:35 Somehow presumed it can be null. But judging from
230 } 230 }
231 231
232 /** 232 /**
233 * Gets the active notification to be shown if any. 233 * Gets the active notification to be shown if any.
234 * 234 *
235 * @return {?object} 235 * @return {?object}
236 */ 236 */
237 exports.getActiveNotification = function() 237 exports.getActiveNotification = function()
238 { 238 {
239 return activeNotification; 239 return activeNotification;
240 }; 240 };
241 241
242 NotificationStorage.addShowListener(function(notification) 242 NotificationStorage.addShowListener(function(notification)
243 { 243 {
244 showNotification(notification); 244 showNotification(notification);
245 }); 245 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld