summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 02:41:24 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 02:41:24 +0000
commit7e308ceced1017bee07a1359f22a37b485feb812 (patch)
tree325cb661325fc1f7361f3ab5f0ca46c3f64e85c3 /chrome/browser
parentfece3c739d5a17ab0ad08cc0bdd1e7ddb88b645d (diff)
downloadchromium_src-7e308ceced1017bee07a1359f22a37b485feb812.zip
chromium_src-7e308ceced1017bee07a1359f22a37b485feb812.tar.gz
chromium_src-7e308ceced1017bee07a1359f22a37b485feb812.tar.bz2
[Mac] Save window position into the SessionService, so we can restore it after a crash.
BUG=20909 TEST=Start chrome, load some pages/tabs, move the window somewhere else. Click away and back to the window (to trigger saving window position). Kill chrome (you may have to use kill -9 to actually kill it uncleanly). Restart, click to restore pages. Window should jump to where it was before the crash. Review URL: http://codereview.chromium.org/660395 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/browser_window_controller_private.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller_private.mm b/chrome/browser/cocoa/browser_window_controller_private.mm
index f05b02b2..fd25b91 100644
--- a/chrome/browser/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/cocoa/browser_window_controller_private.mm
@@ -79,6 +79,10 @@ const CGFloat kLocBarBottomInset = 1;
gfx::Rect workArea(NSRectToCGRect([windowScreen visibleFrame]));
workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height());
+ // Browser::SaveWindowPlacement is used for session restore.
+ if (browser_->ShouldSaveWindowPlacement())
+ browser_->SaveWindowPlacement(bounds, /*maximized=*/ false);
+
DictionaryValue* windowPreferences = prefs->GetMutableDictionary(
browser_->GetWindowPlacementKey().c_str());
windowPreferences->SetInteger(L"left", bounds.x());