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 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 static Profile* CreateProfile(const FilePath& path, | 140 static Profile* CreateProfile(const FilePath& path, |
141 Delegate* delegate, | 141 Delegate* delegate, |
142 CreateMode create_mode); | 142 CreateMode create_mode); |
143 | 143 |
144 // Returns the profile corresponding to the given browser context. | 144 // Returns the profile corresponding to the given browser context. |
145 static Profile* FromBrowserContext(content::BrowserContext* browser_context); | 145 static Profile* FromBrowserContext(content::BrowserContext* browser_context); |
146 | 146 |
147 // Returns the profile corresponding to the given WebUI. | 147 // Returns the profile corresponding to the given WebUI. |
148 static Profile* FromWebUI(content::WebUI* web_ui); | 148 static Profile* FromWebUI(content::WebUI* web_ui); |
149 | 149 |
150 // TODO(rlp): Please do not use this function. It is a temporary fix | |
151 // for M19 stable. See crbug.com/125292. | |
152 static net::URLRequestContextGetter* GetDefaultRequestContextDeprecated() { | |
153 return Profile::GetDefaultRequestContext(); | |
154 } | |
155 | |
156 // content::BrowserContext implementation ------------------------------------ | 150 // content::BrowserContext implementation ------------------------------------ |
157 | 151 |
158 // Typesafe upcast. | 152 // Typesafe upcast. |
159 virtual TestingProfile* AsTestingProfile(); | 153 virtual TestingProfile* AsTestingProfile(); |
160 | 154 |
161 // Returns the name associated with this profile. This name is displayed in | 155 // Returns the name associated with this profile. This name is displayed in |
162 // the browser frame. | 156 // the browser frame. |
163 virtual std::string GetProfileName() = 0; | 157 virtual std::string GetProfileName() = 0; |
164 | 158 |
165 // Return the incognito version of this profile. The returned pointer | 159 // Return the incognito version of this profile. The returned pointer |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 253 |
260 // Retrieves a pointer to the PrefService that manages the preferences | 254 // Retrieves a pointer to the PrefService that manages the preferences |
261 // for this user profile. | 255 // for this user profile. |
262 virtual PrefService* GetPrefs() = 0; | 256 virtual PrefService* GetPrefs() = 0; |
263 | 257 |
264 // Retrieves a pointer to the PrefService that manages the preferences | 258 // Retrieves a pointer to the PrefService that manages the preferences |
265 // for OffTheRecord Profiles. This PrefService is lazily created the first | 259 // for OffTheRecord Profiles. This PrefService is lazily created the first |
266 // time that this method is called. | 260 // time that this method is called. |
267 virtual PrefService* GetOffTheRecordPrefs() = 0; | 261 virtual PrefService* GetOffTheRecordPrefs() = 0; |
268 | 262 |
| 263 // Returns the main request context. |
| 264 virtual net::URLRequestContextGetter* GetRequestContext() = 0; |
| 265 |
269 // Returns the request context used for extension-related requests. This | 266 // Returns the request context used for extension-related requests. This |
270 // is only used for a separate cookie store currently. | 267 // is only used for a separate cookie store currently. |
271 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; | 268 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; |
272 | 269 |
273 // Returns the request context used within an installed app that has | 270 // Returns the request context used within an installed app that has |
274 // requested isolated storage. | 271 // requested isolated storage. |
275 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( | 272 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( |
276 const std::string& app_id) = 0; | 273 const std::string& app_id) = 0; |
277 | 274 |
278 // Returns the SSLConfigService for this profile. | 275 // Returns the SSLConfigService for this profile. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 friend class ChromeURLDataManagerFactory; | 401 friend class ChromeURLDataManagerFactory; |
405 friend class OffTheRecordProfileImpl; | 402 friend class OffTheRecordProfileImpl; |
406 | 403 |
407 // Returns a callback to a method returning a |ChromeURLDataManagerBackend|. | 404 // Returns a callback to a method returning a |ChromeURLDataManagerBackend|. |
408 // Used to create a |ChromeURLDataManager| for this |Profile|. | 405 // Used to create a |ChromeURLDataManager| for this |Profile|. |
409 // TODO(erg, willchan): Remove this once |ProfileIOData| is made into a | 406 // TODO(erg, willchan): Remove this once |ProfileIOData| is made into a |
410 // |ProfileKeyedService|. | 407 // |ProfileKeyedService|. |
411 virtual base::Callback<ChromeURLDataManagerBackend*(void)> | 408 virtual base::Callback<ChromeURLDataManagerBackend*(void)> |
412 GetChromeURLDataManagerBackendGetter() const = 0; | 409 GetChromeURLDataManagerBackendGetter() const = 0; |
413 | 410 |
414 static net::URLRequestContextGetter* default_request_context_; | |
415 | |
416 private: | 411 private: |
417 // ***DEPRECATED**: You should be passing in the specific profile's | |
418 // URLRequestContextGetter or using the system URLRequestContextGetter. | |
419 // | |
420 // Returns the request context for the "default" profile. This may be called | |
421 // from any thread. This CAN return NULL if a first request context has not | |
422 // yet been created. If necessary, listen on the UI thread for | |
423 // NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE. | |
424 static net::URLRequestContextGetter* GetDefaultRequestContext(); | |
425 | |
426 bool restored_last_session_; | 412 bool restored_last_session_; |
427 | 413 |
428 // Accessibility events will only be propagated when the pause | 414 // Accessibility events will only be propagated when the pause |
429 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents | 415 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents |
430 // increment and decrement the level, respectively, rather than set it to | 416 // increment and decrement the level, respectively, rather than set it to |
431 // true or false, so that calls can be nested. | 417 // true or false, so that calls can be nested. |
432 int accessibility_pause_level_; | 418 int accessibility_pause_level_; |
433 }; | 419 }; |
434 | 420 |
435 #if defined(COMPILER_GCC) | 421 #if defined(COMPILER_GCC) |
436 namespace BASE_HASH_NAMESPACE { | 422 namespace BASE_HASH_NAMESPACE { |
437 | 423 |
438 template<> | 424 template<> |
439 struct hash<Profile*> { | 425 struct hash<Profile*> { |
440 std::size_t operator()(Profile* const& p) const { | 426 std::size_t operator()(Profile* const& p) const { |
441 return reinterpret_cast<std::size_t>(p); | 427 return reinterpret_cast<std::size_t>(p); |
442 } | 428 } |
443 }; | 429 }; |
444 | 430 |
445 } // namespace BASE_HASH_NAMESPACE | 431 } // namespace BASE_HASH_NAMESPACE |
446 #endif | 432 #endif |
447 | 433 |
448 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 434 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |