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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 8533013: SessionRestore: Store session cookies and restore them if chrome crashes or auto-restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 9 years, 1 month 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/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

Powered by Google App Engine
This is Rietveld 408576698