Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: chrome/browser/profiles/profile.h

Issue 10735042: Revert 145969 - Removing last usage of default request context. Fixing up login_utils to not need i… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
150 // content::BrowserContext implementation ------------------------------------ 156 // content::BrowserContext implementation ------------------------------------
151 157
152 // Typesafe upcast. 158 // Typesafe upcast.
153 virtual TestingProfile* AsTestingProfile(); 159 virtual TestingProfile* AsTestingProfile();
154 160
155 // Returns the name associated with this profile. This name is displayed in 161 // Returns the name associated with this profile. This name is displayed in
156 // the browser frame. 162 // the browser frame.
157 virtual std::string GetProfileName() = 0; 163 virtual std::string GetProfileName() = 0;
158 164
159 // Return the incognito version of this profile. The returned pointer 165 // Return the incognito version of this profile. The returned pointer
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 259
254 // Retrieves a pointer to the PrefService that manages the preferences 260 // Retrieves a pointer to the PrefService that manages the preferences
255 // for this user profile. 261 // for this user profile.
256 virtual PrefService* GetPrefs() = 0; 262 virtual PrefService* GetPrefs() = 0;
257 263
258 // Retrieves a pointer to the PrefService that manages the preferences 264 // Retrieves a pointer to the PrefService that manages the preferences
259 // for OffTheRecord Profiles. This PrefService is lazily created the first 265 // for OffTheRecord Profiles. This PrefService is lazily created the first
260 // time that this method is called. 266 // time that this method is called.
261 virtual PrefService* GetOffTheRecordPrefs() = 0; 267 virtual PrefService* GetOffTheRecordPrefs() = 0;
262 268
263 // Returns the main request context.
264 virtual net::URLRequestContextGetter* GetRequestContext() = 0;
265
266 // Returns the request context used for extension-related requests. This 269 // Returns the request context used for extension-related requests. This
267 // is only used for a separate cookie store currently. 270 // is only used for a separate cookie store currently.
268 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; 271 virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0;
269 272
270 // Returns the request context used within an installed app that has 273 // Returns the request context used within an installed app that has
271 // requested isolated storage. 274 // requested isolated storage.
272 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( 275 virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp(
273 const std::string& app_id) = 0; 276 const std::string& app_id) = 0;
274 277
275 // Returns the SSLConfigService for this profile. 278 // Returns the SSLConfigService for this profile.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 friend class ChromeURLDataManagerFactory; 404 friend class ChromeURLDataManagerFactory;
402 friend class OffTheRecordProfileImpl; 405 friend class OffTheRecordProfileImpl;
403 406
404 // Returns a callback to a method returning a |ChromeURLDataManagerBackend|. 407 // Returns a callback to a method returning a |ChromeURLDataManagerBackend|.
405 // Used to create a |ChromeURLDataManager| for this |Profile|. 408 // Used to create a |ChromeURLDataManager| for this |Profile|.
406 // TODO(erg, willchan): Remove this once |ProfileIOData| is made into a 409 // TODO(erg, willchan): Remove this once |ProfileIOData| is made into a
407 // |ProfileKeyedService|. 410 // |ProfileKeyedService|.
408 virtual base::Callback<ChromeURLDataManagerBackend*(void)> 411 virtual base::Callback<ChromeURLDataManagerBackend*(void)>
409 GetChromeURLDataManagerBackendGetter() const = 0; 412 GetChromeURLDataManagerBackendGetter() const = 0;
410 413
414 static net::URLRequestContextGetter* default_request_context_;
415
411 private: 416 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
412 bool restored_last_session_; 426 bool restored_last_session_;
413 427
414 // Accessibility events will only be propagated when the pause 428 // Accessibility events will only be propagated when the pause
415 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents 429 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents
416 // increment and decrement the level, respectively, rather than set it to 430 // increment and decrement the level, respectively, rather than set it to
417 // true or false, so that calls can be nested. 431 // true or false, so that calls can be nested.
418 int accessibility_pause_level_; 432 int accessibility_pause_level_;
419 }; 433 };
420 434
421 #if defined(COMPILER_GCC) 435 #if defined(COMPILER_GCC)
422 namespace BASE_HASH_NAMESPACE { 436 namespace BASE_HASH_NAMESPACE {
423 437
424 template<> 438 template<>
425 struct hash<Profile*> { 439 struct hash<Profile*> {
426 std::size_t operator()(Profile* const& p) const { 440 std::size_t operator()(Profile* const& p) const {
427 return reinterpret_cast<std::size_t>(p); 441 return reinterpret_cast<std::size_t>(p);
428 } 442 }
429 }; 443 };
430 444
431 } // namespace BASE_HASH_NAMESPACE 445 } // namespace BASE_HASH_NAMESPACE
432 #endif 446 #endif
433 447
434 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ 448 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698