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

Side by Side Diff: ext/background.js

Issue 29997602: Issue 7256 - Stop using 19x19 and 38x38 icons (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Feb. 3, 2019, 8:45 a.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 | icons/abp-19.png » ('j') | no next file with comments »
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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return Promise.all(Object.keys(this._changes).map(change => 324 return Promise.all(Object.keys(this._changes).map(change =>
325 { 325 {
326 // Firefox for Android displays the browser action not as an icon but 326 // Firefox for Android displays the browser action not as an icon but
327 // as a menu item. There is no icon, but such an option may be added 327 // as a menu item. There is no icon, but such an option may be added
328 // in the future. 328 // in the future.
329 // https://bugzilla.mozilla.org/show_bug.cgi?id=1331746 329 // https://bugzilla.mozilla.org/show_bug.cgi?id=1331746
330 if (change == "iconPath" && "setIcon" in browser.browserAction) 330 if (change == "iconPath" && "setIcon" in browser.browserAction)
331 { 331 {
332 let path = { 332 let path = {
333 16: this._changes.iconPath.replace("$size", "16"), 333 16: this._changes.iconPath.replace("$size", "16"),
334 19: this._changes.iconPath.replace("$size", "19"),
335 20: this._changes.iconPath.replace("$size", "20"), 334 20: this._changes.iconPath.replace("$size", "20"),
336 32: this._changes.iconPath.replace("$size", "32"), 335 32: this._changes.iconPath.replace("$size", "32"),
337 38: this._changes.iconPath.replace("$size", "38"),
338 40: this._changes.iconPath.replace("$size", "40") 336 40: this._changes.iconPath.replace("$size", "40")
339 }; 337 };
340 try 338 try
341 { 339 {
342 return browser.browserAction.setIcon({tabId: this._tabId, path}); 340 return browser.browserAction.setIcon({tabId: this._tabId, path});
343 } 341 }
344 catch (e) 342 catch (e)
345 { 343 {
346 // Edge throws if passed icon sizes different than 19,20,38,40px. 344 // Edge throws if passed icon sizes different than 19,20,38,40px.
347 delete path[16]; 345 delete path[16];
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 return frames.get(0) || null; 517 return frames.get(0) || null;
520 } 518 }
521 }; 519 };
522 } 520 }
523 521
524 return ext.onMessage._dispatch( 522 return ext.onMessage._dispatch(
525 message, sender, sendResponse 523 message, sender, sendResponse
526 ).includes(true); 524 ).includes(true);
527 }); 525 });
528 } 526 }
OLDNEW
« no previous file with comments | « no previous file | icons/abp-19.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld