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

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler.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: Merge with the latest revision Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/webui/downloads_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 82b12d0a7825eac167bd0e41e7212e8169e39d8f..50d816a83b80cc38f88995b597326956b57b41d2 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -124,20 +124,12 @@ void DownloadsDOMHandler::ModelChanged() {
&download_items_);
sort(download_items_.begin(), download_items_.end(), DownloadItemSorter());
- // Scan for any in progress downloads and add ourself to them as an observer.
+ // Add ourself to all download items as an observer.
for (OrderedDownloads::iterator it = download_items_.begin();
it != download_items_.end(); ++it) {
if (static_cast<int>(it - download_items_.begin()) > kMaxDownloads)
break;
-
- DownloadItem* download = *it;
- if (download->IsInProgress()) {
- // We want to know what happens as the download progresses.
- download->AddObserver(this);
- } else if (download->safety_state() == DownloadItem::DANGEROUS) {
- // We need to be notified when the user validates the dangerous download.
- download->AddObserver(this);
- }
+ (*it)->AddObserver(this);
}
SendCurrentDownloads();
@@ -151,6 +143,8 @@ void DownloadsDOMHandler::HandleGetDownloads(const ListValue* args) {
} else {
SendCurrentDownloads();
}
+
+ download_manager_->CheckForHistoryFilesRemoval();
}
void DownloadsDOMHandler::HandleOpenFile(const ListValue* args) {
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/webui/downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698