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 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/dom_distiller/profile_utils.h" | 37 #include "chrome/browser/dom_distiller/profile_utils.h" |
38 #include "chrome/browser/domain_reliability/service_factory.h" | 38 #include "chrome/browser/domain_reliability/service_factory.h" |
39 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 39 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
40 #include "chrome/browser/download/download_service.h" | 40 #include "chrome/browser/download/download_service.h" |
41 #include "chrome/browser/download/download_service_factory.h" | 41 #include "chrome/browser/download/download_service_factory.h" |
42 #include "chrome/browser/net/net_pref_observer.h" | 42 #include "chrome/browser/net/net_pref_observer.h" |
43 #include "chrome/browser/net/predictor.h" | 43 #include "chrome/browser/net/predictor.h" |
44 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 44 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
45 #include "chrome/browser/net/proxy_service_factory.h" | 45 #include "chrome/browser/net/proxy_service_factory.h" |
46 #include "chrome/browser/net/ssl_config_service_manager.h" | 46 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 47 #include "chrome/browser/permissions/permission_manager.h" |
| 48 #include "chrome/browser/permissions/permission_manager_factory.h" |
47 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 49 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
48 #include "chrome/browser/plugins/plugin_prefs.h" | 50 #include "chrome/browser/plugins/plugin_prefs.h" |
49 #include "chrome/browser/policy/profile_policy_connector.h" | 51 #include "chrome/browser/policy/profile_policy_connector.h" |
50 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 52 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
51 #include "chrome/browser/prefs/browser_prefs.h" | 53 #include "chrome/browser/prefs/browser_prefs.h" |
52 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 54 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
53 #include "chrome/browser/prefs/pref_service_syncable.h" | 55 #include "chrome/browser/prefs/pref_service_syncable.h" |
54 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 56 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
55 #include "chrome/browser/prerender/prerender_manager_factory.h" | 57 #include "chrome/browser/prerender/prerender_manager_factory.h" |
56 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 58 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 } | 1078 } |
1077 | 1079 |
1078 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { | 1080 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { |
1079 return PushMessagingServiceFactory::GetForProfile(this); | 1081 return PushMessagingServiceFactory::GetForProfile(this); |
1080 } | 1082 } |
1081 | 1083 |
1082 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { | 1084 content::SSLHostStateDelegate* ProfileImpl::GetSSLHostStateDelegate() { |
1083 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); | 1085 return ChromeSSLHostStateDelegateFactory::GetForProfile(this); |
1084 } | 1086 } |
1085 | 1087 |
| 1088 // TODO(mlamouri): we should all these BrowserContext implementation to Profile |
| 1089 // instead of repeating them inside all Profile implementations. |
| 1090 content::PermissionManager* ProfileImpl::GetPermissionManager() { |
| 1091 return PermissionManagerFactory::GetForProfile(this); |
| 1092 } |
| 1093 |
1086 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1094 bool ProfileImpl::IsSameProfile(Profile* profile) { |
1087 if (profile == static_cast<Profile*>(this)) | 1095 if (profile == static_cast<Profile*>(this)) |
1088 return true; | 1096 return true; |
1089 Profile* otr_profile = off_the_record_profile_.get(); | 1097 Profile* otr_profile = off_the_record_profile_.get(); |
1090 return otr_profile && profile == otr_profile; | 1098 return otr_profile && profile == otr_profile; |
1091 } | 1099 } |
1092 | 1100 |
1093 Time ProfileImpl::GetStartTime() const { | 1101 Time ProfileImpl::GetStartTime() const { |
1094 return start_time_; | 1102 return start_time_; |
1095 } | 1103 } |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1340 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1333 domain_reliability::DomainReliabilityService* service = | 1341 domain_reliability::DomainReliabilityService* service = |
1334 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1342 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1335 GetForBrowserContext(this); | 1343 GetForBrowserContext(this); |
1336 if (!service) | 1344 if (!service) |
1337 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1345 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1338 | 1346 |
1339 return service->CreateMonitor( | 1347 return service->CreateMonitor( |
1340 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1348 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1341 } | 1349 } |
OLD | NEW |