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 // TODO(jhawkins): Use hidden instead of showInline* and display:none. | 5 // TODO(jhawkins): Use hidden instead of showInline* and display:none. |
6 | 6 |
7 /** | 7 /** |
8 * Sets the display style of a node. | 8 * Sets the display style of a node. |
9 */ | 9 */ |
10 function showInline(node, isShow) { | 10 function showInline(node, isShow) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 'danger_content_desc', this.fileName_); | 408 'danger_content_desc', this.fileName_); |
409 } else if (this.dangerType_ == Download.DangerType.UNCOMMON_CONTENT) { | 409 } else if (this.dangerType_ == Download.DangerType.UNCOMMON_CONTENT) { |
410 this.dangerDesc_.textContent = loadTimeData.getStringF( | 410 this.dangerDesc_.textContent = loadTimeData.getStringF( |
411 'danger_uncommon_desc', this.fileName_); | 411 'danger_uncommon_desc', this.fileName_); |
412 } | 412 } |
413 this.danger_.style.display = 'block'; | 413 this.danger_.style.display = 'block'; |
414 this.safe_.style.display = 'none'; | 414 this.safe_.style.display = 'none'; |
415 } else { | 415 } else { |
416 downloads.scheduleIconLoad(this.nodeImg_, | 416 downloads.scheduleIconLoad(this.nodeImg_, |
417 'chrome://fileicon/' + | 417 'chrome://fileicon/' + |
418 encodeURIComponent(this.filePath_)); | 418 encodeURIComponent(this.filePath_) + |
| 419 '?scale=' + window.devicePixelRatio + 'x'); |
419 | 420 |
420 if (this.state_ == Download.States.COMPLETE && | 421 if (this.state_ == Download.States.COMPLETE && |
421 !this.fileExternallyRemoved_) { | 422 !this.fileExternallyRemoved_) { |
422 this.nodeFileLink_.textContent = this.fileName_; | 423 this.nodeFileLink_.textContent = this.fileName_; |
423 this.nodeFileLink_.href = this.fileUrl_; | 424 this.nodeFileLink_.href = this.fileUrl_; |
424 this.nodeFileLink_.oncontextmenu = null; | 425 this.nodeFileLink_.oncontextmenu = null; |
425 } else if (this.nodeFileName_.textContent != this.fileName_) { | 426 } else if (this.nodeFileName_.textContent != this.fileName_) { |
426 this.nodeFileName_.textContent = this.fileName_; | 427 this.nodeFileName_.textContent = this.fileName_; |
427 } | 428 } |
428 if (this.state_ == Download.States.INTERRUPTED) | 429 if (this.state_ == Download.States.INTERRUPTED) |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 if (Date.now() - start > 50) { | 716 if (Date.now() - start > 50) { |
716 clearTimeout(resultsTimeout); | 717 clearTimeout(resultsTimeout); |
717 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); | 718 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); |
718 break; | 719 break; |
719 } | 720 } |
720 } | 721 } |
721 } | 722 } |
722 | 723 |
723 // Add handlers to HTML elements. | 724 // Add handlers to HTML elements. |
724 window.addEventListener('DOMContentLoaded', load); | 725 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |