Chromium Code Reviews| 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 730 | 730 |
| 731 if (extension_message_service_) | 731 if (extension_message_service_) |
| 732 extension_message_service_->DestroyingProfile(); | 732 extension_message_service_->DestroyingProfile(); |
| 733 | 733 |
| 734 if (pref_proxy_config_tracker_) | 734 if (pref_proxy_config_tracker_) |
| 735 pref_proxy_config_tracker_->DetachFromPrefService(); | 735 pref_proxy_config_tracker_->DetachFromPrefService(); |
| 736 | 736 |
| 737 if (protocol_handler_registry_) | 737 if (protocol_handler_registry_) |
| 738 protocol_handler_registry_->Finalize(); | 738 protocol_handler_registry_->Finalize(); |
| 739 | 739 |
| 740 if (cookie_content_settings_) | |
| 741 cookie_content_settings_->ShutdownOnUIThread(); | |
| 742 | |
| 740 if (host_content_settings_map_) | 743 if (host_content_settings_map_) |
| 741 host_content_settings_map_->ShutdownOnUIThread(); | 744 host_content_settings_map_->ShutdownOnUIThread(); |
| 742 | 745 |
| 743 // This causes the Preferences file to be written to disk. | 746 // This causes the Preferences file to be written to disk. |
| 744 MarkAsCleanShutdown(); | 747 MarkAsCleanShutdown(); |
| 745 } | 748 } |
| 746 | 749 |
| 747 std::string ProfileImpl::GetProfileName() { | 750 std::string ProfileImpl::GetProfileName() { |
| 748 return GetPrefs()->GetString(prefs::kGoogleServicesUsername); | 751 return GetPrefs()->GetString(prefs::kGoogleServicesUsername); |
| 749 } | 752 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 825 } | 828 } |
| 826 | 829 |
| 827 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { | 830 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { |
| 828 return extension_event_router_.get(); | 831 return extension_event_router_.get(); |
| 829 } | 832 } |
| 830 | 833 |
| 831 ExtensionSpecialStoragePolicy* | 834 ExtensionSpecialStoragePolicy* |
| 832 ProfileImpl::GetExtensionSpecialStoragePolicy() { | 835 ProfileImpl::GetExtensionSpecialStoragePolicy() { |
| 833 if (!extension_special_storage_policy_.get()) { | 836 if (!extension_special_storage_policy_.get()) { |
| 834 extension_special_storage_policy_ = | 837 extension_special_storage_policy_ = |
| 835 new ExtensionSpecialStoragePolicy(GetHostContentSettingsMap()); | 838 new ExtensionSpecialStoragePolicy(GetCookieContentSettings()); |
| 836 } | 839 } |
| 837 return extension_special_storage_policy_.get(); | 840 return extension_special_storage_policy_.get(); |
| 838 } | 841 } |
| 839 | 842 |
| 840 SSLHostState* ProfileImpl::GetSSLHostState() { | 843 SSLHostState* ProfileImpl::GetSSLHostState() { |
| 841 if (!ssl_host_state_.get()) | 844 if (!ssl_host_state_.get()) |
| 842 ssl_host_state_.reset(new SSLHostState()); | 845 ssl_host_state_.reset(new SSLHostState()); |
| 843 | 846 |
| 844 DCHECK(ssl_host_state_->CalledOnValidThread()); | 847 DCHECK(ssl_host_state_->CalledOnValidThread()); |
| 845 return ssl_host_state_.get(); | 848 return ssl_host_state_.get(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1008 | 1011 |
| 1009 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 1012 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
| 1010 return ssl_config_service_manager_->Get(); | 1013 return ssl_config_service_manager_->Get(); |
| 1011 } | 1014 } |
| 1012 | 1015 |
| 1013 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 1016 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
| 1014 if (!host_content_settings_map_.get()) { | 1017 if (!host_content_settings_map_.get()) { |
| 1015 host_content_settings_map_ = new HostContentSettingsMap( | 1018 host_content_settings_map_ = new HostContentSettingsMap( |
| 1016 GetPrefs(), GetExtensionService(), false); | 1019 GetPrefs(), GetExtensionService(), false); |
| 1017 } | 1020 } |
| 1021 // Create CookieContentSettings, too, since it takes care of migrating | |
|
markusheintz_
2011/08/24 12:29:40
Are you sure about this? If you only read cookie s
marja
2011/08/25 13:56:11
There was a unit test depending on this, and only
| |
| 1022 // preferences to HostContentSettingsMap. | |
| 1023 if (!cookie_content_settings_.get()) { | |
| 1024 cookie_content_settings_ = new CookieContentSettings( | |
| 1025 host_content_settings_map_.get(), GetPrefs(), false); | |
| 1026 } | |
| 1018 return host_content_settings_map_.get(); | 1027 return host_content_settings_map_.get(); |
| 1019 } | 1028 } |
| 1020 | 1029 |
| 1030 CookieContentSettings* ProfileImpl::GetCookieContentSettings() { | |
| 1031 GetHostContentSettingsMap(); | |
| 1032 return cookie_content_settings_.get(); | |
| 1033 } | |
| 1034 | |
| 1021 HostZoomMap* ProfileImpl::GetHostZoomMap() { | 1035 HostZoomMap* ProfileImpl::GetHostZoomMap() { |
| 1022 if (!host_zoom_map_) { | 1036 if (!host_zoom_map_) { |
| 1023 host_zoom_map_ = new HostZoomMap(); | 1037 host_zoom_map_ = new HostZoomMap(); |
| 1024 host_zoom_map_->set_default_zoom_level( | 1038 host_zoom_map_->set_default_zoom_level( |
| 1025 GetPrefs()->GetDouble(prefs::kDefaultZoomLevel)); | 1039 GetPrefs()->GetDouble(prefs::kDefaultZoomLevel)); |
| 1026 | 1040 |
| 1027 const DictionaryValue* host_zoom_dictionary = | 1041 const DictionaryValue* host_zoom_dictionary = |
| 1028 prefs_->GetDictionary(prefs::kPerHostZoomLevels); | 1042 prefs_->GetDictionary(prefs::kPerHostZoomLevels); |
| 1029 // Careful: The returned value could be NULL if the pref has never been set. | 1043 // Careful: The returned value could be NULL if the pref has never been set. |
| 1030 if (host_zoom_dictionary != NULL) { | 1044 if (host_zoom_dictionary != NULL) { |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1721 #endif | 1735 #endif |
| 1722 } | 1736 } |
| 1723 return prerender_manager_.get(); | 1737 return prerender_manager_.get(); |
| 1724 } | 1738 } |
| 1725 | 1739 |
| 1726 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1740 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
| 1727 if (!spellcheck_profile_.get()) | 1741 if (!spellcheck_profile_.get()) |
| 1728 spellcheck_profile_.reset(new SpellCheckProfile()); | 1742 spellcheck_profile_.reset(new SpellCheckProfile()); |
| 1729 return spellcheck_profile_.get(); | 1743 return spellcheck_profile_.get(); |
| 1730 } | 1744 } |
| OLD | NEW |