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.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 virtual PrefService* GetOffTheRecordPrefs() { | 457 virtual PrefService* GetOffTheRecordPrefs() { |
458 return prefs_; | 458 return prefs_; |
459 } | 459 } |
460 | 460 |
461 virtual TemplateURLFetcher* GetTemplateURLFetcher() { | 461 virtual TemplateURLFetcher* GetTemplateURLFetcher() { |
462 return profile_->GetTemplateURLFetcher(); | 462 return profile_->GetTemplateURLFetcher(); |
463 } | 463 } |
464 | 464 |
465 virtual DownloadManager* GetDownloadManager() { | 465 virtual DownloadManager* GetDownloadManager() { |
466 if (!download_manager_.get()) { | 466 if (!download_manager_.get()) { |
467 download_manager_delegate_.reset(new ChromeDownloadManagerDelegate()); | 467 download_manager_delegate_ = new ChromeDownloadManagerDelegate(); |
468 scoped_refptr<DownloadManager> dlm( | 468 scoped_refptr<DownloadManager> dlm( |
469 new DownloadManager(download_manager_delegate_.get(), | 469 new DownloadManager(download_manager_delegate_, |
470 g_browser_process->download_status_updater())); | 470 g_browser_process->download_status_updater())); |
471 download_manager_delegate_->set_download_manager(dlm); | 471 download_manager_delegate_->set_download_manager(dlm); |
472 dlm->Init(this); | 472 dlm->Init(this); |
473 download_manager_.swap(dlm); | 473 download_manager_.swap(dlm); |
474 } | 474 } |
475 return download_manager_.get(); | 475 return download_manager_.get(); |
476 } | 476 } |
477 | 477 |
478 virtual bool HasCreatedDownloadManager() const { | 478 virtual bool HasCreatedDownloadManager() const { |
479 return (download_manager_.get() != NULL); | 479 return (download_manager_.get() != NULL); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 | 788 |
789 // Weak pointer owned by |profile_|. | 789 // Weak pointer owned by |profile_|. |
790 PrefService* prefs_; | 790 PrefService* prefs_; |
791 | 791 |
792 scoped_ptr<ExtensionProcessManager> extension_process_manager_; | 792 scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
793 | 793 |
794 OffTheRecordProfileIOData::Handle io_data_; | 794 OffTheRecordProfileIOData::Handle io_data_; |
795 | 795 |
796 // Used so that Chrome code can influence how content module's DownloadManager | 796 // Used so that Chrome code can influence how content module's DownloadManager |
797 // functions. | 797 // functions. |
798 scoped_ptr<ChromeDownloadManagerDelegate> download_manager_delegate_; | 798 scoped_refptr<ChromeDownloadManagerDelegate> download_manager_delegate_; |
799 | 799 |
800 // The download manager that only stores downloaded items in memory. | 800 // The download manager that only stores downloaded items in memory. |
801 scoped_refptr<DownloadManager> download_manager_; | 801 scoped_refptr<DownloadManager> download_manager_; |
802 | 802 |
803 // We use a non-persistent content settings map for OTR. | 803 // We use a non-persistent content settings map for OTR. |
804 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 804 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
805 | 805 |
806 // Use a separate zoom map for OTR. | 806 // Use a separate zoom map for OTR. |
807 scoped_refptr<HostZoomMap> host_zoom_map_; | 807 scoped_refptr<HostZoomMap> host_zoom_map_; |
808 | 808 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 }; | 874 }; |
875 #endif | 875 #endif |
876 | 876 |
877 Profile* Profile::CreateOffTheRecordProfile() { | 877 Profile* Profile::CreateOffTheRecordProfile() { |
878 #if defined(OS_CHROMEOS) | 878 #if defined(OS_CHROMEOS) |
879 if (Profile::IsGuestSession()) | 879 if (Profile::IsGuestSession()) |
880 return new GuestSessionProfile(this); | 880 return new GuestSessionProfile(this); |
881 #endif | 881 #endif |
882 return new OffTheRecordProfileImpl(this); | 882 return new OffTheRecordProfileImpl(this); |
883 } | 883 } |
OLD | NEW |