Index: chrome/browser/ui/browser_init.cc |
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc |
index 79498baa8a7fec427abad21c6e5e87bf1f5ba052..2332d4c8ea8868dba23cebee05d3da62a643c8ba 100644 |
--- a/chrome/browser/ui/browser_init.cc |
+++ b/chrome/browser/ui/browser_init.cc |
@@ -375,6 +375,7 @@ bool SessionCrashedInfoBarDelegate::Accept() { |
// clobber it. |
behavior = SessionRestore::CLOBBER_CURRENT_TAB; |
} |
+ behavior |= SessionRestore::RESTORE_SESSION_STATE; |
SessionRestore::RestoreSession( |
profile_, browser, behavior, std::vector<GURL>()); |
return true; |
@@ -951,6 +952,14 @@ bool BrowserInit::LaunchWithProfile::ProcessStartupURLs( |
uint32 restore_behavior = SessionRestore::SYNCHRONOUS | |
SessionRestore::ALWAYS_CREATE_TABBED_BROWSER; |
+ |
+ if (!profile_->DidLastSessionExitCleanly() || |
+ CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kRestoreLastSession)) { |
+ // Crash or auto-update. Restore the session state. |
+ restore_behavior |= SessionRestore::RESTORE_SESSION_STATE; |
+ } |
+ |
#if defined(OS_MACOSX) |
// On Mac, when restoring a session with no windows, suppress the creation |
// of a new window in the case where the system is launching Chrome via a |