| Index: chrome/browser/download/chrome_download_manager_delegate.cc
|
| ===================================================================
|
| --- chrome/browser/download/chrome_download_manager_delegate.cc (revision 140592)
|
| +++ chrome/browser/download/chrome_download_manager_delegate.cc (working copy)
|
| @@ -57,6 +57,7 @@
|
| #include "chrome/browser/download/save_package_file_picker_chromeos.h"
|
| #endif
|
|
|
| +using content::BrowserContext;
|
| using content::BrowserThread;
|
| using content::DownloadId;
|
| using content::DownloadItem;
|
| @@ -104,19 +105,16 @@
|
| : profile_(profile),
|
| next_download_id_(0),
|
| download_prefs_(new DownloadPrefs(profile->GetPrefs())) {
|
| -}
|
| -
|
| -ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
|
| -}
|
| -
|
| -void ChromeDownloadManagerDelegate::SetDownloadManager(DownloadManager* dm) {
|
| - download_manager_ = dm;
|
| + download_manager_ = BrowserContext::GetDownloadManager(profile_);
|
| download_history_.reset(new DownloadHistory(profile_));
|
| download_history_->Load(
|
| base::Bind(&DownloadManager::OnPersistentStoreQueryComplete,
|
| - base::Unretained(dm)));
|
| + base::Unretained(download_manager_.get())));
|
| }
|
|
|
| +ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() {
|
| +}
|
| +
|
| void ChromeDownloadManagerDelegate::Shutdown() {
|
| download_history_.reset();
|
| download_prefs_.reset();
|
| @@ -126,8 +124,8 @@
|
| if (!profile_->IsOffTheRecord())
|
| return DownloadId(this, next_download_id_++);
|
|
|
| - return profile_->GetOriginalProfile()->GetDownloadManager()->delegate()->
|
| - GetNextId();
|
| + return BrowserContext::GetDownloadManager(profile_->GetOriginalProfile())->
|
| + delegate()->GetNextId();
|
| }
|
|
|
| bool ChromeDownloadManagerDelegate::ShouldStartDownload(int32 download_id) {
|
|
|