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 BookmarkModel; | |
20 class ChromeAppCacheService; | 19 class ChromeAppCacheService; |
21 class ChromeURLDataManager; | 20 class ChromeURLDataManager; |
22 class ExtensionProcessManager; | 21 class ExtensionProcessManager; |
23 class ExtensionService; | 22 class ExtensionService; |
24 class ExtensionSpecialStoragePolicy; | 23 class ExtensionSpecialStoragePolicy; |
25 class FaviconService; | 24 class FaviconService; |
26 class GAIAInfoUpdateService; | 25 class GAIAInfoUpdateService; |
27 class HistoryService; | |
28 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
29 class PasswordStore; | 27 class PasswordStore; |
30 class PrefService; | 28 class PrefService; |
31 class PromoCounter; | 29 class PromoCounter; |
32 class ProtocolHandlerRegistry; | 30 class ProtocolHandlerRegistry; |
33 class TestingProfile; | 31 class TestingProfile; |
34 class VisitedLinkMaster; | 32 class VisitedLinkMaster; |
35 class WebDataService; | 33 class WebDataService; |
36 | 34 |
37 namespace android { | 35 namespace android { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // only for the local scope (which they should do anyway since the browser | 224 // only for the local scope (which they should do anyway since the browser |
227 // process may decide to shut down). | 225 // process may decide to shut down). |
228 // | 226 // |
229 // |access| defines what the caller plans to do with the service. See | 227 // |access| defines what the caller plans to do with the service. See |
230 // the ServiceAccessType definition above. | 228 // the ServiceAccessType definition above. |
231 virtual FaviconService* GetFaviconService(ServiceAccessType access) = 0; | 229 virtual FaviconService* GetFaviconService(ServiceAccessType access) = 0; |
232 | 230 |
233 // Accessor. The instance is created upon first access. | 231 // Accessor. The instance is created upon first access. |
234 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() = 0; | 232 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() = 0; |
235 | 233 |
236 // Retrieves a pointer to the HistoryService associated with this | |
237 // profile. The HistoryService is lazily created the first time | |
238 // that this method is called. | |
239 // | |
240 // Although HistoryService is refcounted, this will not addref, and callers | |
241 // do not need to do any reference counting as long as they keep the pointer | |
242 // only for the local scope (which they should do anyway since the browser | |
243 // process may decide to shut down). | |
244 // | |
245 // |access| defines what the caller plans to do with the service. See | |
246 // the ServiceAccessType definition above. | |
247 virtual HistoryService* GetHistoryService(ServiceAccessType access) = 0; | |
248 | |
249 // Similar to GetHistoryService(), but won't create the history service if it | |
250 // doesn't already exist. | |
251 virtual HistoryService* GetHistoryServiceWithoutCreating() = 0; | |
252 | |
253 // Returns the UserCloudPolicyManager (if any) that handles this profile's | 234 // Returns the UserCloudPolicyManager (if any) that handles this profile's |
254 // connection to the cloud-based management service. | 235 // connection to the cloud-based management service. |
255 virtual policy::UserCloudPolicyManager* GetUserCloudPolicyManager() = 0; | 236 virtual policy::UserCloudPolicyManager* GetUserCloudPolicyManager() = 0; |
256 | 237 |
257 // Returns the PolicyService that provides policies for this profile. | 238 // Returns the PolicyService that provides policies for this profile. |
258 virtual policy::PolicyService* GetPolicyService() = 0; | 239 virtual policy::PolicyService* GetPolicyService() = 0; |
259 | 240 |
260 // Retrieves a pointer to the PrefService that manages the preferences | 241 // Retrieves a pointer to the PrefService that manages the preferences |
261 // for this user profile. | 242 // for this user profile. |
262 virtual PrefService* GetPrefs() = 0; | 243 virtual PrefService* GetPrefs() = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
277 // requested isolated storage. | 258 // requested isolated storage. |
278 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( | 259 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
279 const std::string& app_id) = 0; | 260 const std::string& app_id) = 0; |
280 | 261 |
281 // Returns the SSLConfigService for this profile. | 262 // Returns the SSLConfigService for this profile. |
282 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 263 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
283 | 264 |
284 // Returns the Hostname <-> Content settings map for this profile. | 265 // Returns the Hostname <-> Content settings map for this profile. |
285 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; | 266 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
286 | 267 |
287 // Returns the BookmarkModel, creating if not yet created. | |
288 virtual BookmarkModel* GetBookmarkModel() = 0; | |
289 | |
290 // Returns the ProtocolHandlerRegistry, creating if not yet created. | 268 // Returns the ProtocolHandlerRegistry, creating if not yet created. |
291 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. | 269 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. |
292 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; | 270 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; |
293 | 271 |
294 // Return whether 2 profiles are the same. 2 profiles are the same if they | 272 // Return whether 2 profiles are the same. 2 profiles are the same if they |
295 // represent the same profile. This can happen if there is pointer equality | 273 // represent the same profile. This can happen if there is pointer equality |
296 // or if one profile is the incognito version of another profile (or vice | 274 // or if one profile is the incognito version of another profile (or vice |
297 // versa). | 275 // versa). |
298 virtual bool IsSameProfile(Profile* profile) = 0; | 276 virtual bool IsSameProfile(Profile* profile) = 0; |
299 | 277 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 struct hash<Profile*> { | 415 struct hash<Profile*> { |
438 std::size_t operator()(Profile* const& p) const { | 416 std::size_t operator()(Profile* const& p) const { |
439 return reinterpret_cast<std::size_t>(p); | 417 return reinterpret_cast<std::size_t>(p); |
440 } | 418 } |
441 }; | 419 }; |
442 | 420 |
443 } // namespace BASE_HASH_NAMESPACE | 421 } // namespace BASE_HASH_NAMESPACE |
444 #endif | 422 #endif |
445 | 423 |
446 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 424 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |