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

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

Issue 11673003: UI changes associated with downloads resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged from DownloadsResumption; includes CanResumeDownload, which was nuked in the original CL. Created 7 years, 11 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
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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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);
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf_context_menu.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698