Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: chrome/browser/resources/extensions/extension_list.js

Issue 12225147: Fix a bug where an extension's icon wasn't being properly reloaded if it changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jsdoc comments, postincrement change Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « AUTHORS ('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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options', function() { 5 cr.define('options', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * A lookup helper function to find the first node that has an id (starting 9 * A lookup helper function to find the first node that has an id (starting
10 * at |node| and going up the parent chain). 10 * at |node| and going up the parent chain).
(...skipping 17 matching lines...) Expand all
28 /** 28 /**
29 * @type {Object.<string, boolean>} A map from extension id to a boolean 29 * @type {Object.<string, boolean>} A map from extension id to a boolean
30 * indicating whether the incognito warning is showing. This persists 30 * indicating whether the incognito warning is showing. This persists
31 * between calls to decorate. 31 * between calls to decorate.
32 */ 32 */
33 var butterBarVisibility = {}; 33 var butterBarVisibility = {};
34 34
35 ExtensionsList.prototype = { 35 ExtensionsList.prototype = {
36 __proto__: HTMLDivElement.prototype, 36 __proto__: HTMLDivElement.prototype,
37 37
38 /**
39 * @type {number} Appended to icon URL as a query string to prevent
40 * the icon from caching. Increments each time an extension is reloaded.
41 */
42 iconQueryId_: 0,
43
38 /** @override */ 44 /** @override */
39 decorate: function() { 45 decorate: function() {
40 this.textContent = ''; 46 this.textContent = '';
41 47
42 this.showExtensionNodes_(); 48 this.showExtensionNodes_();
43 }, 49 },
44 50
45 getIdQueryParam_: function() { 51 getIdQueryParam_: function() {
46 return parseQueryParams(document.location)['id']; 52 return parseQueryParams(document.location)['id'];
47 }, 53 },
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 node.classList.add('inactive-extension'); 96 node.classList.add('inactive-extension');
91 97
92 if (!extension.userModifiable) 98 if (!extension.userModifiable)
93 node.classList.add('may-not-disable'); 99 node.classList.add('may-not-disable');
94 100
95 var id_to_highlight = this.getIdQueryParam_(); 101 var id_to_highlight = this.getIdQueryParam_();
96 if (node.id == id_to_highlight) 102 if (node.id == id_to_highlight)
97 node.classList.add('extension-highlight'); 103 node.classList.add('extension-highlight');
98 104
99 var item = node.querySelector('.extension-list-item'); 105 var item = node.querySelector('.extension-list-item');
100 item.style.backgroundImage = 'url(' + extension.icon + ')'; 106 item.style.backgroundImage = 'url(' + extension.icon + '?' +
107 this.iconQueryId_++ + ')';
not at google - send to devlin 2013/02/13 01:59:31 Ah I see - is the problem just that the background
not at google - send to devlin 2013/02/13 02:05:27 Ok I straight away realised this was dumb, since t
epeterson 2013/02/14 01:09:23 I've just tried these suggestions, and, unfortunat
101 108
102 var title = node.querySelector('.extension-title'); 109 var title = node.querySelector('.extension-title');
103 title.textContent = extension.name; 110 title.textContent = extension.name;
104 111
105 var version = node.querySelector('.extension-version'); 112 var version = node.querySelector('.extension-version');
106 version.textContent = extension.version; 113 version.textContent = extension.version;
107 114
108 var disableReason = node.querySelector('.extension-disable-reason'); 115 var disableReason = node.querySelector('.extension-disable-reason');
109 disableReason.textContent = extension.disableReason; 116 disableReason.textContent = extension.disableReason;
110 117
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 335 }
329 336
330 this.appendChild(node); 337 this.appendChild(node);
331 } 338 }
332 }; 339 };
333 340
334 return { 341 return {
335 ExtensionsList: ExtensionsList 342 ExtensionsList: ExtensionsList
336 }; 343 };
337 }); 344 });
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698