Chromium Code Reviews| 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 f6cd1b2de46f33b46897220571b09ea9a667115f..0b0de8292bfc0694b15eb5c1029d5be3030ae3ab 100644 |
| --- a/chrome/browser/resources/extensions/extension_list.js |
| +++ b/chrome/browser/resources/extensions/extension_list.js |
| @@ -32,6 +32,14 @@ cr.define('options', function() { |
| */ |
| var butterBarVisibility = {}; |
| + /** |
| + * @type {Object.<string, string>} A map from extension id to last reloaded |
| + * timestamp. The timestamp 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 extensionReloadedTimestamp = {}; |
| + |
| ExtensionsList.prototype = { |
| __proto__: HTMLDivElement.prototype, |
| @@ -97,10 +105,13 @@ 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 (extensionReloadedTimestamp[extension.id]) { |
|
not at google - send to devlin
2013/08/01 15:22:01
reference bug number(s) in a comment here
zhchbin
2013/08/02 00:29:10
Done.
|
| + item.style.backgroundImage = |
| + 'url(' + extension.icon + '?' + |
| + extensionReloadedTimestamp[extension.id] + ')'; |
| + } else { |
| + item.style.backgroundImage = 'url(' + extension.icon + ')'; |
| + } |
| var title = node.querySelector('.extension-title'); |
| title.textContent = extension.name; |
| @@ -182,6 +193,7 @@ cr.define('options', function() { |
| var reload = node.querySelector('.reload-link'); |
| reload.addEventListener('click', function(e) { |
| chrome.send('extensionSettingsReload', [extension.id]); |
| + extensionReloadedTimestamp[extension.id] = new Date().getTime(); |
|
not at google - send to devlin
2013/08/01 15:22:01
Date.now() should do it.
dhnishi (use Chromium)
2013/08/01 18:30:19
Actually, I just had a thought.
Suppose an extens
not at google - send to devlin
2013/08/01 18:46:18
The same would apply for the developerPrivate API
zhchbin
2013/08/02 00:29:10
Done.
|
| }); |
| reload.hidden = false; |