Index: chrome/browser/resources/extensions/extension_list.js |
diff --git a/chrome/browser/resources/extensions/extension_list.js b/chrome/browser/resources/extensions/extension_list.js |
index 78ce406a41d853ce687d988b04ae2d946d7d359b..8072ce15d8734f1ed24f6baaf9a5de8efc930871 100644 |
--- a/chrome/browser/resources/extensions/extension_list.js |
+++ b/chrome/browser/resources/extensions/extension_list.js |
@@ -32,6 +32,15 @@ cr.define('options', function() { |
*/ |
var butterBarVisibility = {}; |
+ /** |
+ * @type {Object.<string, string>} A map from extension id to a icon url |
+ * with timestamp. The timestamp is a query string to prevent the |
+ * icon from caching and is recorded when the user click the 'Reload' |
+ * link. It is used to refresh the icon of an unpacked extension. |
+ * This persists between calls to decorate. |
+ */ |
+ var extensionReloadedIconURL = {}; |
+ |
ExtensionsList.prototype = { |
__proto__: HTMLDivElement.prototype, |
@@ -97,10 +106,12 @@ cr.define('options', function() { |
node.classList.add('extension-highlight'); |
var item = node.querySelector('.extension-list-item'); |
- var extensionIconUrl = extension.icon; |
- if (extension.allow_reload) |
- extensionIconUrl = extension.icon + '?' + Date.now(); |
- item.style.backgroundImage = 'url(' + extensionIconUrl + ')'; |
+ if (extensionReloadedIconURL[extension.id]) { |
+ item.style.backgroundImage = |
+ 'url(' + extensionReloadedIconURL[extension.id] + ')'; |
+ } else { |
+ item.style.backgroundImage = 'url(' + extension.icon + ')'; |
+ } |
var title = node.querySelector('.extension-title'); |
title.textContent = extension.name; |
@@ -182,6 +193,8 @@ cr.define('options', function() { |
var reload = node.querySelector('.reload-link'); |
reload.addEventListener('click', function(e) { |
chrome.send('extensionSettingsReload', [extension.id]); |
+ extensionReloadedIconURL[extension.id] = extension.icon + '?' + |
+ new Date().getTime(); |
not at google - send to devlin
2013/07/26 16:48:07
if the icon changes will this assignment happen be
zhchbin
2013/07/29 15:43:59
However, I couldn't make sure I got your meaning o
not at google - send to devlin
2013/07/29 17:26:24
Like this:
1. Extension changes its icon URL in t
|
}); |
reload.hidden = false; |