Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 1ddbd122895ac883110c5486aaebf3e1754d3f95..46a929c283c923c6787458da922c317c6e4d3889 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -1264,7 +1264,9 @@ void ProfileImpl::CreatePasswordStore() { |
DownloadManager* ProfileImpl::GetDownloadManager() { |
if (!created_download_manager_) { |
- download_manager_delegate_= new ChromeDownloadManagerDelegate(this); |
+ // In case the delegate has already been set by SetDownloadManagerDelegate. |
+ if (!download_manager_delegate_.get()) |
+ download_manager_delegate_= new ChromeDownloadManagerDelegate(this); |
scoped_refptr<DownloadManager> dlm( |
new DownloadManager(download_manager_delegate_, |
g_browser_process->download_status_updater())); |
@@ -1735,3 +1737,8 @@ SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
spellcheck_profile_.reset(new SpellCheckProfile()); |
return spellcheck_profile_.get(); |
} |
+ |
+void ProfileImpl::SetDownloadManagerDelegate( |
+ ChromeDownloadManagerDelegate* delegate) { |
+ download_manager_delegate_ = delegate; |
+} |