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

Unified Diff: chrome/browser/browser_init.cc

Issue 13368: Fixes two session restore bugs:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_init.cc
===================================================================
--- chrome/browser/browser_init.cc (revision 6760)
+++ chrome/browser/browser_init.cc (working copy)
@@ -115,6 +115,13 @@
SessionStartupPref pref = SessionStartupPref::GetStartupPref(profile);
if (command_line.HasSwitch(switches::kRestoreLastSession))
pref.type = SessionStartupPref::LAST;
+ if (command_line.HasSwitch(switches::kIncognito) &&
+ pref.type == SessionStartupPref::LAST) {
+ // We don't store session information when incognito. If the user has
+ // chosen to restore last session and launched incognito, fallback to
+ // default launch behavior.
+ pref.type = SessionStartupPref::DEFAULT;
+ }
return pref;
}
@@ -546,7 +553,10 @@
void BrowserInit::LaunchWithProfile::AddCrashedInfoBarIfNecessary(
TabContents* tab) {
- if (!profile_->DidLastSessionExitCleanly()) {
+ // Assume that if the user is launching incognito they were previously
+ // running incognito so that we have nothing to restore from.
+ if (!profile_->DidLastSessionExitCleanly() &&
+ !profile_->IsOffTheRecord()) {
// The last session didn't exit cleanly. Show an infobar to the user
// so that they can restore if they want. The delegate deletes itself when
// it is closed.
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698