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

Delta Between Two Patch Sets: ext/background.js

Issue 29995555: Issue 7253 - Pre-render icons for badge on Chromium (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Remove icons from metadata.chrome Created Feb. 3, 2019, 8:32 a.m.
Right Patch Set: Rewrite renderIcons Created Feb. 3, 2019, 9:45 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 | « no previous file | lib/icon.js » ('j') | lib/icon.js » ('J')
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 <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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 this._changes = null; 398 this._changes = null;
399 }).catch(() => 399 }).catch(() =>
400 { 400 {
401 // If the tab is prerendered, browser.browserAction.set* fails 401 // If the tab is prerendered, browser.browserAction.set* fails
402 // and we have to delay our changes until the currently visible tab 402 // and we have to delay our changes until the currently visible tab
403 // is replaced with the prerendered tab. 403 // is replaced with the prerendered tab.
404 browser.tabs.onReplaced.addListener(onReplaced); 404 browser.tabs.onReplaced.addListener(onReplaced);
405 }); 405 });
406 } 406 }
407 }, 407 },
408 setIcon(path, imageData = null) 408 setIconPath(path)
409 { 409 {
410 // Use ImageData if available. 410 this._addChange("iconPath", path);
411 if (imageData) 411 },
Sebastian Noack 2019/02/03 08:47:16 Maybe it would be better, to just have two differe
Manish Jethani 2019/02/03 09:10:22 Done.
412 this._addChange("iconImageData", imageData); 412 setIconImageData(imageData)
413 else 413 {
414 this._addChange("iconPath", path); 414 this._addChange("iconImageData", imageData);
415 }, 415 },
416 setBadge(badge) 416 setBadge(badge)
417 { 417 {
418 if (!badge) 418 if (!badge)
419 { 419 {
420 this._addChange("badgeText", ""); 420 this._addChange("badgeText", "");
421 } 421 }
422 else 422 else
423 { 423 {
424 if ("number" in badge) 424 if ("number" in badge)
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 return frames.get(0) || null; 529 return frames.get(0) || null;
530 } 530 }
531 }; 531 };
532 } 532 }
533 533
534 return ext.onMessage._dispatch( 534 return ext.onMessage._dispatch(
535 message, sender, sendResponse 535 message, sender, sendResponse
536 ).includes(true); 536 ).includes(true);
537 }); 537 });
538 } 538 }
LEFTRIGHT
« no previous file | lib/icon.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld