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

Unified Diff: chrome/browser/download/download_util.cc

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/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 72a0b92176a75a9d30106a08755e7c12ca0e4f01..b71bc7f3bc5eff4c26fdb0de7fa4b739124a240e 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -662,7 +662,9 @@ DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) {
} else if (download->IsCancelled()) {
file_value->SetString("state", "CANCELLED");
} else if (download->IsComplete()) {
- if (download->safety_state() == DownloadItem::DANGEROUS) {
+ if (!download->file_exists()) {
+ file_value->SetString("state", "REMOVED");
+ } else if (download->safety_state() == DownloadItem::DANGEROUS) {
file_value->SetString("state", "DANGEROUS");
} else {
file_value->SetString("state", "COMPLETE");

Powered by Google App Engine
This is Rietveld 408576698