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 #include "net/url_request/url_request_job_factory.h" |
18 | 19 |
19 class ChromeAppCacheService; | 20 class ChromeAppCacheService; |
20 class ChromeURLDataManager; | 21 class ChromeURLDataManager; |
21 class ExtensionService; | 22 class ExtensionService; |
22 class ExtensionSpecialStoragePolicy; | 23 class ExtensionSpecialStoragePolicy; |
23 class FaviconService; | 24 class FaviconService; |
24 class HostContentSettingsMap; | 25 class HostContentSettingsMap; |
25 class PasswordStore; | 26 class PasswordStore; |
26 class PrefServiceSyncable; | 27 class PrefServiceSyncable; |
27 class PromoCounter; | 28 class PromoCounter; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // time that this method is called. | 221 // time that this method is called. |
221 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0; | 222 virtual PrefServiceSyncable* GetOffTheRecordPrefs() = 0; |
222 | 223 |
223 // Returns the main request context. | 224 // Returns the main request context. |
224 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 225 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
225 | 226 |
226 // Returns the request context used for extension-related requests. This | 227 // Returns the request context used for extension-related requests. This |
227 // is only used for a separate cookie store currently. | 228 // is only used for a separate cookie store currently. |
228 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 229 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
229 | 230 |
230 // Returns the request context used within |partition_id|. | |
231 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | |
232 const FilePath& partition_path, | |
233 bool in_memory) = 0; | |
234 | |
235 // Returns the SSLConfigService for this profile. | 231 // Returns the SSLConfigService for this profile. |
236 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 232 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
237 | 233 |
238 // Returns the Hostname <-> Content settings map for this profile. | 234 // Returns the Hostname <-> Content settings map for this profile. |
239 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; | 235 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
240 | 236 |
241 // Returns the ProtocolHandlerRegistry, creating if not yet created. | 237 // Returns the ProtocolHandlerRegistry, creating if not yet created. |
242 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. | 238 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. |
243 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; | 239 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; |
244 | 240 |
245 // Return whether 2 profiles are the same. 2 profiles are the same if they | 241 // Return whether 2 profiles are the same. 2 profiles are the same if they |
246 // represent the same profile. This can happen if there is pointer equality | 242 // represent the same profile. This can happen if there is pointer equality |
247 // or if one profile is the incognito version of another profile (or vice | 243 // or if one profile is the incognito version of another profile (or vice |
248 // versa). | 244 // versa). |
249 virtual bool IsSameProfile(Profile* profile) = 0; | 245 virtual bool IsSameProfile(Profile* profile) = 0; |
250 | 246 |
251 // Returns the time the profile was started. This is not the time the profile | 247 // Returns the time the profile was started. This is not the time the profile |
252 // was created, rather it is the time the user started chrome and logged into | 248 // was created, rather it is the time the user started chrome and logged into |
253 // this profile. For the single profile case, this corresponds to the time | 249 // this profile. For the single profile case, this corresponds to the time |
254 // the user started chrome. | 250 // the user started chrome. |
255 virtual base::Time GetStartTime() const = 0; | 251 virtual base::Time GetStartTime() const = 0; |
256 | 252 |
| 253 // Creates the main net::URLRequestContextGetter. Should only be called once |
| 254 // per ContentBrowserClient object. |
| 255 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 256 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 257 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 258 blob_protocol_handler, |
| 259 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 260 file_system_protocol_handler, |
| 261 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 262 developer_protocol_handler) = 0; |
| 263 |
| 264 // Creates the net::URLRequestContextGetter for a StoragePartition. Should |
| 265 // only be called once per partition_path per ContentBrowserClient object. |
| 266 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 267 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 268 const FilePath& partition_path, |
| 269 bool in_memory, |
| 270 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 271 blob_protocol_handler, |
| 272 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 273 file_system_protocol_handler, |
| 274 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 275 developer_protocol_handler) = 0; |
| 276 |
257 // Returns the last directory that was chosen for uploading or opening a file. | 277 // Returns the last directory that was chosen for uploading or opening a file. |
258 virtual FilePath last_selected_directory() = 0; | 278 virtual FilePath last_selected_directory() = 0; |
259 virtual void set_last_selected_directory(const FilePath& path) = 0; | 279 virtual void set_last_selected_directory(const FilePath& path) = 0; |
260 | 280 |
261 #if defined(OS_CHROMEOS) | 281 #if defined(OS_CHROMEOS) |
262 enum AppLocaleChangedVia { | 282 enum AppLocaleChangedVia { |
263 // Caused by chrome://settings change. | 283 // Caused by chrome://settings change. |
264 APP_LOCALE_CHANGED_VIA_SETTINGS, | 284 APP_LOCALE_CHANGED_VIA_SETTINGS, |
265 // Locale has been reverted via LocaleChangeGuard. | 285 // Locale has been reverted via LocaleChangeGuard. |
266 APP_LOCALE_CHANGED_VIA_REVERT, | 286 APP_LOCALE_CHANGED_VIA_REVERT, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 struct hash<Profile*> { | 415 struct hash<Profile*> { |
396 std::size_t operator()(Profile* const& p) const { | 416 std::size_t operator()(Profile* const& p) const { |
397 return reinterpret_cast<std::size_t>(p); | 417 return reinterpret_cast<std::size_t>(p); |
398 } | 418 } |
399 }; | 419 }; |
400 | 420 |
401 } // namespace BASE_HASH_NAMESPACE | 421 } // namespace BASE_HASH_NAMESPACE |
402 #endif | 422 #endif |
403 | 423 |
404 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 424 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |