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 * @param {!Element} node The target element to show or hide. | 9 * @param {!Element} node The target element to show or hide. |
10 * @param {boolean} isShow Should the target element be visible. | 10 * @param {boolean} isShow Should the target element be visible. |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 } | 483 } |
484 | 484 |
485 if (this.controlShow_) { | 485 if (this.controlShow_) { |
486 showInline(this.controlShow_, | 486 showInline(this.controlShow_, |
487 this.state_ == Download.States.COMPLETE && | 487 this.state_ == Download.States.COMPLETE && |
488 !this.fileExternallyRemoved_); | 488 !this.fileExternallyRemoved_); |
489 } | 489 } |
490 showInline(this.controlRetry_, this.state_ == Download.States.CANCELLED); | 490 showInline(this.controlRetry_, this.state_ == Download.States.CANCELLED); |
491 this.controlRetry_.href = this.url_; | 491 this.controlRetry_.href = this.url_; |
492 showInline(this.controlPause_, this.state_ == Download.States.IN_PROGRESS); | 492 showInline(this.controlPause_, this.state_ == Download.States.IN_PROGRESS); |
493 showInline(this.controlResume_, this.state_ == Download.States.PAUSED); | 493 showInline(this.controlResume_, |
| 494 this.state_ == Download.States.PAUSED || |
| 495 this.state_ == Download.States.INTERRUPTED); |
494 var showCancel = this.state_ == Download.States.IN_PROGRESS || | 496 var showCancel = this.state_ == Download.States.IN_PROGRESS || |
495 this.state_ == Download.States.PAUSED; | 497 this.state_ == Download.States.PAUSED || |
| 498 this.state_ == Download.States.INTERRUPTED; |
496 showInline(this.controlCancel_, showCancel); | 499 showInline(this.controlCancel_, showCancel); |
497 showInline(this.controlRemove_, !showCancel); | 500 showInline(this.controlRemove_, !showCancel); |
498 | 501 |
499 this.nodeSince_.textContent = this.since_; | 502 this.nodeSince_.textContent = this.since_; |
500 this.nodeDate_.textContent = this.date_; | 503 this.nodeDate_.textContent = this.date_; |
501 // Don't unnecessarily update the url, as doing so will remove any | 504 // Don't unnecessarily update the url, as doing so will remove any |
502 // text selection the user has started (http://crbug.com/44982). | 505 // text selection the user has started (http://crbug.com/44982). |
503 if (this.nodeURL_.textContent != this.url_) { | 506 if (this.nodeURL_.textContent != this.url_) { |
504 this.nodeURL_.textContent = this.url_; | 507 this.nodeURL_.textContent = this.url_; |
505 this.nodeURL_.href = this.url_; | 508 this.nodeURL_.href = this.url_; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 if (Date.now() - start > 50) { | 741 if (Date.now() - start > 50) { |
739 clearTimeout(resultsTimeout); | 742 clearTimeout(resultsTimeout); |
740 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); | 743 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); |
741 break; | 744 break; |
742 } | 745 } |
743 } | 746 } |
744 } | 747 } |
745 | 748 |
746 // Add handlers to HTML elements. | 749 // Add handlers to HTML elements. |
747 window.addEventListener('DOMContentLoaded', load); | 750 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |