summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/download/download_manager.cc3
-rw-r--r--chrome/browser/views/download_tab_view.cc7
2 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index ed4ebb0..e10173d 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -954,10 +954,11 @@ void DownloadManager::RemoveDownload(int64 download_handle) {
it = dangerous_finished_.find(download->id());
if (it != dangerous_finished_.end())
dangerous_finished_.erase(it);
- delete download;
// Tell observers to refresh their views.
FOR_EACH_OBSERVER(Observer, observers_, ModelChanged());
+
+ delete download;
}
int DownloadManager::RemoveDownloadsBetween(const Time remove_begin,
diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc
index 6736ff6..6528fa5 100644
--- a/chrome/browser/views/download_tab_view.cc
+++ b/chrome/browser/views/download_tab_view.cc
@@ -955,8 +955,13 @@ void DownloadTabView::OnDownloadUpdated(DownloadItem* download) {
if (d != in_progress_.end()) {
// If this is a dangerous download not yet validated by the user, we
// still need to be notified when the validation happens.
- if (download->safety_state() != DownloadItem::DANGEROUS)
+ if (download->safety_state() != DownloadItem::DANGEROUS) {
(*d)->RemoveObserver(this);
+ } else {
+ // Add the download to dangerous_downloads_ so we call RemoveObserver
+ // on ClearDangerousDownloads().
+ dangerous_downloads_.insert(download);
+ }
in_progress_.erase(d);
}
if (in_progress_.empty())