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