| 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_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ |
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 15 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 16 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" | 16 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" |
| 17 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
| 18 | 18 |
| 19 class ChromeAppCacheService; | 19 class ChromeAppCacheService; |
| 20 class ChromeURLDataManager; | 20 class ChromeURLDataManager; |
| 21 class ExtensionService; | 21 class ExtensionService; |
| 22 class ExtensionSpecialStoragePolicy; | 22 class ExtensionSpecialStoragePolicy; |
| 23 class FaviconService; | 23 class FaviconService; |
| 24 class GAIAInfoUpdateService; | 24 class GAIAInfoUpdateService; |
| 25 class HostContentSettingsMap; | 25 class HostContentSettingsMap; |
| 26 class PasswordStore; | 26 class PasswordStore; |
| 27 class PrefService; | 27 class PrefServiceSyncable; |
| 28 class PromoCounter; | 28 class PromoCounter; |
| 29 class ProtocolHandlerRegistry; | 29 class ProtocolHandlerRegistry; |
| 30 class TestingProfile; | 30 class TestingProfile; |
| 31 class WebDataService; | 31 class WebDataService; |
| 32 | 32 |
| 33 namespace android { | 33 namespace android { |
| 34 class TabContentsProvider; | 34 class TabContentsProvider; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace base { | 37 namespace base { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 // Key used to bind profile to the widget with which it is associated. | 133 // Key used to bind profile to the widget with which it is associated. |
| 134 static const char* const kProfileKey; | 134 static const char* const kProfileKey; |
| 135 | 135 |
| 136 Profile(); | 136 Profile(); |
| 137 virtual ~Profile() {} | 137 virtual ~Profile() {} |
| 138 | 138 |
| 139 // Profile prefs are registered as soon as the prefs are loaded for the first | 139 // Profile prefs are registered as soon as the prefs are loaded for the first |
| 140 // time. | 140 // time. |
| 141 static void RegisterUserPrefs(PrefService* prefs); | 141 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 142 | 142 |
| 143 // Gets task runner for I/O operations associated with |profile|. | 143 // Gets task runner for I/O operations associated with |profile|. |
| 144 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( | 144 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( |
| 145 Profile* profile); | 145 Profile* profile); |
| 146 | 146 |
| 147 // Create a new profile given a path. If |create_mode| is | 147 // Create a new profile given a path. If |create_mode| is |
| 148 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. | 148 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. |
| 149 static Profile* CreateProfile(const FilePath& path, | 149 static Profile* CreateProfile(const FilePath& path, |
| 150 Delegate* delegate, | 150 Delegate* delegate, |
| 151 CreateMode create_mode); | 151 CreateMode create_mode); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 // Accessor. The instance is created upon first access. | 208 // Accessor. The instance is created upon first access. |
| 209 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() = 0; | 209 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() = 0; |
| 210 | 210 |
| 211 // Returns the ManagedModePolicyProvider for this profile, if it exists. | 211 // Returns the ManagedModePolicyProvider for this profile, if it exists. |
| 212 virtual policy::ManagedModePolicyProvider* GetManagedModePolicyProvider() = 0; | 212 virtual policy::ManagedModePolicyProvider* GetManagedModePolicyProvider() = 0; |
| 213 | 213 |
| 214 // Returns the PolicyService that provides policies for this profile. | 214 // Returns the PolicyService that provides policies for this profile. |
| 215 virtual policy::PolicyService* GetPolicyService() = 0; | 215 virtual policy::PolicyService* GetPolicyService() = 0; |
| 216 | 216 |
| 217 // Retrieves a pointer to the PrefService that manages the preferences | 217 // Retrieves a pointer to the PrefServiceSyncable that manages the preferences |
| 218 // for this user profile. | 218 // for this user profile. |
| 219 virtual PrefService* GetPrefs() = 0; | 219 // TODO(joi): Make this and the below return just a PrefService. |
| 220 virtual PrefServiceSyncable* GetPrefs() = 0; |
| 220 | 221 |
| 221 // Retrieves a pointer to the PrefService that manages the preferences | 222 // Retrieves a pointer to the PrefService that manages the preferences |
| 222 // for OffTheRecord Profiles. This PrefService is lazily created the first | 223 // for OffTheRecord Profiles. This PrefService is lazily created the first |
| 223 // time that this method is called. | 224 // time that this method is called. |
| 224 virtual PrefService* GetOffTheRecordPrefs() = 0; | 225 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0; |
| 225 | 226 |
| 226 // Returns the main request context. | 227 // Returns the main request context. |
| 227 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 228 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
| 228 | 229 |
| 229 // Returns the request context used for extension-related requests. This | 230 // Returns the request context used for extension-related requests. This |
| 230 // is only used for a separate cookie store currently. | 231 // is only used for a separate cookie store currently. |
| 231 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 232 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
| 232 | 233 |
| 233 // Returns the request context used within |partition_id|. | 234 // Returns the request context used within |partition_id|. |
| 234 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | 235 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 struct hash<Profile*> { | 402 struct hash<Profile*> { |
| 402 std::size_t operator()(Profile* const& p) const { | 403 std::size_t operator()(Profile* const& p) const { |
| 403 return reinterpret_cast<std::size_t>(p); | 404 return reinterpret_cast<std::size_t>(p); |
| 404 } | 405 } |
| 405 }; | 406 }; |
| 406 | 407 |
| 407 } // namespace BASE_HASH_NAMESPACE | 408 } // namespace BASE_HASH_NAMESPACE |
| 408 #endif | 409 #endif |
| 409 | 410 |
| 410 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 411 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
| OLD | NEW |