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

Unified Diff: chrome/browser/download/download_status_updater.cc

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lint Created 8 years, 4 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/download/download_status_updater.h ('k') | chrome/browser/download/download_test_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_status_updater.cc
diff --git a/chrome/browser/download/download_status_updater.cc b/chrome/browser/download/download_status_updater.cc
index 817e4184268926339bd599dc431f2ca5429911e2..a8dde9bc561020cd4e156d21df5ccf8791f5e5dd 100644
--- a/chrome/browser/download/download_status_updater.cc
+++ b/chrome/browser/download/download_status_updater.cc
@@ -68,8 +68,6 @@ void DownloadStatusUpdater::ManagerGoingDown(
DCHECK(ContainsKey(managers_, manager));
managers_.erase(manager);
manager->RemoveObserver(this);
- // Item removal will be handled in response to DownloadItem REMOVING
- // notification (in the !IN_PROGRESS conditional branch in UpdateItem).
}
// Methods inherited from content::DownloadItem::Observer.
@@ -79,6 +77,15 @@ void DownloadStatusUpdater::OnDownloadUpdated(
UpdateAppIconDownloadProgress();
}
+void DownloadStatusUpdater::OnDownloadDestroyed(
+ content::DownloadItem* download) {
+ if (ContainsKey(items_, download)) {
+ items_.erase(download);
+ download->RemoveObserver(this);
+ }
+ UpdateAppIconDownloadProgress();
Randy Smith (Not in Mondays) 2012/08/09 17:03:44 I don't actually think you need this--OnDownloadDe
benjhayden 2012/08/09 18:35:06 I don't know this code, but it appears that UAIDP
Randy Smith (Not in Mondays) 2012/08/09 20:27:32 The major issue here is my distinction between the
+}
+
void DownloadStatusUpdater::OnDownloadOpened(content::DownloadItem* download) {
}
« no previous file with comments | « chrome/browser/download/download_status_updater.h ('k') | chrome/browser/download/download_test_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698