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

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

Issue 1968703002: MD User Manager: Creates new browser window for last active profile if one is not available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial Created 4 years, 7 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_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 9a0ed359e027b479444f1de4e679df58d4132974..9d4f882604b9870bf97427240334de621b0b5ebe 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -354,16 +354,20 @@ Profile* ProfileManager::GetLastUsedProfile() {
// static
Profile* ProfileManager::GetLastUsedProfileAllowedByPolicy() {
Profile* profile = GetLastUsedProfile();
- if (profile->IsGuestSession() ||
- profile->IsSystemProfile() ||
- IncognitoModePrefs::GetAvailability(profile->GetPrefs()) ==
- IncognitoModePrefs::FORCED) {
+ if (IncognitoModeForced(profile))
return profile->GetOffTheRecordProfile();
- }
return profile;
}
// static
+bool ProfileManager::IncognitoModeForced(Profile* profile) {
+ return profile->IsGuestSession() ||
+ profile->IsSystemProfile() ||
+ IncognitoModePrefs::GetAvailability(profile->GetPrefs()) ==
+ IncognitoModePrefs::FORCED;
+}
+
+// static
std::vector<Profile*> ProfileManager::GetLastOpenedProfiles() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->GetLastOpenedProfiles(

Powered by Google App Engine
This is Rietveld 408576698