| 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 GAIAInfoUpdateService; | 25 class GAIAInfoUpdateService; |
| 25 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
| 26 class PasswordStore; | 27 class PasswordStore; |
| 27 class PrefService; | 28 class PrefService; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // time that this method is called. | 224 // time that this method is called. |
| 224 virtual PrefService* GetOffTheRecordPrefs() = 0; | 225 virtual PrefService* GetOffTheRecordPrefs() = 0; |
| 225 | 226 |
| 226 // Returns the main request context. | 227 // Returns the main request context. |
| 227 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 228 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
| 228 | 229 |
| 229 // Returns the request context used for extension-related requests. This | 230 // Returns the request context used for extension-related requests. This |
| 230 // is only used for a separate cookie store currently. | 231 // is only used for a separate cookie store currently. |
| 231 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 232 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
| 232 | 233 |
| 233 // Returns the request context used within |partition_id|. | |
| 234 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | |
| 235 const FilePath& partition_path, | |
| 236 bool in_memory) = 0; | |
| 237 | |
| 238 // Returns the SSLConfigService for this profile. | 234 // Returns the SSLConfigService for this profile. |
| 239 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 235 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
| 240 | 236 |
| 241 // Returns the Hostname <-> Content settings map for this profile. | 237 // Returns the Hostname <-> Content settings map for this profile. |
| 242 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; | 238 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
| 243 | 239 |
| 244 // Returns the ProtocolHandlerRegistry, creating if not yet created. | 240 // Returns the ProtocolHandlerRegistry, creating if not yet created. |
| 245 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. | 241 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. |
| 246 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; | 242 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; |
| 247 | 243 |
| 248 // Return whether 2 profiles are the same. 2 profiles are the same if they | 244 // Return whether 2 profiles are the same. 2 profiles are the same if they |
| 249 // represent the same profile. This can happen if there is pointer equality | 245 // represent the same profile. This can happen if there is pointer equality |
| 250 // or if one profile is the incognito version of another profile (or vice | 246 // or if one profile is the incognito version of another profile (or vice |
| 251 // versa). | 247 // versa). |
| 252 virtual bool IsSameProfile(Profile* profile) = 0; | 248 virtual bool IsSameProfile(Profile* profile) = 0; |
| 253 | 249 |
| 254 // Returns the time the profile was started. This is not the time the profile | 250 // Returns the time the profile was started. This is not the time the profile |
| 255 // was created, rather it is the time the user started chrome and logged into | 251 // was created, rather it is the time the user started chrome and logged into |
| 256 // this profile. For the single profile case, this corresponds to the time | 252 // this profile. For the single profile case, this corresponds to the time |
| 257 // the user started chrome. | 253 // the user started chrome. |
| 258 virtual base::Time GetStartTime() const = 0; | 254 virtual base::Time GetStartTime() const = 0; |
| 259 | 255 |
| 256 // Creates the main net::URLRequestContextGetter. Should only be called once |
| 257 // per ContentBrowserClient object. |
| 258 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 259 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 260 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 261 blob_protocol_handler, |
| 262 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 263 file_system_protocol_handler, |
| 264 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 265 developer_protocol_handler) = 0; |
| 266 |
| 267 // Creates the net::URLRequestContextGetter for a StoragePartition. Should |
| 268 // only be called once per partition_path per ContentBrowserClient object. |
| 269 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 270 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 271 const FilePath& partition_path, |
| 272 bool in_memory, |
| 273 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 274 blob_protocol_handler, |
| 275 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 276 file_system_protocol_handler, |
| 277 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 278 developer_protocol_handler) = 0; |
| 279 |
| 260 // Start up service that gathers data from a promo resource feed. | 280 // Start up service that gathers data from a promo resource feed. |
| 261 virtual void InitPromoResources() = 0; | 281 virtual void InitPromoResources() = 0; |
| 262 | 282 |
| 263 // Returns the last directory that was chosen for uploading or opening a file. | 283 // Returns the last directory that was chosen for uploading or opening a file. |
| 264 virtual FilePath last_selected_directory() = 0; | 284 virtual FilePath last_selected_directory() = 0; |
| 265 virtual void set_last_selected_directory(const FilePath& path) = 0; | 285 virtual void set_last_selected_directory(const FilePath& path) = 0; |
| 266 | 286 |
| 267 #if defined(OS_CHROMEOS) | 287 #if defined(OS_CHROMEOS) |
| 268 enum AppLocaleChangedVia { | 288 enum AppLocaleChangedVia { |
| 269 // Caused by chrome://settings change. | 289 // Caused by chrome://settings change. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 struct hash<Profile*> { | 421 struct hash<Profile*> { |
| 402 std::size_t operator()(Profile* const& p) const { | 422 std::size_t operator()(Profile* const& p) const { |
| 403 return reinterpret_cast<std::size_t>(p); | 423 return reinterpret_cast<std::size_t>(p); |
| 404 } | 424 } |
| 405 }; | 425 }; |
| 406 | 426 |
| 407 } // namespace BASE_HASH_NAMESPACE | 427 } // namespace BASE_HASH_NAMESPACE |
| 408 #endif | 428 #endif |
| 409 | 429 |
| 410 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 430 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
| OLD | NEW |