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

Side by Side Diff: chrome/browser/resources/downloads/downloads.js

Issue 14958003: [Resumption 12/12] Support resuming interrupted downloads from the downloads page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | chrome/browser/ui/webui/downloads_dom_handler.cc » ('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 // 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 505
506 if (this.controlShow_) { 506 if (this.controlShow_) {
507 showInline(this.controlShow_, 507 showInline(this.controlShow_,
508 this.state_ == Download.States.COMPLETE && 508 this.state_ == Download.States.COMPLETE &&
509 !this.fileExternallyRemoved_); 509 !this.fileExternallyRemoved_);
510 } 510 }
511 showInline(this.controlRetry_, download.retry); 511 showInline(this.controlRetry_, download.retry);
512 this.controlRetry_.href = this.url_; 512 this.controlRetry_.href = this.url_;
513 showInline(this.controlPause_, this.state_ == Download.States.IN_PROGRESS); 513 showInline(this.controlPause_, this.state_ == Download.States.IN_PROGRESS);
514 showInline(this.controlResume_, this.state_ == Download.States.PAUSED); 514 showInline(this.controlResume_, download.resume);
515 var showCancel = this.state_ == Download.States.IN_PROGRESS || 515 var showCancel = this.state_ == Download.States.IN_PROGRESS ||
516 this.state_ == Download.States.PAUSED; 516 this.state_ == Download.States.PAUSED;
517 showInline(this.controlCancel_, showCancel); 517 showInline(this.controlCancel_, showCancel);
518 showInline(this.controlRemove_, !showCancel); 518 showInline(this.controlRemove_, !showCancel);
519 519
520 this.nodeSince_.textContent = this.since_; 520 this.nodeSince_.textContent = this.since_;
521 this.nodeDate_.textContent = this.date_; 521 this.nodeDate_.textContent = this.date_;
522 // Don't unnecessarily update the url, as doing so will remove any 522 // Don't unnecessarily update the url, as doing so will remove any
523 // text selection the user has started (http://crbug.com/44982). 523 // text selection the user has started (http://crbug.com/44982).
524 if (this.nodeURL_.textContent != this.url_) { 524 if (this.nodeURL_.textContent != this.url_) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 if (Date.now() - start > 50) { 784 if (Date.now() - start > 50) {
785 clearTimeout(resultsTimeout); 785 clearTimeout(resultsTimeout);
786 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); 786 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5);
787 break; 787 break;
788 } 788 }
789 } 789 }
790 } 790 }
791 791
792 // Add handlers to HTML elements. 792 // Add handlers to HTML elements.
793 window.addEventListener('DOMContentLoaded', load); 793 window.addEventListener('DOMContentLoaded', load);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698