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 "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" |
18 #include "net/url_request/url_request_job_factory.h" | 18 #include "net/url_request/url_request_job_factory.h" |
19 | 19 |
20 class ChromeAppCacheService; | 20 class ChromeAppCacheService; |
21 class ExtensionService; | 21 class ExtensionService; |
22 class ExtensionSpecialStoragePolicy; | 22 class ExtensionSpecialStoragePolicy; |
23 class FaviconService; | 23 class FaviconService; |
24 class HostContentSettingsMap; | 24 class HostContentSettingsMap; |
25 class PasswordStore; | 25 class PasswordStore; |
26 class PrefRegistrySyncable; | |
27 class PromoCounter; | 26 class PromoCounter; |
28 class ProtocolHandlerRegistry; | 27 class ProtocolHandlerRegistry; |
29 class TestingProfile; | 28 class TestingProfile; |
30 class WebDataService; | 29 class WebDataService; |
31 | 30 |
32 namespace android { | 31 namespace android { |
33 class TabContentsProvider; | 32 class TabContentsProvider; |
34 } | 33 } |
35 | 34 |
36 namespace base { | 35 namespace base { |
(...skipping 20 matching lines...) Expand all Loading... |
57 | 56 |
58 namespace history { | 57 namespace history { |
59 class ShortcutsBackend; | 58 class ShortcutsBackend; |
60 class TopSites; | 59 class TopSites; |
61 } | 60 } |
62 | 61 |
63 namespace net { | 62 namespace net { |
64 class SSLConfigService; | 63 class SSLConfigService; |
65 } | 64 } |
66 | 65 |
| 66 namespace user_prefs { |
| 67 class PrefRegistrySyncable; |
| 68 } |
| 69 |
67 class Profile : public content::BrowserContext { | 70 class Profile : public content::BrowserContext { |
68 public: | 71 public: |
69 // Profile services are accessed with the following parameter. This parameter | 72 // Profile services are accessed with the following parameter. This parameter |
70 // defines what the caller plans to do with the service. | 73 // defines what the caller plans to do with the service. |
71 // The caller is responsible for not performing any operation that would | 74 // The caller is responsible for not performing any operation that would |
72 // result in persistent implicit records while using an OffTheRecord profile. | 75 // result in persistent implicit records while using an OffTheRecord profile. |
73 // This flag allows the profile to perform an additional check. | 76 // This flag allows the profile to perform an additional check. |
74 // | 77 // |
75 // It also gives us an opportunity to perform further checks in the future. We | 78 // It also gives us an opportunity to perform further checks in the future. We |
76 // could, for example, return an history service that only allow some specific | 79 // could, for example, return an history service that only allow some specific |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 }; | 130 }; |
128 | 131 |
129 // Key used to bind profile to the widget with which it is associated. | 132 // Key used to bind profile to the widget with which it is associated. |
130 static const char kProfileKey[]; | 133 static const char kProfileKey[]; |
131 | 134 |
132 Profile(); | 135 Profile(); |
133 virtual ~Profile(); | 136 virtual ~Profile(); |
134 | 137 |
135 // Profile prefs are registered as soon as the prefs are loaded for the first | 138 // Profile prefs are registered as soon as the prefs are loaded for the first |
136 // time. | 139 // time. |
137 static void RegisterUserPrefs(PrefRegistrySyncable* registry); | 140 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
138 | 141 |
139 // Gets task runner for I/O operations associated with |profile|. | 142 // Gets task runner for I/O operations associated with |profile|. |
140 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( | 143 static scoped_refptr<base::SequencedTaskRunner> GetTaskRunnerForProfile( |
141 Profile* profile); | 144 Profile* profile); |
142 | 145 |
143 // Create a new profile given a path. If |create_mode| is | 146 // Create a new profile given a path. If |create_mode| is |
144 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. | 147 // CREATE_MODE_ASYNCHRONOUS then the profile is initialized asynchronously. |
145 static Profile* CreateProfile(const base::FilePath& path, | 148 static Profile* CreateProfile(const base::FilePath& path, |
146 Delegate* delegate, | 149 Delegate* delegate, |
147 CreateMode create_mode); | 150 CreateMode create_mode); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 struct hash<Profile*> { | 393 struct hash<Profile*> { |
391 std::size_t operator()(Profile* const& p) const { | 394 std::size_t operator()(Profile* const& p) const { |
392 return reinterpret_cast<std::size_t>(p); | 395 return reinterpret_cast<std::size_t>(p); |
393 } | 396 } |
394 }; | 397 }; |
395 | 398 |
396 } // namespace BASE_HASH_NAMESPACE | 399 } // namespace BASE_HASH_NAMESPACE |
397 #endif | 400 #endif |
398 | 401 |
399 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 402 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |