summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_restore.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 03:36:50 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-11 03:36:50 +0000
commit4831051e6bce5f55c3954bea208c0ce118ea25ff (patch)
tree2e322210d62b1078b6c5c6279ddd597c00640312 /chrome/browser/sessions/session_restore.cc
parentbbe50755c1a8d0cdea4b3b0699b70806dfae2e23 (diff)
downloadchromium_src-4831051e6bce5f55c3954bea208c0ce118ea25ff.zip
chromium_src-4831051e6bce5f55c3954bea208c0ce118ea25ff.tar.gz
chromium_src-4831051e6bce5f55c3954bea208c0ce118ea25ff.tar.bz2
Fixes two session restore bugs:
. If the user launches incognito we don't attempt to restore last session and instead just do default launch behavior (new tab page). . Don't show the session restore info bar when launched incognito. I'm assuming that if the user launched in incognito they were previously running incognito so that there is nothing to restore. BUG=4381 5119 TEST=turn on session restore and launch with --incognito, make sure the incognito window comes up. Review URL: http://codereview.chromium.org/13368 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_restore.cc')
-rw-r--r--chrome/browser/sessions/session_restore.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 74038ce..e9e0b1d1 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -417,8 +417,13 @@ static void Restore(Profile* profile,
bool always_create_tabbed_browser,
const std::vector<GURL>& urls_to_open) {
DCHECK(profile);
- if (!profile->GetSessionService())
+ // Always restore from the original profile (incognito profiles have no
+ // session service).
+ profile = profile->GetOriginalProfile();
+ if (!profile->GetSessionService()) {
+ NOTREACHED();
return;
+ }
// SessionRestoreImpl takes care of deleting itself when done.
SessionRestoreImpl* restorer =
new SessionRestoreImpl(profile, browser, synchronous,