Chromium Code Reviews| 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 1f9b9d0d944834e12ff9375c0d475115c83aeb8f..a2a851b47994831e90eb3d6a60b3169312a9d7f5 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 oneself to all download items as an observer. |
|
Peter Kasting
2011/06/14 18:26:06
Nit: oneself -> ourself
haraken1
2011/06/15 00:59:29
Done.
|
| 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) { |