summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/tab_restore_service.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 23:37:36 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-05 23:37:36 +0000
commit95e394714d67b3a6951f351ae0b7e7c5ff02aab6 (patch)
tree226eb73c8cb5d122807dd949ab6081601d9fdc4d /chrome/browser/sessions/tab_restore_service.cc
parent3bf196c17d3a5f619fa8cbda848bce764bffdbf4 (diff)
downloadchromium_src-95e394714d67b3a6951f351ae0b7e7c5ff02aab6.zip
chromium_src-95e394714d67b3a6951f351ae0b7e7c5ff02aab6.tar.gz
chromium_src-95e394714d67b3a6951f351ae0b7e7c5ff02aab6.tar.bz2
Fixes two bugs that made tab restore service not return the right set
of tabs during an exit on chromeos. . When we forcefully shutdown we wouldn't tell TabRestoreService the browsers was closing, which resulted in not recording the close. . BrowserCommandController was triggering creation of TabRestoreService during shutdown. BUG=150799 TEST=see bug R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/11049016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/tab_restore_service.cc')
-rw-r--r--chrome/browser/sessions/tab_restore_service.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc
index d29f042..a83f9d1 100644
--- a/chrome/browser/sessions/tab_restore_service.cc
+++ b/chrome/browser/sessions/tab_restore_service.cc
@@ -451,11 +451,14 @@ void TabRestoreService::LoadTabsFromLastSession() {
SessionService* session_service =
SessionServiceFactory::GetForProfile(profile());
- if (!profile()->restored_last_session() &&
- profile()->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
- session_service) {
- // The previous session crashed and wasn't restored. Load the tabs/windows
- // that were open at the point of crash from the session service.
+ Profile::ExitType exit_type = profile()->GetLastSessionExitType();
+ if (!profile()->restored_last_session() && session_service &&
+ (exit_type == Profile::EXIT_CRASHED ||
+ exit_type == Profile::EXIT_SESSION_ENDED)) {
+ // The previous session crashed and wasn't restored, or was a forced
+ // shutdown. Both of which won't have notified us of the browser close so
+ // that we need to load the windows from session service (which will have
+ // saved them).
session_service->GetLastSession(
&crash_consumer_,
base::Bind(&TabRestoreService::OnGotPreviousSession,