OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/background/background_contents_service_factory.h" | 31 #include "chrome/browser/background/background_contents_service_factory.h" |
32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
33 #include "chrome/browser/browser_process.h" | 33 #include "chrome/browser/browser_process.h" |
34 #include "chrome/browser/chrome_notification_types.h" | 34 #include "chrome/browser/chrome_notification_types.h" |
35 #include "chrome/browser/content_settings/cookie_settings.h" | 35 #include "chrome/browser/content_settings/cookie_settings.h" |
36 #include "chrome/browser/dom_distiller/profile_utils.h" | 36 #include "chrome/browser/dom_distiller/profile_utils.h" |
37 #include "chrome/browser/domain_reliability/service_factory.h" | 37 #include "chrome/browser/domain_reliability/service_factory.h" |
38 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 38 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
39 #include "chrome/browser/download/download_service.h" | 39 #include "chrome/browser/download/download_service.h" |
40 #include "chrome/browser/download/download_service_factory.h" | 40 #include "chrome/browser/download/download_service_factory.h" |
41 #include "chrome/browser/history/top_sites.h" | |
42 #include "chrome/browser/net/chrome_net_log.h" | 41 #include "chrome/browser/net/chrome_net_log.h" |
43 #include "chrome/browser/net/net_pref_observer.h" | 42 #include "chrome/browser/net/net_pref_observer.h" |
44 #include "chrome/browser/net/predictor.h" | 43 #include "chrome/browser/net/predictor.h" |
45 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 44 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
46 #include "chrome/browser/net/proxy_service_factory.h" | 45 #include "chrome/browser/net/proxy_service_factory.h" |
47 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 46 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
48 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 47 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
49 #include "chrome/browser/net/ssl_config_service_manager.h" | 48 #include "chrome/browser/net/ssl_config_service_manager.h" |
50 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 49 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
51 #include "chrome/browser/plugins/plugin_prefs.h" | 50 #include "chrome/browser/plugins/plugin_prefs.h" |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 } else { | 818 } else { |
820 #if defined(ENABLE_EXTENSIONS) | 819 #if defined(ENABLE_EXTENSIONS) |
821 ExtensionPrefValueMapFactory::GetForBrowserContext(this)-> | 820 ExtensionPrefValueMapFactory::GetForBrowserContext(this)-> |
822 ClearAllIncognitoSessionOnlyPreferences(); | 821 ClearAllIncognitoSessionOnlyPreferences(); |
823 #endif | 822 #endif |
824 } | 823 } |
825 | 824 |
826 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( | 825 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( |
827 this); | 826 this); |
828 | 827 |
829 if (top_sites_.get()) | |
830 top_sites_->Shutdown(); | |
831 | |
832 if (pref_proxy_config_tracker_) | 828 if (pref_proxy_config_tracker_) |
833 pref_proxy_config_tracker_->DetachFromPrefService(); | 829 pref_proxy_config_tracker_->DetachFromPrefService(); |
834 | 830 |
835 if (host_content_settings_map_.get()) | 831 if (host_content_settings_map_.get()) |
836 host_content_settings_map_->ShutdownOnUIThread(); | 832 host_content_settings_map_->ShutdownOnUIThread(); |
837 | 833 |
838 // This causes the Preferences file to be written to disk. | 834 // This causes the Preferences file to be written to disk. |
839 if (prefs_loaded) | 835 if (prefs_loaded) |
840 SetExitType(EXIT_NORMAL); | 836 SetExitType(EXIT_NORMAL); |
841 } | 837 } |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 if (profile == static_cast<Profile*>(this)) | 1160 if (profile == static_cast<Profile*>(this)) |
1165 return true; | 1161 return true; |
1166 Profile* otr_profile = off_the_record_profile_.get(); | 1162 Profile* otr_profile = off_the_record_profile_.get(); |
1167 return otr_profile && profile == otr_profile; | 1163 return otr_profile && profile == otr_profile; |
1168 } | 1164 } |
1169 | 1165 |
1170 Time ProfileImpl::GetStartTime() const { | 1166 Time ProfileImpl::GetStartTime() const { |
1171 return start_time_; | 1167 return start_time_; |
1172 } | 1168 } |
1173 | 1169 |
1174 history::TopSites* ProfileImpl::GetTopSites() { | |
1175 if (!top_sites_.get()) { | |
1176 top_sites_ = history::TopSites::Create( | |
1177 this, GetPath().Append(chrome::kTopSitesFilename)); | |
1178 } | |
1179 return top_sites_.get(); | |
1180 } | |
1181 | |
1182 history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() { | |
1183 return top_sites_.get(); | |
1184 } | |
1185 | |
1186 #if defined(ENABLE_SESSION_SERVICE) | 1170 #if defined(ENABLE_SESSION_SERVICE) |
1187 void ProfileImpl::StopCreateSessionServiceTimer() { | 1171 void ProfileImpl::StopCreateSessionServiceTimer() { |
1188 create_session_service_timer_.Stop(); | 1172 create_session_service_timer_.Stop(); |
1189 } | 1173 } |
1190 | 1174 |
1191 void ProfileImpl::EnsureSessionServiceCreated() { | 1175 void ProfileImpl::EnsureSessionServiceCreated() { |
1192 SessionServiceFactory::GetForProfile(this); | 1176 SessionServiceFactory::GetForProfile(this); |
1193 } | 1177 } |
1194 #endif | 1178 #endif |
1195 | 1179 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1405 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1422 domain_reliability::DomainReliabilityService* service = | 1406 domain_reliability::DomainReliabilityService* service = |
1423 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1407 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1424 GetForBrowserContext(this); | 1408 GetForBrowserContext(this); |
1425 if (!service) | 1409 if (!service) |
1426 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1410 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1427 | 1411 |
1428 return service->CreateMonitor( | 1412 return service->CreateMonitor( |
1429 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1413 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1430 } | 1414 } |
OLD | NEW |