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

Unified Diff: chrome/browser/resources/downloads.html

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct typo Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/downloads.html
diff --git a/chrome/browser/resources/downloads.html b/chrome/browser/resources/downloads.html
index 97952fb100f85921057740fafdb1cd68970fc648..912d8ab7effa831de8eb1b01675c46baa1451020 100644
--- a/chrome/browser/resources/downloads.html
+++ b/chrome/browser/resources/downloads.html
@@ -463,6 +463,7 @@ Download.States = {
IN_PROGRESS : "IN_PROGRESS",
CANCELLED : "CANCELLED",
COMPLETE : "COMPLETE",
+ REMOVED : "REMOVED",
PAUSED : "PAUSED",
DANGEROUS : "DANGEROUS",
INTERRUPTED : "INTERRUPTED",
@@ -499,7 +500,10 @@ Download.prototype.update = function(download) {
this.filePath_ = download.file_path;
this.fileName_ = download.file_name;
this.url_ = download.url;
- this.state_ = download.state;
+ // This code is tricky and is not so good. See issue 6905049 for more details.
Paweł Hajdan Jr. 2011/05/13 08:41:10 No no, I think we have enough hacks in the downloa
haraken1 2011/05/13 14:08:17 I would like to postpone to fix this hack. As Rand
Randy Smith (Not in Mondays) 2011/05/13 20:45:32 haraken: I'm afraid I want to support Pawel on thi
+ if (this.state_ != Download.States.REMOVED) {
+ this.state_ = download.state;
+ }
this.dangerType_ = download.danger_type;
this.since_ = download.since_string;
@@ -617,6 +621,8 @@ Download.prototype.getStatusText_ = function() {
return this.progressStatusText_;
case Download.States.CANCELLED:
return localStrings.getString('status_cancelled');
+ case Download.States.REMOVED:
+ return localStrings.getString('status_removed');
case Download.States.PAUSED:
return localStrings.getString('status_paused');
case Download.States.DANGEROUS:

Powered by Google App Engine
This is Rietveld 408576698