| 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 // TODO(hcarmona): This file is big: it may be good to split it up. | 6 // TODO(hcarmona): This file is big: it may be good to split it up. |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * The type of the download object. The definition is based on | 9 * The type of the download object. The definition is based on |
| 10 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue() | 10 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue() |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 this.nodeFileLink_.oncontextmenu = null; | 683 this.nodeFileLink_.oncontextmenu = null; |
| 684 } else if (this.nodeFileName_.textContent != this.fileName_) { | 684 } else if (this.nodeFileName_.textContent != this.fileName_) { |
| 685 this.nodeFileName_.textContent = this.fileName_; | 685 this.nodeFileName_.textContent = this.fileName_; |
| 686 } | 686 } |
| 687 if (this.state_ == Download.States.INTERRUPTED) { | 687 if (this.state_ == Download.States.INTERRUPTED) { |
| 688 this.nodeFileName_.classList.add('interrupted'); | 688 this.nodeFileName_.classList.add('interrupted'); |
| 689 } else if (this.nodeFileName_.classList.contains('interrupted')) { | 689 } else if (this.nodeFileName_.classList.contains('interrupted')) { |
| 690 this.nodeFileName_.classList.remove('interrupted'); | 690 this.nodeFileName_.classList.remove('interrupted'); |
| 691 } | 691 } |
| 692 | 692 |
| 693 showInline(this.nodeFileLink_, | 693 showInlineBlock(this.nodeFileLink_, |
| 694 this.state_ == Download.States.COMPLETE && | 694 this.state_ == Download.States.COMPLETE && |
| 695 !this.fileExternallyRemoved_); | 695 !this.fileExternallyRemoved_); |
| 696 // nodeFileName_ has to be inline-block to avoid the 'interaction' with | 696 // nodeFileName_ has to be inline-block to avoid the 'interaction' with |
| 697 // nodeStatus_. If both are inline, it appears that their text contents | 697 // nodeStatus_. If both are inline, it appears that their text contents |
| 698 // are merged before the bidi algorithm is applied leading to an | 698 // are merged before the bidi algorithm is applied leading to an |
| 699 // undesirable reordering. http://crbug.com/13216 | 699 // undesirable reordering. http://crbug.com/13216 |
| 700 showInlineBlock(this.nodeFileName_, | 700 showInlineBlock(this.nodeFileName_, |
| 701 this.state_ != Download.States.COMPLETE || | 701 this.state_ != Download.States.COMPLETE || |
| 702 this.fileExternallyRemoved_); | 702 this.fileExternallyRemoved_); |
| 703 | 703 |
| 704 if (this.state_ == Download.States.IN_PROGRESS) { | 704 if (this.state_ == Download.States.IN_PROGRESS) { |
| 705 this.nodeProgressForeground_.style.display = 'block'; | 705 this.nodeProgressForeground_.style.display = 'block'; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 if (Date.now() - start > 50) { | 1100 if (Date.now() - start > 50) { |
| 1101 clearTimeout(resultsTimeout); | 1101 clearTimeout(resultsTimeout); |
| 1102 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); | 1102 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); |
| 1103 break; | 1103 break; |
| 1104 } | 1104 } |
| 1105 } | 1105 } |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 // Add handlers to HTML elements. | 1108 // Add handlers to HTML elements. |
| 1109 window.addEventListener('DOMContentLoaded', load); | 1109 window.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |