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

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

Issue 9363001: Eliminate DownloadProgressUpdated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests work Created 8 years, 10 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
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 d06df410895ef70a4ff5cfc46b214f2454f659c1..2bbb045f70f0d6bc682ff0e36a7aff36b1db7d7e 100644
--- a/chrome/browser/download/download_status_updater.cc
+++ b/chrome/browser/download/download_status_updater.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/stl_util.h"
+#include "chrome/browser/download/download_util.h"
DownloadStatusUpdater::DownloadStatusUpdater() {
}
@@ -58,6 +59,8 @@ void DownloadStatusUpdater::ModelChanged(content::DownloadManager* manager) {
it != downloads.end(); ++it) {
UpdateItem(*it);
}
+
+ UpdateAppIconDownloadProgress();
}
void DownloadStatusUpdater::ManagerGoingDown(
@@ -77,11 +80,21 @@ void DownloadStatusUpdater::SelectFileDialogDisplayed(
void DownloadStatusUpdater::OnDownloadUpdated(
content::DownloadItem* download) {
UpdateItem(download);
+ UpdateAppIconDownloadProgress();
}
void DownloadStatusUpdater::OnDownloadOpened(content::DownloadItem* download) {
}
+void DownloadStatusUpdater::UpdateAppIconDownloadProgress() {
+ float progress = 0;
+ int download_count = 0;
+ bool progress_known = GetProgress(&progress, &download_count);
+ download_util::UpdateAppIconDownloadProgress(download_count,
+ progress_known,
+ progress);
+}
+
// React to a transition that a download associated with one of our
// download managers has made. Our goal is to have only IN_PROGRESS
// items on our set list, as they're the only ones that have relevance
« no previous file with comments | « chrome/browser/download/download_status_updater.h ('k') | chrome/browser/download/download_status_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698