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

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: 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 // Appended to icon URL as a query string to prevent icon caching.
39 // Increments each time an extension is reloaded.
not at google - send to devlin 2013/02/12 22:57:52 use jsdoc style /** * @type {number} Appended to
epeterson 2013/02/12 23:52:42 Done.
40 iconQueryId_: 0,
41
38 /** @override */ 42 /** @override */
39 decorate: function() { 43 decorate: function() {
40 this.textContent = ''; 44 this.textContent = '';
41 45
42 this.showExtensionNodes_(); 46 this.showExtensionNodes_();
43 }, 47 },
44 48
45 getIdQueryParam_: function() { 49 getIdQueryParam_: function() {
46 return parseQueryParams(document.location)['id']; 50 return parseQueryParams(document.location)['id'];
47 }, 51 },
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 node.classList.add('inactive-extension'); 94 node.classList.add('inactive-extension');
91 95
92 if (!extension.userModifiable) 96 if (!extension.userModifiable)
93 node.classList.add('may-not-disable'); 97 node.classList.add('may-not-disable');
94 98
95 var id_to_highlight = this.getIdQueryParam_(); 99 var id_to_highlight = this.getIdQueryParam_();
96 if (node.id == id_to_highlight) 100 if (node.id == id_to_highlight)
97 node.classList.add('extension-highlight'); 101 node.classList.add('extension-highlight');
98 102
99 var item = node.querySelector('.extension-list-item'); 103 var item = node.querySelector('.extension-list-item');
100 item.style.backgroundImage = 'url(' + extension.icon + ')'; 104 item.style.backgroundImage = 'url(' + extension.icon + '?' +
105 (++this.iconQueryId_) + ')';
not at google - send to devlin 2013/02/12 22:57:52 I think () around ++this.iconQueryId_ are unnecess
epeterson 2013/02/12 23:52:42 Done.
101 106
102 var title = node.querySelector('.extension-title'); 107 var title = node.querySelector('.extension-title');
103 title.textContent = extension.name; 108 title.textContent = extension.name;
104 109
105 var version = node.querySelector('.extension-version'); 110 var version = node.querySelector('.extension-version');
106 version.textContent = extension.version; 111 version.textContent = extension.version;
107 112
108 var disableReason = node.querySelector('.extension-disable-reason'); 113 var disableReason = node.querySelector('.extension-disable-reason');
109 disableReason.textContent = extension.disableReason; 114 disableReason.textContent = extension.disableReason;
110 115
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 333 }
329 334
330 this.appendChild(node); 335 this.appendChild(node);
331 } 336 }
332 }; 337 };
333 338
334 return { 339 return {
335 ExtensionsList: ExtensionsList 340 ExtensionsList: ExtensionsList
336 }; 341 };
337 }); 342 });
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