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

Side by Side Diff: lib/icon.js

Issue 29570614: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Update adblockplusui dependency Created Oct. 17, 2017, 1:02 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 | « lib/firefoxDataCleanup.js ('k') | lib/io.js » ('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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 browser.browserAction.setIcon({
72 tabId: page.id, 72 tabId: page.id,
73 imageData: frames["" + opacity + whitelisted] 73 imageData: frames["" + opacity + whitelisted]
74 }); 74 });
75 } 75 }
76 } 76 }
77 77
78 FilterNotifier.on("page.WhitelistingStateRevalidate", (page, filter) => 78 FilterNotifier.on("page.WhitelistingStateRevalidate", (page, filter) =>
79 { 79 {
80 whitelistedState.set(page, !!filter); 80 whitelistedState.set(page, !!filter);
81 if (canUpdateIcon) 81 if (canUpdateIcon)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 frames["" + opacity + whitelisted] = imageData; 137 frames["" + opacity + whitelisted] = imageData;
138 } 138 }
139 } 139 }
140 140
141 return frames; 141 return frames;
142 }); 142 });
143 } 143 }
144 144
145 function animateIcon(notificationType, frames) 145 function animateIcon(notificationType, frames)
146 { 146 {
147 chrome.tabs.query({active: true}, tabs => 147 browser.tabs.query({active: true}, tabs =>
148 { 148 {
149 let pages = tabs.map(tab => new ext.Page(tab)); 149 let pages = tabs.map(tab => new ext.Page(tab));
150 150
151 let animationStep = 0; 151 let animationStep = 0;
152 let opacity = 0; 152 let opacity = 0;
153 153
154 let onActivated = page => 154 let onActivated = page =>
155 { 155 {
156 pages.push(page); 156 pages.push(page);
157 setIcon(page, notificationType, opacity, frames); 157 setIcon(page, notificationType, opacity, frames);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 clearInterval(interval); 230 clearInterval(interval);
231 resolve(); 231 resolve();
232 return; 232 return;
233 } 233 }
234 234
235 animateIcon(type, frames); 235 animateIcon(type, frames);
236 }, 10000); 236 }, 10000);
237 }); 237 });
238 }); 238 });
239 }; 239 };
OLDNEW
« no previous file with comments | « lib/firefoxDataCleanup.js ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld