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

Delta Between Two Patch Sets: lib/ui.js

Issue 5256408131960832: Issue 2420 - Move notification show logic to core (Closed)
Left Patch Set: Created June 8, 2015, 11:10 a.m.
Right Patch Set: Remove function properly, address nit Created June 8, 2015, 10 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/notification.js ('k') | no next file » | 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 for (let window of this.applicationWindows) 412 for (let window of this.applicationWindows)
413 this.updateStatusbarIcon(window); 413 this.updateStatusbarIcon(window);
414 } 414 }
415 }.bind(this)); 415 }.bind(this));
416 FilterNotifier.addListener(function(action) 416 FilterNotifier.addListener(function(action)
417 { 417 {
418 if (/^(filter|subscription)\.(added|removed|disabled|updated)$/.test(actio n) || action == "load") 418 if (/^(filter|subscription)\.(added|removed|disabled|updated)$/.test(actio n) || action == "load")
419 this.updateState(); 419 this.updateState();
420 }.bind(this)); 420 }.bind(this));
421 421
422 Notification.addShowListener(function(notification) 422 Notification.addShowListener(notification =>
Wladimir Palant 2015/06/08 11:33:15 How about: Notification.addShowListener(notificat
Felix Dahlke 2015/06/08 19:34:34 Done.
423 { 423 {
424 let window = this.currentWindow; 424 let window = this.currentWindow;
425 if (!window) 425 if (!window)
426 return; 426 return;
427 427
428 let button = window.document.getElementById("abp-toolbarbutton") 428 let button = window.document.getElementById("abp-toolbarbutton")
429 || window.document.getElementById("abp-status"); 429 || window.document.getElementById("abp-status");
430 if (!button) 430 if (!button)
431 return; 431 return;
432 432
433 this._showNotification(window, button, notification); 433 this._showNotification(window, button, notification);
434 }.bind(this)); 434 });
435 435
436 // Add "anti-adblock messages" notification 436 // Add "anti-adblock messages" notification
437 initAntiAdblockNotification(); 437 initAntiAdblockNotification();
438 438
439 let documentCreationObserver = { 439 let documentCreationObserver = {
440 observe: function(subject, topic, data) 440 observe: function(subject, topic, data)
441 { 441 {
442 if (!(subject instanceof Ci.nsIDOMWindow)) 442 if (!(subject instanceof Ci.nsIDOMWindow))
443 return; 443 return;
444 444
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)], 1956 ["abp-command-contribute", "command", UI.openContributePage.bind(UI)],
1957 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)] 1957 ["abp-command-contribute-hide", "command", UI.hideContributeButton.bind(UI)]
1958 ]; 1958 ];
1959 1959
1960 onShutdown.add(function() 1960 onShutdown.add(function()
1961 { 1961 {
1962 for (let window of UI.applicationWindows) 1962 for (let window of UI.applicationWindows)
1963 if (UI.isBottombarOpen(window)) 1963 if (UI.isBottombarOpen(window))
1964 UI.toggleBottombar(window); 1964 UI.toggleBottombar(window);
1965 }); 1965 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld