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

Side by Side Diff: background.js

Issue 5838171610808320: Added high resolution icons for Retina displays (Closed)
Patch Set: Created April 2, 2014, 3:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | chrome/ext/background.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 removeDeprecatedOptions(); 110 removeDeprecatedOptions();
111 111
112 var activeNotification = null; 112 var activeNotification = null;
113 113
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 (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-16.png" 124 iconFilename = "icons/abp-whitelisted.png";
125 else 125 else
126 iconFilename = whitelisted ? "icons/abp-19-whitelisted.png" : "icons/abp-19. png"; 126 iconFilename = "icons/abp.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);
OLDNEW
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | chrome/ext/background.js » ('J')

Powered by Google App Engine
This is Rietveld