Chromium Code Reviews

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: Remove REMOVED state from Download.States in downloads.js Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 108aa7a61c8a92da13f4054169177ee2a817d6d8..713756f959929214a1226668bf2665f9acc543bc 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -665,6 +665,8 @@ DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) {
file_value->SetString("url", download->GetURL().spec());
file_value->SetBoolean("otr", download->is_otr());
file_value->SetInteger("total", static_cast<int>(download->total_bytes()));
+ file_value->SetBoolean("file_externally_removed",
+ download->file_externally_removed());
if (download->IsInProgress()) {
if (download->safety_state() == DownloadItem::DANGEROUS) {
@@ -701,11 +703,10 @@ 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->safety_state() == DownloadItem::DANGEROUS)
file_value->SetString("state", "DANGEROUS");
- } else {
+ else
file_value->SetString("state", "COMPLETE");
- }
} else if (download->state() == DownloadItem::REMOVING) {
file_value->SetString("state", "REMOVING");
} else {

Powered by Google App Engine