| 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> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(PrefServiceSyncable* prefs); |
| 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 FilePath& path, | 146 static Profile* CreateProfile(const base::FilePath& path, |
| 147 Delegate* delegate, | 147 Delegate* delegate, |
| 148 CreateMode create_mode); | 148 CreateMode create_mode); |
| 149 | 149 |
| 150 // Returns the profile corresponding to the given browser context. | 150 // Returns the profile corresponding to the given browser context. |
| 151 static Profile* FromBrowserContext(content::BrowserContext* browser_context); | 151 static Profile* FromBrowserContext(content::BrowserContext* browser_context); |
| 152 | 152 |
| 153 // Returns the profile corresponding to the given WebUI. | 153 // Returns the profile corresponding to the given WebUI. |
| 154 static Profile* FromWebUI(content::WebUI* web_ui); | 154 static Profile* FromWebUI(content::WebUI* web_ui); |
| 155 | 155 |
| 156 // content::BrowserContext implementation ------------------------------------ | 156 // content::BrowserContext implementation ------------------------------------ |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 // Returns the main request context. | 221 // Returns the main request context. |
| 222 virtual net::URLRequestContextGetter* GetRequestContext() = 0; | 222 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
| 223 | 223 |
| 224 // Returns the request context used for extension-related requests. This | 224 // Returns the request context used for extension-related requests. This |
| 225 // is only used for a separate cookie store currently. | 225 // is only used for a separate cookie store currently. |
| 226 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 226 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
| 227 | 227 |
| 228 // Returns the request context used within |partition_id|. | 228 // Returns the request context used within |partition_id|. |
| 229 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( | 229 virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition( |
| 230 const FilePath& partition_path, | 230 const base::FilePath& partition_path, |
| 231 bool in_memory) = 0; | 231 bool in_memory) = 0; |
| 232 | 232 |
| 233 // Returns the SSLConfigService for this profile. | 233 // Returns the SSLConfigService for this profile. |
| 234 virtual net::SSLConfigService* GetSSLConfigService() = 0; | 234 virtual net::SSLConfigService* GetSSLConfigService() = 0; |
| 235 | 235 |
| 236 // Returns the Hostname <-> Content settings map for this profile. | 236 // Returns the Hostname <-> Content settings map for this profile. |
| 237 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; | 237 virtual HostContentSettingsMap* GetHostContentSettingsMap() = 0; |
| 238 | 238 |
| 239 // Returns the ProtocolHandlerRegistry, creating if not yet created. | 239 // Returns the ProtocolHandlerRegistry, creating if not yet created. |
| 240 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. | 240 // TODO(smckay): replace this with access via ProtocolHandlerRegistryFactory. |
| 241 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; | 241 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() = 0; |
| 242 | 242 |
| 243 // Return whether 2 profiles are the same. 2 profiles are the same if they | 243 // Return whether 2 profiles are the same. 2 profiles are the same if they |
| 244 // represent the same profile. This can happen if there is pointer equality | 244 // represent the same profile. This can happen if there is pointer equality |
| 245 // or if one profile is the incognito version of another profile (or vice | 245 // or if one profile is the incognito version of another profile (or vice |
| 246 // versa). | 246 // versa). |
| 247 virtual bool IsSameProfile(Profile* profile) = 0; | 247 virtual bool IsSameProfile(Profile* profile) = 0; |
| 248 | 248 |
| 249 // Returns the time the profile was started. This is not the time the profile | 249 // Returns the time the profile was started. This is not the time the profile |
| 250 // was created, rather it is the time the user started chrome and logged into | 250 // was created, rather it is the time the user started chrome and logged into |
| 251 // this profile. For the single profile case, this corresponds to the time | 251 // this profile. For the single profile case, this corresponds to the time |
| 252 // the user started chrome. | 252 // the user started chrome. |
| 253 virtual base::Time GetStartTime() const = 0; | 253 virtual base::Time GetStartTime() const = 0; |
| 254 | 254 |
| 255 // Returns the last directory that was chosen for uploading or opening a file. | 255 // Returns the last directory that was chosen for uploading or opening a file. |
| 256 virtual FilePath last_selected_directory() = 0; | 256 virtual base::FilePath last_selected_directory() = 0; |
| 257 virtual void set_last_selected_directory(const FilePath& path) = 0; | 257 virtual void set_last_selected_directory(const base::FilePath& path) = 0; |
| 258 | 258 |
| 259 #if defined(OS_CHROMEOS) | 259 #if defined(OS_CHROMEOS) |
| 260 enum AppLocaleChangedVia { | 260 enum AppLocaleChangedVia { |
| 261 // Caused by chrome://settings change. | 261 // Caused by chrome://settings change. |
| 262 APP_LOCALE_CHANGED_VIA_SETTINGS, | 262 APP_LOCALE_CHANGED_VIA_SETTINGS, |
| 263 // Locale has been reverted via LocaleChangeGuard. | 263 // Locale has been reverted via LocaleChangeGuard. |
| 264 APP_LOCALE_CHANGED_VIA_REVERT, | 264 APP_LOCALE_CHANGED_VIA_REVERT, |
| 265 // From login screen. | 265 // From login screen. |
| 266 APP_LOCALE_CHANGED_VIA_LOGIN, | 266 APP_LOCALE_CHANGED_VIA_LOGIN, |
| 267 // Source unknown. | 267 // Source unknown. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 struct hash<Profile*> { | 385 struct hash<Profile*> { |
| 386 std::size_t operator()(Profile* const& p) const { | 386 std::size_t operator()(Profile* const& p) const { |
| 387 return reinterpret_cast<std::size_t>(p); | 387 return reinterpret_cast<std::size_t>(p); |
| 388 } | 388 } |
| 389 }; | 389 }; |
| 390 | 390 |
| 391 } // namespace BASE_HASH_NAMESPACE | 391 } // namespace BASE_HASH_NAMESPACE |
| 392 #endif | 392 #endif |
| 393 | 393 |
| 394 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 394 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
| OLD | NEW |