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

Unified Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 7859001: Added ability to set ChromeDownloadManagerDelegate for testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Again. Created 9 years, 3 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/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/off_the_record_profile_impl.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index c227cef02336cd1db1d299f11bf0ad304801ece8..60a9846df1ee88b168712826f7bfab3c61073a50 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -326,7 +326,10 @@ TemplateURLFetcher* OffTheRecordProfileImpl::GetTemplateURLFetcher() {
DownloadManager* OffTheRecordProfileImpl::GetDownloadManager() {
if (!download_manager_.get()) {
- 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()));
@@ -615,6 +618,11 @@ void OffTheRecordProfileImpl::Observe(int type,
}
}
+void OffTheRecordProfileImpl::SetDownloadManagerDelegate(
+ ChromeDownloadManagerDelegate* delegate) {
+ download_manager_delegate_ = delegate;
+}
+
void OffTheRecordProfileImpl::CreateQuotaManagerAndClients() {
if (quota_manager_.get()) {
DCHECK(file_system_context_.get());
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_impl.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698