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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "chrome/browser/profiles/profile_metrics.h" | 61 #include "chrome/browser/profiles/profile_metrics.h" |
62 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" | 62 #include "chrome/browser/push_messaging/push_messaging_service_factory.h" |
63 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 63 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
64 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 64 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
65 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 65 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
66 #include "chrome/browser/sessions/session_service_factory.h" | 66 #include "chrome/browser/sessions/session_service_factory.h" |
67 #include "chrome/browser/signin/signin_manager_factory.h" | 67 #include "chrome/browser/signin/signin_manager_factory.h" |
68 #include "chrome/browser/signin/signin_ui_util.h" | 68 #include "chrome/browser/signin/signin_ui_util.h" |
69 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 69 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" | 70 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" |
| 71 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
71 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 72 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
72 #include "chrome/common/chrome_constants.h" | 73 #include "chrome/common/chrome_constants.h" |
73 #include "chrome/common/chrome_paths_internal.h" | 74 #include "chrome/common/chrome_paths_internal.h" |
74 #include "chrome/common/chrome_switches.h" | 75 #include "chrome/common/chrome_switches.h" |
75 #include "chrome/common/pref_names.h" | 76 #include "chrome/common/pref_names.h" |
76 #include "chrome/common/url_constants.h" | 77 #include "chrome/common/url_constants.h" |
77 #include "chrome/grit/chromium_strings.h" | 78 #include "chrome/grit/chromium_strings.h" |
78 #include "components/bookmarks/browser/bookmark_model.h" | 79 #include "components/bookmarks/browser/bookmark_model.h" |
79 #include "components/content_settings/core/browser/cookie_settings.h" | 80 #include "components/content_settings/core/browser/cookie_settings.h" |
80 #include "components/content_settings/core/browser/host_content_settings_map.h" | 81 #include "components/content_settings/core/browser/host_content_settings_map.h" |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 return static_cast<ChromeZoomLevelPrefs*>( | 903 return static_cast<ChromeZoomLevelPrefs*>( |
903 GetDefaultStoragePartition(this)->GetZoomLevelDelegate()); | 904 GetDefaultStoragePartition(this)->GetZoomLevelDelegate()); |
904 } | 905 } |
905 | 906 |
906 PrefService* ProfileImpl::GetOffTheRecordPrefs() { | 907 PrefService* ProfileImpl::GetOffTheRecordPrefs() { |
907 DCHECK(prefs_); | 908 DCHECK(prefs_); |
908 if (!otr_prefs_) { | 909 if (!otr_prefs_) { |
909 // The new ExtensionPrefStore is ref_counted and the new PrefService | 910 // The new ExtensionPrefStore is ref_counted and the new PrefService |
910 // stores a reference so that we do not leak memory here. | 911 // stores a reference so that we do not leak memory here. |
911 otr_prefs_.reset(prefs_->CreateIncognitoPrefService( | 912 otr_prefs_.reset(prefs_->CreateIncognitoPrefService( |
912 CreateExtensionPrefStore(this, true))); | 913 CreateExtensionPrefStore(this, true), |
| 914 base::Bind(&PrefsTabHelper::InitIncognitoUserPrefStore))); |
913 } | 915 } |
914 return otr_prefs_.get(); | 916 return otr_prefs_.get(); |
915 } | 917 } |
916 | 918 |
917 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( | 919 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( |
918 content::ProtocolHandlerMap* protocol_handlers, | 920 content::ProtocolHandlerMap* protocol_handlers, |
919 content::URLRequestInterceptorScopedVector request_interceptors) { | 921 content::URLRequestInterceptorScopedVector request_interceptors) { |
920 return io_data_.CreateMainRequestContextGetter( | 922 return io_data_.CreateMainRequestContextGetter( |
921 protocol_handlers, | 923 protocol_handlers, |
922 request_interceptors.Pass(), | 924 request_interceptors.Pass(), |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1295 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1294 domain_reliability::DomainReliabilityService* service = | 1296 domain_reliability::DomainReliabilityService* service = |
1295 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1297 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1296 GetForBrowserContext(this); | 1298 GetForBrowserContext(this); |
1297 if (!service) | 1299 if (!service) |
1298 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1300 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1299 | 1301 |
1300 return service->CreateMonitor( | 1302 return service->CreateMonitor( |
1301 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1303 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1302 } | 1304 } |
OLD | NEW |