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

Unified Diff: chrome/browser/profiles/profile_keyed_base_factory.cc

Issue 13865012: Change GetProfileToUse method from Profile to content::BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_keyed_base_factory.cc
diff --git a/chrome/browser/profiles/profile_keyed_base_factory.cc b/chrome/browser/profiles/profile_keyed_base_factory.cc
index daa24e2735affa1a3b0b7056bc143b20a02b939b..0d57bf6b4de20b0f2611a2a41b24a503e926aaaf 100644
--- a/chrome/browser/profiles/profile_keyed_base_factory.cc
+++ b/chrome/browser/profiles/profile_keyed_base_factory.cc
@@ -28,8 +28,8 @@ void ProfileKeyedBaseFactory::DependsOn(ProfileKeyedBaseFactory* rhs) {
dependency_manager_->AddEdge(rhs, this);
}
-content::BrowserContext* ProfileKeyedBaseFactory::GetProfileToUse(
- content::BrowserContext* context) {
+content::BrowserContext* ProfileKeyedBaseFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
DCHECK(CalledOnValidThread());
Profile* profile = static_cast<Profile*>(context);
@@ -38,20 +38,9 @@ content::BrowserContext* ProfileKeyedBaseFactory::GetProfileToUse(
dependency_manager_->AssertProfileWasntDestroyed(profile);
#endif
- // Possibly handle Incognito mode.
- if (profile->IsOffTheRecord()) {
- if (ServiceRedirectedInIncognito()) {
- profile = profile->GetOriginalProfile();
-
-#ifndef NDEBUG
- dependency_manager_->AssertProfileWasntDestroyed(profile);
-#endif
- } else if (ServiceHasOwnInstanceInIncognito()) {
- // No-op; the pointers are already set correctly.
- } else {
- return NULL;
- }
- }
+ // Safe default for the Incognito mode: no service.
+ if (profile->IsOffTheRecord())
+ return NULL;
return profile;
}
@@ -92,14 +81,6 @@ void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(
}
}
-bool ProfileKeyedBaseFactory::ServiceRedirectedInIncognito() const {
- return false;
-}
-
-bool ProfileKeyedBaseFactory::ServiceHasOwnInstanceInIncognito() const {
- return false;
-}
-
bool ProfileKeyedBaseFactory::ServiceIsCreatedWithProfile() const {
return false;
}
« no previous file with comments | « chrome/browser/profiles/profile_keyed_base_factory.h ('k') | chrome/browser/profiles/profile_keyed_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698