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 "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
17 #include "net/url_request/url_request_job_factory.h" | 17 #include "net/url_request/url_request_job_factory.h" |
18 | 18 |
19 class ChromeAppCacheService; | 19 class ChromeAppCacheService; |
20 class ExtensionService; | 20 class ExtensionService; |
21 class ExtensionSpecialStoragePolicy; | 21 class ExtensionSpecialStoragePolicy; |
22 class FaviconService; | 22 class FaviconService; |
23 class HostContentSettingsMap; | 23 class HostContentSettingsMap; |
24 class PasswordStore; | 24 class PasswordStore; |
25 class PrefServiceSyncable; | 25 class PrefRegistrySyncable; |
26 class PromoCounter; | 26 class PromoCounter; |
27 class ProtocolHandlerRegistry; | 27 class ProtocolHandlerRegistry; |
28 class TestingProfile; | 28 class TestingProfile; |
29 class WebDataService; | 29 class WebDataService; |
30 | 30 |
31 namespace android { | 31 namespace android { |
32 class TabContentsProvider; | 32 class TabContentsProvider; |
33 } | 33 } |
34 | 34 |
35 namespace base { | 35 namespace base { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 }; | 129 }; |
130 | 130 |
131 // Key used to bind profile to the widget with which it is associated. | 131 // Key used to bind profile to the widget with which it is associated. |
132 static const char* const kProfileKey; | 132 static const char* const kProfileKey; |
133 | 133 |
134 Profile(); | 134 Profile(); |
135 virtual ~Profile() {} | 135 virtual ~Profile() {} |
136 | 136 |
137 // Profile prefs are registered as soon as the prefs are loaded for the first | 137 // Profile prefs are registered as soon as the prefs are loaded for the first |
138 // time. | 138 // time. |
139 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 139 static void RegisterUserPrefs(PrefRegistrySyncable* registry); |
140 | 140 |
141 // Gets task runner for I/O operations associated with |profile|. | 141 // Gets task runner for I/O operations associated with |profile|. |
142 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( | 142 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( |
143 Profile* profile); | 143 Profile* profile); |
144 | 144 |
145 // Create a new profile given a path. If |create_mode| is | 145 // Create a new profile given a path. If |create_mode| is |
146 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. | 146 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. |
147 static Profile* CreateProfile(const base::FilePath& path, | 147 static Profile* CreateProfile(const base::FilePath& path, |
148 Delegate* delegate, | 148 Delegate* delegate, |
149 CreateMode create_mode); | 149 CreateMode create_mode); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // Accessor. The instance is created upon first access. | 202 // Accessor. The instance is created upon first access. |
203 virtual ExtensionSpecialStoragePolicy* | 203 virtual ExtensionSpecialStoragePolicy* |
204 GetExtensionSpecialStoragePolicy() = 0; | 204 GetExtensionSpecialStoragePolicy() = 0; |
205 | 205 |
206 // Returns the ManagedModePolicyProvider for this profile, if it exists. | 206 // Returns the ManagedModePolicyProvider for this profile, if it exists. |
207 virtual policy::ManagedModePolicyProvider* GetManagedModePolicyProvider() = 0; | 207 virtual policy::ManagedModePolicyProvider* GetManagedModePolicyProvider() = 0; |
208 | 208 |
209 // Returns the PolicyService that provides policies for this profile. | 209 // Returns the PolicyService that provides policies for this profile. |
210 virtual policy::PolicyService* GetPolicyService() = 0; | 210 virtual policy::PolicyService* GetPolicyService() = 0; |
211 | 211 |
212 // Retrieves a pointer to the PrefServiceSyncable that manages the preferences | 212 // Retrieves a pointer to the PrefService that manages the |
213 // for this user profile. | 213 // preferences for this user profile. |
214 // TODO(joi): Make this and the below return just a PrefService. | 214 virtual PrefService* GetPrefs() = 0; |
215 virtual PrefServiceSyncable* GetPrefs() = 0; | |
216 | 215 |
217 // Retrieves a pointer to the PrefService that manages the preferences | 216 // Retrieves a pointer to the PrefService that manages the preferences |
218 // for OffTheRecord Profiles. This PrefService is lazily created the first | 217 // for OffTheRecord Profiles. This PrefService is lazily created the first |
219 // time that this method is called. | 218 // time that this method is called. |
220 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0; | 219 virtual PrefService* GetOffTheRecordPrefs() = 0; |
221 | 220 |
222 // Returns the main request context. | 221 // Returns the main request context. |
223 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 222 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
224 | 223 |
225 // Returns the request context used for extension-related requests. This | 224 // Returns the request context used for extension-related requests. This |
226 // is only used for a separate cookie store currently. | 225 // is only used for a separate cookie store currently. |
227 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 226 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
228 | 227 |
229 // Returns the SSLConfigService for this profile. | 228 // Returns the SSLConfigService for this profile. |
230 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 229 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 struct hash<Profile*> { | 419 struct hash<Profile*> { |
421 std::size_t operator()(Profile* const& p) const { | 420 std::size_t operator()(Profile* const& p) const { |
422 return reinterpret_cast<std::size_t>(p); | 421 return reinterpret_cast<std::size_t>(p); |
423 } | 422 } |
424 }; | 423 }; |
425 | 424 |
426 } // namespace BASE_HASH_NAMESPACE | 425 } // namespace BASE_HASH_NAMESPACE |
427 #endif | 426 #endif |
428 | 427 |
429 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 428 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |