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

Delta Between Two Patch Sets: background.js

Issue 5838171610808320: Added high resolution icons for Retina displays (Closed)
Left Patch Set: Created April 2, 2014, 3:17 p.m.
Right Patch Set: Addressed comment Created April 3, 2014, 11:40 a.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/ext/background.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 <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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Adds or removes browser action icon according to options. 114 // Adds or removes browser action icon according to options.
115 function refreshIconAndContextMenu(tab) 115 function refreshIconAndContextMenu(tab)
116 { 116 {
117 var whitelisted = isWhitelisted(tab.url); 117 var whitelisted = isWhitelisted(tab.url);
118 118
119 var iconFilename; 119 var iconFilename;
120 if (whitelisted && require("info").platform != "safari") 120 if (whitelisted && require("info").platform != "safari")
121 // There is no grayscale version of the icon for whitelisted tabs 121 // There is no grayscale version of the icon for whitelisted tabs
122 // when using Safari, because icons are grayscale already and icons 122 // when using Safari, because icons are grayscale already and icons
123 // aren't per tab in Safari. 123 // aren't per tab in Safari.
124 iconFilename = "icons/abp-whitelisted.png"; 124 iconFilename = "icons/abp-$size-whitelisted.png";
125 else 125 else
126 iconFilename = "icons/abp.png"; 126 iconFilename = "icons/abp-$size.png";
127 127
128 tab.browserAction.setIcon(iconFilename); 128 tab.browserAction.setIcon(iconFilename);
129 iconAnimation.registerTab(tab, iconFilename); 129 iconAnimation.registerTab(tab, iconFilename);
130 130
131 // Set context menu status according to whether current tab has whitelisted do main 131 // Set context menu status according to whether current tab has whitelisted do main
132 if (whitelisted || !/^https?:/.test(tab.url)) 132 if (whitelisted || !/^https?:/.test(tab.url))
133 ext.contextMenus.hideMenuItems(); 133 ext.contextMenus.hideMenuItems();
134 else 134 else
135 ext.contextMenus.showMenuItems(); 135 ext.contextMenus.showMenuItems();
136 } 136 }
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 tab.sendMessage({type: "clickhide-deactivate"}); 584 tab.sendMessage({type: "clickhide-deactivate"});
585 refreshIconAndContextMenu(tab); 585 refreshIconAndContextMenu(tab);
586 }); 586 });
587 587
588 setTimeout(function() 588 setTimeout(function()
589 { 589 {
590 var notificationToShow = Notification.getNextToShow(); 590 var notificationToShow = Notification.getNextToShow();
591 if (notificationToShow) 591 if (notificationToShow)
592 showNotification(notificationToShow); 592 showNotification(notificationToShow);
593 }, 3 * 60 * 1000); 593 }, 3 * 60 * 1000);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld