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

Side by Side Diff: lib/icon.js

Issue 29349820: Fixes 4218 - setIcon for older, fussy versions of Chrome (Closed)
Patch Set: Go with Sebastian's approach Created Aug. 16, 2016, 12:38 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
« chrome/ext/background.js ('K') | « chrome/ext/background.js ('k') | 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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 if (opacity > 0.5) 59 if (opacity > 0.5)
60 page.browserAction.setIcon("icons/abp-$size-notification-" 60 page.browserAction.setIcon("icons/abp-$size-notification-"
61 + notificationType + ".png"); 61 + notificationType + ".png");
62 else 62 else
63 page.browserAction.setIcon("icons/abp-$size" + 63 page.browserAction.setIcon("icons/abp-$size" +
64 (whitelisted ? "-whitelisted" : "") + ".png"); 64 (whitelisted ? "-whitelisted" : "") + ".png");
65 } 65 }
66 else 66 else
67 { 67 {
68 chrome.browserAction.setIcon({ 68 page.browserAction._safeSetIcon({
69 tabId: page.id, 69 tabId: page.id,
70 imageData: frames["" + opacity + whitelisted] 70 imageData: frames["" + opacity + whitelisted]
71 }); 71 });
72 } 72 }
73 } 73 }
74 74
75 FilterNotifier.on("page.WhitelistingStateRevalidate", (page, filter) => 75 FilterNotifier.on("page.WhitelistingStateRevalidate", (page, filter) =>
76 { 76 {
77 whitelistedState.set(page, !!filter); 77 whitelistedState.set(page, !!filter);
78 if (canUpdateIcon) 78 if (canUpdateIcon)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 clearInterval(interval); 227 clearInterval(interval);
228 resolve(); 228 resolve();
229 return; 229 return;
230 } 230 }
231 231
232 animateIcon(type, frames); 232 animateIcon(type, frames);
233 }, 10000); 233 }, 10000);
234 }); 234 });
235 }); 235 });
236 }; 236 };
OLDNEW
« chrome/ext/background.js ('K') | « chrome/ext/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld