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 75209330acf6281ba5b485dfafc317ea080ddd0d..77cc2492282c1a22ea73c093a2f4b00a3b4ad165 100644 |
| --- a/chrome/browser/ui/webui/downloads_dom_handler.cc |
| +++ b/chrome/browser/ui/webui/downloads_dom_handler.cc |
| @@ -119,20 +119,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 |
|
Paweł Hajdan Jr.
2011/05/13 08:41:10
nit: Dot at the end of the sentence.
haraken1
2011/05/13 14:08:17
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(); |
| @@ -146,6 +138,8 @@ void DownloadsDOMHandler::HandleGetDownloads(const ListValue* args) { |
| } else { |
| SendCurrentDownloads(); |
| } |
| + |
| + download_manager_->CheckForFilesRemoval(); |
| } |
| void DownloadsDOMHandler::HandleOpenFile(const ListValue* args) { |