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

Delta Between Two Patch Sets: chrome/ext/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 | « background.js ('k') | chrome/icons/abp-38.png » ('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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 { 203 {
204 this._tabId = tabId; 204 this._tabId = tabId;
205 }; 205 };
206 BrowserAction.prototype = { 206 BrowserAction.prototype = {
207 setIcon: function(path) 207 setIcon: function(path)
208 { 208 {
209 var paths = {}; 209 var paths = {};
210 for (var i = 1; i <= 2; i++) 210 for (var i = 1; i <= 2; i++)
211 { 211 {
212 var size = i * 19; 212 var size = i * 19;
213 paths[size] = path.replace(/((?:.*\/)*.+?\b)/, '$1-' + size); 213 paths[size] = path.replace("$size", size);
Wladimir Palant 2014/04/02 16:37:24 This is rather non-obvious behavior. It should be
Sebastian Noack 2014/04/02 17:02:08 But then we would need something like |path.replac
Wladimir Palant 2014/04/03 05:43:40 No, path.replace("$size", "16") should do, the ico
Sebastian Noack 2014/04/03 11:42:26 I somewhat agree. Here you go.
214 } 214 }
215 215
216 chrome.browserAction.setIcon({tabId: this._tabId, path: paths}); 216 chrome.browserAction.setIcon({tabId: this._tabId, path: paths});
217 }, 217 },
218 setBadge: function(badge) 218 setBadge: function(badge)
219 { 219 {
220 if (!badge) 220 if (!badge)
221 { 221 {
222 chrome.browserAction.setBadgeText({ 222 chrome.browserAction.setBadgeText({
223 tabId: this._tabId, 223 tabId: this._tabId,
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 if (isContextMenuHidden) 596 if (isContextMenuHidden)
597 return; 597 return;
598 598
599 chrome.contextMenus.removeAll(); 599 chrome.contextMenus.removeAll();
600 isContextMenuHidden = true; 600 isContextMenuHidden = true;
601 } 601 }
602 }; 602 };
603 603
604 ext.onMessage = new BackgroundMessageEventTarget(); 604 ext.onMessage = new BackgroundMessageEventTarget();
605 })(); 605 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld