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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Retrieve the host content settings map of the parent profile in order to | 537 // Retrieve the host content settings map of the parent profile in order to |
538 // ensure the preferences have been migrated. | 538 // ensure the preferences have been migrated. |
539 profile_->GetHostContentSettingsMap(); | 539 profile_->GetHostContentSettingsMap(); |
540 if (!host_content_settings_map_.get()) { | 540 if (!host_content_settings_map_.get()) { |
541 host_content_settings_map_ = new HostContentSettingsMap( | 541 host_content_settings_map_ = new HostContentSettingsMap( |
542 GetPrefs(), GetExtensionService(), true); | 542 GetPrefs(), GetExtensionService(), true); |
543 } | 543 } |
544 return host_content_settings_map_.get(); | 544 return host_content_settings_map_.get(); |
545 } | 545 } |
546 | 546 |
| 547 virtual CookieContentSettings* GetCookieContentSettings() { |
| 548 // Retrieve the host content settings map of the parent profile in order to |
| 549 // ensure the preferences have been migrated. |
| 550 profile_->GetHostContentSettingsMap(); |
| 551 if (!cookie_content_settings_.get()) { |
| 552 cookie_content_settings_ = new CookieContentSettings( |
| 553 GetHostContentSettingsMap(), GetPrefs(), true); |
| 554 } |
| 555 return cookie_content_settings_.get(); |
| 556 } |
| 557 |
547 virtual HostZoomMap* GetHostZoomMap() { | 558 virtual HostZoomMap* GetHostZoomMap() { |
548 if (!host_zoom_map_) | 559 if (!host_zoom_map_) |
549 host_zoom_map_ = new HostZoomMap(); | 560 host_zoom_map_ = new HostZoomMap(); |
550 return host_zoom_map_.get(); | 561 return host_zoom_map_.get(); |
551 } | 562 } |
552 | 563 |
553 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { | 564 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { |
554 return profile_->GetGeolocationPermissionContext(); | 565 return profile_->GetGeolocationPermissionContext(); |
555 } | 566 } |
556 | 567 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 // Used so that Chrome code can influence how content module's DownloadManager | 803 // Used so that Chrome code can influence how content module's DownloadManager |
793 // functions. | 804 // functions. |
794 scoped_refptr<ChromeDownloadManagerDelegate> download_manager_delegate_; | 805 scoped_refptr<ChromeDownloadManagerDelegate> download_manager_delegate_; |
795 | 806 |
796 // The download manager that only stores downloaded items in memory. | 807 // The download manager that only stores downloaded items in memory. |
797 scoped_refptr<DownloadManager> download_manager_; | 808 scoped_refptr<DownloadManager> download_manager_; |
798 | 809 |
799 // We use a non-persistent content settings map for OTR. | 810 // We use a non-persistent content settings map for OTR. |
800 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 811 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
801 | 812 |
| 813 scoped_refptr<CookieContentSettings> cookie_content_settings_; |
| 814 |
802 // Use a separate zoom map for OTR. | 815 // Use a separate zoom map for OTR. |
803 scoped_refptr<HostZoomMap> host_zoom_map_; | 816 scoped_refptr<HostZoomMap> host_zoom_map_; |
804 | 817 |
805 // Use a special WebKit context for OTR browsing. | 818 // Use a special WebKit context for OTR browsing. |
806 scoped_refptr<WebKitContext> webkit_context_; | 819 scoped_refptr<WebKitContext> webkit_context_; |
807 | 820 |
808 // We don't want SSLHostState from the OTR profile to leak back to the main | 821 // We don't want SSLHostState from the OTR profile to leak back to the main |
809 // profile because then the main profile would learn some of the host names | 822 // profile because then the main profile would learn some of the host names |
810 // the user visited while OTR. | 823 // the user visited while OTR. |
811 scoped_ptr<SSLHostState> ssl_host_state_; | 824 scoped_ptr<SSLHostState> ssl_host_state_; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 }; | 883 }; |
871 #endif | 884 #endif |
872 | 885 |
873 Profile* Profile::CreateOffTheRecordProfile() { | 886 Profile* Profile::CreateOffTheRecordProfile() { |
874 #if defined(OS_CHROMEOS) | 887 #if defined(OS_CHROMEOS) |
875 if (Profile::IsGuestSession()) | 888 if (Profile::IsGuestSession()) |
876 return new GuestSessionProfile(this); | 889 return new GuestSessionProfile(this); |
877 #endif | 890 #endif |
878 return new OffTheRecordProfileImpl(this); | 891 return new OffTheRecordProfileImpl(this); |
879 } | 892 } |
OLD | NEW |