OLD | NEW |
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 this.icon.className = warning ? 'iconwarning' : 'icon'; | 236 this.icon.className = warning ? 'iconwarning' : 'icon'; |
237 this.icon.style.background = warning ? '' : | 237 this.icon.style.background = warning ? '' : |
238 'url(chrome://fileicon' + escape(this.path) + | 238 'url(chrome://fileicon/' + encodeURIComponent(this.path) + |
239 '?iconsize=small) no-repeat'; | 239 '?iconsize=small) no-repeat'; |
240 }, | 240 }, |
241 | 241 |
242 /** | 242 /** |
243 * Create the row button for the left of the row. | 243 * Create the row button for the left of the row. |
244 * This contains the icon, filename and error elements. | 244 * This contains the icon, filename and error elements. |
245 * @private | 245 * @private |
246 */ | 246 */ |
247 createRowButton_: function () { | 247 createRowButton_: function () { |
248 this.rowbutton = createChild('div', 'rowbutton rowbg', this.element); | 248 this.rowbutton = createChild('div', 'rowbutton rowbg', this.element); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 update: function(result) { | 623 update: function(result) { |
624 var row = this.getRow(result.file_path); | 624 var row = this.getRow(result.file_path); |
625 if (!row && !DiscardResult(result)) | 625 if (!row && !DiscardResult(result)) |
626 row = new DownloadRow(this, result); | 626 row = new DownloadRow(this, result); |
627 | 627 |
628 row && row.update(result); | 628 row && row.update(result); |
629 }, | 629 }, |
630 }; | 630 }; |
631 | 631 |
632 document.addEventListener('DOMContentLoaded', init); | 632 document.addEventListener('DOMContentLoaded', init); |
OLD | NEW |