Index: chrome/browser/ui/startup/startup_browser_creator.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc |
index 295690e2afde26702b72264593bcd70ab0648474..845916ee732124a82ce6294703be86b281ceee5c 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
@@ -388,6 +388,19 @@ SessionStartupPref StartupBrowserCreator::GetSessionStartupPref( |
!profile->IsNewProfile()) { |
pref.type = SessionStartupPref::LAST; |
} |
+ |
+ // A browser starting for a profile being unlocked should always restore. |
+ if (!profile->IsGuestSession()) { |
+ ProfileInfoCache& info_cache = |
+ g_browser_process->profile_manager()->GetProfileInfoCache(); |
+ size_t index = info_cache.GetIndexOfProfileWithPath(profile->GetPath()); |
+ |
+ if (index != std::string::npos && |
+ info_cache.ProfileIsSigninRequiredAtIndex(index)) { |
+ pref.type = SessionStartupPref::LAST; |
+ } |
+ } |
+ |
if (pref.type == SessionStartupPref::LAST && |
IncognitoModePrefs::ShouldLaunchIncognito(command_line, prefs)) { |
// We don't store session information when incognito. If the user has |