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

Side by Side Diff: lib/icon.js

Issue 29434586: Noissue - Fix icon error when running unit tests (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created May 10, 2017, 4:56 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 | no next file » | 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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 function setIcon(page, notificationType, opacity, frames) 51 function setIcon(page, notificationType, opacity, frames)
52 { 52 {
53 opacity = opacity || 0; 53 opacity = opacity || 0;
54 let whitelisted = !!whitelistedState.get(page); 54 let whitelisted = !!whitelistedState.get(page);
55 55
56 if (!notificationType || !frames) 56 if (!notificationType || !frames)
57 { 57 {
58 if (opacity > 0.5) 58 if (opacity > 0.5)
59 { 59 {
60 page.browserAction.setIcon("icons/abp-$size-notification-" + 60 page.browserAction.setIcon("/icons/abp-$size-notification-" +
61 notificationType + ".png"); 61 notificationType + ".png");
62 } 62 }
63 else 63 else
64 { 64 {
65 page.browserAction.setIcon("icons/abp-$size" + 65 page.browserAction.setIcon("/icons/abp-$size" +
66 (whitelisted ? "-whitelisted" : "") + ".png"); 66 (whitelisted ? "-whitelisted" : "") + ".png");
67 } 67 }
68 } 68 }
69 else 69 else
70 { 70 {
71 chrome.browserAction.setIcon({ 71 chrome.browserAction.setIcon({
72 tabId: page.id, 72 tabId: page.id,
73 imageData: frames["" + opacity + whitelisted] 73 imageData: frames["" + opacity + whitelisted]
74 }); 74 });
75 } 75 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 clearInterval(interval); 228 clearInterval(interval);
229 resolve(); 229 resolve();
230 return; 230 return;
231 } 231 }
232 232
233 animateIcon(type, frames); 233 animateIcon(type, frames);
234 }, 10000); 234 }, 10000);
235 }); 235 });
236 }); 236 });
237 }; 237 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld