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

Delta Between Two Patch Sets: background.js

Issue 6182748523855872: Issue 1518 - Got rid of deprecated code using webkitNotifications (Closed)
Left Patch Set: Created Jan. 8, 2015, 10:31 a.m.
Right Patch Set: Use addEventListener() Created Jan. 13, 2015, 12:29 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 | « no previous file | chrome/notification.html » ('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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 var notification = new Notification( 410 var notification = new Notification(
411 title, 411 title,
412 { 412 {
413 lang: Utils.appLocale, 413 lang: Utils.appLocale,
414 dir: ext.i18n.getMessage("@@bidi_dir"), 414 dir: ext.i18n.getMessage("@@bidi_dir"),
415 body: message, 415 body: message,
416 icon: iconData 416 icon: iconData
417 } 417 }
418 ); 418 );
419 419
420 notification.onclick = openNotificationLinks; 420 notification.addEventListener("click", openNotificationLinks);
421 notification.onclose = notificationClosed; 421 notification.addEventListener("close", notificationClosed);
Wladimir Palant 2015/01/13 07:39:16 I certainly prefer addEventListener() to onclick -
Sebastian Noack 2015/01/13 12:30:20 Thanks for pointing this out. I just overlooked th
422 }); 422 });
423 } 423 }
424 else 424 else
425 { 425 {
426 var message = title + "\n" + message; 426 var message = title + "\n" + message;
427 if (hasLinks) 427 if (hasLinks)
428 message += "\n\n" + ext.i18n.getMessage("notification_with_buttons"); 428 message += "\n\n" + ext.i18n.getMessage("notification_with_buttons");
429 429
430 var approved = confirm(message); 430 var approved = confirm(message);
431 if (activeNotification.type === "question") 431 if (activeNotification.type === "question")
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 page.sendMessage({type: "clickhide-deactivate"}); 578 page.sendMessage({type: "clickhide-deactivate"});
579 refreshIconAndContextMenu(page); 579 refreshIconAndContextMenu(page);
580 }); 580 });
581 581
582 setTimeout(function() 582 setTimeout(function()
583 { 583 {
584 var notificationToShow = NotificationStorage.getNextToShow(); 584 var notificationToShow = NotificationStorage.getNextToShow();
585 if (notificationToShow) 585 if (notificationToShow)
586 showNotification(notificationToShow); 586 showNotification(notificationToShow);
587 }, 3 * 60 * 1000); 587 }, 3 * 60 * 1000);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld