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

Side by Side Diff: chrome/browser/resources/chromeos/active_downloads.js

Issue 9167019: Consolidate icon loading on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment. Created 8 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 | « chrome/browser/icon_manager_chromeos.cc ('k') | chrome/browser/resources/downloads.js » ('j') | 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 /** 5 /**
6 * Wrapper for chrome.send. 6 * Wrapper for chrome.send.
7 */ 7 */
8 function chromeSend(func, arg) { 8 function chromeSend(func, arg) {
9 if (arg == undefined) 9 if (arg == undefined)
10 arg = ''; 10 arg = '';
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 var elem = document.createElement('li'); 226 var elem = document.createElement('li');
227 elem.className = 'downloadrow'; 227 elem.className = 'downloadrow';
228 elem.id = this.path; 228 elem.id = this.path;
229 elem.row = this; 229 elem.row = this;
230 this.element = elem; 230 this.element = elem;
231 231
232 list.append(this); 232 list.append(this);
233 }, 233 },
234 234
235 setDangerousIcon_: function(warning) { 235 setDangerousIcon_: function(warning) {
236 var escapedPath = encodeURIComponent(this.path).replace(/'/g,'%27');
236 this.icon.className = warning ? 'iconwarning' : 'icon'; 237 this.icon.className = warning ? 'iconwarning' : 'icon';
237 this.icon.style.background = warning ? '' : 238 this.icon.style.background = warning ? '' :
238 'url(chrome://fileicon' + escape(this.path) + 239 'url(\'chrome://fileicon/' + escapedPath +
239 '?iconsize=small) no-repeat'; 240 '?iconsize=small\') no-repeat';
240 }, 241 },
241 242
242 /** 243 /**
243 * Create the row button for the left of the row. 244 * Create the row button for the left of the row.
244 * This contains the icon, filename and error elements. 245 * This contains the icon, filename and error elements.
245 * @private 246 * @private
246 */ 247 */
247 createRowButton_: function () { 248 createRowButton_: function () {
248 this.rowbutton = createChild('div', 'rowbutton rowbg', this.element); 249 this.rowbutton = createChild('div', 'rowbutton rowbg', this.element);
249 250
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 update: function(result) { 624 update: function(result) {
624 var row = this.getRow(result.file_path); 625 var row = this.getRow(result.file_path);
625 if (!row && !DiscardResult(result)) 626 if (!row && !DiscardResult(result))
626 row = new DownloadRow(this, result); 627 row = new DownloadRow(this, result);
627 628
628 row && row.update(result); 629 row && row.update(result);
629 }, 630 },
630 }; 631 };
631 632
632 document.addEventListener('DOMContentLoaded', init); 633 document.addEventListener('DOMContentLoaded', init);
OLDNEW
« no previous file with comments | « chrome/browser/icon_manager_chromeos.cc ('k') | chrome/browser/resources/downloads.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698