OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 | 1342 |
1343 if (!ps || !ps->Init()) { | 1343 if (!ps || !ps->Init()) { |
1344 NOTREACHED() << "Could not initialize password manager."; | 1344 NOTREACHED() << "Could not initialize password manager."; |
1345 return; | 1345 return; |
1346 } | 1346 } |
1347 password_store_.swap(ps); | 1347 password_store_.swap(ps); |
1348 } | 1348 } |
1349 | 1349 |
1350 DownloadManager* ProfileImpl::GetDownloadManager() { | 1350 DownloadManager* ProfileImpl::GetDownloadManager() { |
1351 if (!created_download_manager_) { | 1351 if (!created_download_manager_) { |
1352 download_manager_delegate_= new ChromeDownloadManagerDelegate(this); | 1352 // In case the delegate has already been set by SetDownloadManagerDelegate. |
| 1353 if (!download_manager_delegate_.get()) |
| 1354 download_manager_delegate_= new ChromeDownloadManagerDelegate(this); |
1353 scoped_refptr<DownloadManager> dlm( | 1355 scoped_refptr<DownloadManager> dlm( |
1354 new DownloadManager(download_manager_delegate_, | 1356 new DownloadManager(download_manager_delegate_, |
1355 g_browser_process->download_status_updater())); | 1357 g_browser_process->download_status_updater())); |
1356 dlm->Init(this); | 1358 dlm->Init(this); |
1357 download_manager_delegate_->SetDownloadManager(dlm); | 1359 download_manager_delegate_->SetDownloadManager(dlm); |
1358 created_download_manager_ = true; | 1360 created_download_manager_ = true; |
1359 download_manager_.swap(dlm); | 1361 download_manager_.swap(dlm); |
1360 } | 1362 } |
1361 return download_manager_.get(); | 1363 return download_manager_.get(); |
1362 } | 1364 } |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1817 | 1819 |
1818 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { | 1820 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { |
1819 return predictor_; | 1821 return predictor_; |
1820 } | 1822 } |
1821 | 1823 |
1822 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1824 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1823 if (!spellcheck_profile_.get()) | 1825 if (!spellcheck_profile_.get()) |
1824 spellcheck_profile_.reset(new SpellCheckProfile()); | 1826 spellcheck_profile_.reset(new SpellCheckProfile()); |
1825 return spellcheck_profile_.get(); | 1827 return spellcheck_profile_.get(); |
1826 } | 1828 } |
| 1829 |
| 1830 void ProfileImpl::SetDownloadManagerDelegate( |
| 1831 ChromeDownloadManagerDelegate* delegate) { |
| 1832 download_manager_delegate_ = delegate; |
| 1833 } |
OLD | NEW |