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 // This class gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. |
6 | 6 |
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/prefs/public/pref_change_registrar.h" | 16 #include "base/prefs/public/pref_change_registrar.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_impl_io_data.h" | 19 #include "chrome/browser/profiles/profile_impl_io_data.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 | 22 |
23 class NetPrefObserver; | 23 class NetPrefObserver; |
24 class PrefService; | 24 class PrefServiceSyncable; |
25 class PrefServiceBase; | 25 class PrefServiceBase; |
26 class PromoResourceService; | 26 class PromoResourceService; |
27 class SSLConfigServiceManager; | 27 class SSLConfigServiceManager; |
28 | 28 |
29 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
30 namespace chromeos { | 30 namespace chromeos { |
31 class EnterpriseExtensionObserver; | 31 class EnterpriseExtensionObserver; |
32 class LocaleChangeGuard; | 32 class LocaleChangeGuard; |
33 class Preferences; | 33 class Preferences; |
34 } | 34 } |
(...skipping 17 matching lines...) Expand all Loading... |
52 | 52 |
53 // The default profile implementation. | 53 // The default profile implementation. |
54 class ProfileImpl : public Profile, | 54 class ProfileImpl : public Profile, |
55 public content::NotificationObserver { | 55 public content::NotificationObserver { |
56 public: | 56 public: |
57 // Value written to prefs when the exit type is EXIT_NORMAL. Public for tests. | 57 // Value written to prefs when the exit type is EXIT_NORMAL. Public for tests. |
58 static const char* const kPrefExitTypeNormal; | 58 static const char* const kPrefExitTypeNormal; |
59 | 59 |
60 virtual ~ProfileImpl(); | 60 virtual ~ProfileImpl(); |
61 | 61 |
62 static void RegisterUserPrefs(PrefService* prefs); | 62 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
63 | 63 |
64 // content::BrowserContext implementation: | 64 // content::BrowserContext implementation: |
65 virtual FilePath GetPath() OVERRIDE; | 65 virtual FilePath GetPath() OVERRIDE; |
66 virtual content::DownloadManagerDelegate* | 66 virtual content::DownloadManagerDelegate* |
67 GetDownloadManagerDelegate() OVERRIDE; | 67 GetDownloadManagerDelegate() OVERRIDE; |
68 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 68 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
69 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 69 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
70 int renderer_child_id) OVERRIDE; | 70 int renderer_child_id) OVERRIDE; |
71 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | 71 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( |
72 const FilePath& partition_path, | 72 const FilePath& partition_path, |
(...skipping 22 matching lines...) Expand all Loading... |
95 virtual Profile* GetOriginalProfile() OVERRIDE; | 95 virtual Profile* GetOriginalProfile() OVERRIDE; |
96 virtual history::TopSites* GetTopSites() OVERRIDE; | 96 virtual history::TopSites* GetTopSites() OVERRIDE; |
97 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; | 97 virtual history::TopSites* GetTopSitesWithoutCreating() OVERRIDE; |
98 virtual ExtensionService* GetExtensionService() OVERRIDE; | 98 virtual ExtensionService* GetExtensionService() OVERRIDE; |
99 virtual ExtensionSpecialStoragePolicy* | 99 virtual ExtensionSpecialStoragePolicy* |
100 GetExtensionSpecialStoragePolicy() OVERRIDE; | 100 GetExtensionSpecialStoragePolicy() OVERRIDE; |
101 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; | 101 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; |
102 virtual policy::ManagedModePolicyProvider* | 102 virtual policy::ManagedModePolicyProvider* |
103 GetManagedModePolicyProvider() OVERRIDE; | 103 GetManagedModePolicyProvider() OVERRIDE; |
104 virtual policy::PolicyService* GetPolicyService() OVERRIDE; | 104 virtual policy::PolicyService* GetPolicyService() OVERRIDE; |
105 virtual PrefService* GetPrefs() OVERRIDE; | 105 virtual PrefServiceSyncable* GetPrefs() OVERRIDE; |
106 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; | 106 virtual PrefServiceSyncable* GetOffTheRecordPrefs() OVERRIDE; |
107 virtual net::URLRequestContextGetter* | 107 virtual net::URLRequestContextGetter* |
108 GetRequestContextForExtensions() OVERRIDE; | 108 GetRequestContextForExtensions() OVERRIDE; |
109 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; | 109 virtual net::SSLConfigService* GetSSLConfigService() OVERRIDE; |
110 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; | 110 virtual HostContentSettingsMap* GetHostContentSettingsMap() OVERRIDE; |
111 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; | 111 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; |
112 virtual bool IsSameProfile(Profile* profile) OVERRIDE; | 112 virtual bool IsSameProfile(Profile* profile) OVERRIDE; |
113 virtual base::Time GetStartTime() const OVERRIDE; | 113 virtual base::Time GetStartTime() const OVERRIDE; |
114 virtual void InitPromoResources() OVERRIDE; | 114 virtual void InitPromoResources() OVERRIDE; |
115 virtual FilePath last_selected_directory() OVERRIDE; | 115 virtual FilePath last_selected_directory() OVERRIDE; |
116 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; | 116 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 #if !defined(OS_CHROMEOS) | 215 #if !defined(OS_CHROMEOS) |
216 scoped_ptr<policy::UserCloudPolicyManager> cloud_policy_manager_; | 216 scoped_ptr<policy::UserCloudPolicyManager> cloud_policy_manager_; |
217 #endif | 217 #endif |
218 scoped_ptr<policy::ManagedModePolicyProvider> managed_mode_policy_provider_; | 218 scoped_ptr<policy::ManagedModePolicyProvider> managed_mode_policy_provider_; |
219 #endif | 219 #endif |
220 scoped_ptr<policy::PolicyService> policy_service_; | 220 scoped_ptr<policy::PolicyService> policy_service_; |
221 | 221 |
222 // Keep |prefs_| on top for destruction order because |extension_prefs_|, | 222 // Keep |prefs_| on top for destruction order because |extension_prefs_|, |
223 // |net_pref_observer_|, |promo_resource_service_|, |io_data_| an others store | 223 // |net_pref_observer_|, |promo_resource_service_|, |io_data_| an others store |
224 // pointers to |prefs_| and shall be destructed first. | 224 // pointers to |prefs_| and shall be destructed first. |
225 scoped_ptr<PrefService> prefs_; | 225 scoped_ptr<PrefServiceSyncable> prefs_; |
226 scoped_ptr<PrefService> otr_prefs_; | 226 scoped_ptr<PrefServiceSyncable> otr_prefs_; |
227 ProfileImplIOData::Handle io_data_; | 227 ProfileImplIOData::Handle io_data_; |
228 scoped_refptr<ExtensionSpecialStoragePolicy> | 228 scoped_refptr<ExtensionSpecialStoragePolicy> |
229 extension_special_storage_policy_; | 229 extension_special_storage_policy_; |
230 scoped_ptr<NetPrefObserver> net_pref_observer_; | 230 scoped_ptr<NetPrefObserver> net_pref_observer_; |
231 scoped_refptr<PromoResourceService> promo_resource_service_; | 231 scoped_refptr<PromoResourceService> promo_resource_service_; |
232 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; | 232 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; |
233 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 233 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
234 scoped_refptr<content::GeolocationPermissionContext> | 234 scoped_refptr<content::GeolocationPermissionContext> |
235 geolocation_permission_context_; | 235 geolocation_permission_context_; |
236 scoped_ptr<GAIAInfoUpdateService> gaia_info_update_service_; | 236 scoped_ptr<GAIAInfoUpdateService> gaia_info_update_service_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} | 277 // chrome/browser/profile/profile_keyed_dependency_manager.{h,cc} |
278 | 278 |
279 Profile::Delegate* delegate_; | 279 Profile::Delegate* delegate_; |
280 | 280 |
281 chrome_browser_net::Predictor* predictor_; | 281 chrome_browser_net::Predictor* predictor_; |
282 | 282 |
283 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); | 283 DISALLOW_COPY_AND_ASSIGN(ProfileImpl); |
284 }; | 284 }; |
285 | 285 |
286 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ | 286 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_H_ |
OLD | NEW |