diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 20:59:51 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 20:59:51 +0000 |
commit | 08ef5bcfb8c4acb8a2f16b13b4b013203b210fae (patch) | |
tree | 4c73ae632af16896aa2b89bd13cc9f1402a16c61 /chrome/browser/download | |
parent | fad00de4a264f6b695b4127bbe20be4eb24e5754 (diff) | |
download | chromium_src-08ef5bcfb8c4acb8a2f16b13b4b013203b210fae.zip chromium_src-08ef5bcfb8c4acb8a2f16b13b4b013203b210fae.tar.gz chromium_src-08ef5bcfb8c4acb8a2f16b13b4b013203b210fae.tar.bz2 |
Revert 121031 - Eliminate DownloadProgressUpdated.
content::DownloadManagerDelegate::DownloadProgressUpdated was called out of sync with the content::DownloadItem::Observer calls. Eliminate it, as the notification that it provides is anti-useful.
BUG=112841
TEST=as in bug
Review URL: https://chromiumcodereview.appspot.com/9363001
TBR=avi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9361046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
4 files changed, 15 insertions, 17 deletions
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc index 433800a..04746e5 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc @@ -296,6 +296,19 @@ void ChromeDownloadManagerDelegate::ChooseSavePath( download_prefs_.get(), callback); } +void ChromeDownloadManagerDelegate::DownloadProgressUpdated() { + if (!g_browser_process->download_status_updater()) + return; + + float progress = 0; + int download_count = 0; + bool progress_known = + g_browser_process->download_status_updater()->GetProgress( + &progress, &download_count); + download_util::UpdateAppIconDownloadProgress( + download_count, progress_known, progress); +} + #if defined(ENABLE_SAFE_BROWSING) DownloadProtectionService* ChromeDownloadManagerDelegate::GetDownloadProtectionService() { diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h index 7346c73..6d7c6ea 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.h +++ b/chrome/browser/download/chrome_download_manager_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -86,6 +86,7 @@ class ChromeDownloadManagerDelegate const FilePath::StringType& default_extension, bool can_save_as_complete, content::SaveFilePathPickedCallback callback) OVERRIDE; + virtual void DownloadProgressUpdated() OVERRIDE; DownloadPrefs* download_prefs() { return download_prefs_.get(); } DownloadHistory* download_history() { return download_history_.get(); } diff --git a/chrome/browser/download/download_status_updater.cc b/chrome/browser/download/download_status_updater.cc index 2bbb045..d06df41 100644 --- a/chrome/browser/download/download_status_updater.cc +++ b/chrome/browser/download/download_status_updater.cc @@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/stl_util.h" -#include "chrome/browser/download/download_util.h" DownloadStatusUpdater::DownloadStatusUpdater() { } @@ -59,8 +58,6 @@ void DownloadStatusUpdater::ModelChanged(content::DownloadManager* manager) { it != downloads.end(); ++it) { UpdateItem(*it); } - - UpdateAppIconDownloadProgress(); } void DownloadStatusUpdater::ManagerGoingDown( @@ -80,21 +77,11 @@ 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 diff --git a/chrome/browser/download/download_status_updater.h b/chrome/browser/download/download_status_updater.h index 8fa892ba..d220163 100644 --- a/chrome/browser/download/download_status_updater.h +++ b/chrome/browser/download/download_status_updater.h @@ -43,9 +43,6 @@ class DownloadStatusUpdater virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; private: - // Update the app icon. - void UpdateAppIconDownloadProgress(); - // Update the internal state tracking an item. void UpdateItem(content::DownloadItem* download); |