summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions/session_service.cc
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:33:55 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:33:55 +0000
commit4070a6b1efcb2dbea12508a0b912cfa3bc86f47e (patch)
treebdf564c66c7a2d63d5d5bafdcccb27c233b969af /chrome/browser/sessions/session_service.cc
parentd57baa939d66854a7f6d4e8e149ddf16578a46df (diff)
downloadchromium_src-4070a6b1efcb2dbea12508a0b912cfa3bc86f47e.zip
chromium_src-4070a6b1efcb2dbea12508a0b912cfa3bc86f47e.tar.gz
chromium_src-4070a6b1efcb2dbea12508a0b912cfa3bc86f47e.tar.bz2
Mac: don't restore explicitly closed windows.
With "On startup"/"Restore the pages that were open last" set (in Preferences), a window which was explicitly closed (using the red button, Cmd-Shift-W, the menu item -- but not due to quit) should not be restored on startup. This is the behaviour of Firefox and Camino (Safari doesn't appear to implement this feature). Note about this patch: Depending on how we decide things will work for App mode, much more code could be disabled on Mac. BUG=13341 TEST=Set the browser to restore pages on start (see above). Navigate somewhere interesting; close window; quit; restart; should open a browser with default window (NTP or homepage or whatever). Navigate somewhere; quit; restart; should open previously opened stuff. Make sure that session restore (also crash recovery) still work as expected. Review URL: http://codereview.chromium.org/362016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions/session_service.cc')
-rw-r--r--chrome/browser/sessions/session_service.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 6b9bd65..8b2575d 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -238,7 +238,7 @@ void SessionService::WindowClosing(const SessionID& window_id) {
// false to true, so only update it if already true.
has_open_trackable_browsers_ = HasOpenTrackableBrowsers(window_id);
}
- if (!has_open_trackable_browsers_)
+ if (should_record_close_as_pending())
pending_window_close_ids_.insert(window_id.id());
else
window_closing_ids_.insert(window_id.id());
@@ -257,7 +257,7 @@ void SessionService::WindowClosed(const SessionID& window_id) {
pending_window_close_ids_.end()) {
// We'll hit this if user closed the last tab in a window.
has_open_trackable_browsers_ = HasOpenTrackableBrowsers(window_id);
- if (!has_open_trackable_browsers_)
+ if (should_record_close_as_pending())
pending_window_close_ids_.insert(window_id.id());
else
ScheduleCommand(CreateWindowClosedCommand(window_id.id()));