From 9371ece3daf3ae30cec6bcfce42a4daf75944481 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Thu, 21 May 2009 19:06:00 +0000 Subject: Close the old browser window after SessionRestore. SessionRestore needs to know the last active browser in order to close it after the session restore. Add the call to BrowserList::SetLastActive() to accomplish this. BUG=http://www.crbug.com/12372 TEST=Crash the browser. Open a new browser. Click on restore. The old browser window should close and the old session should appear in the new browser window. Review URL: http://codereview.chromium.org/113691 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16637 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/browser_window_gtk.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 2c4d0c5..1067340 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -265,6 +265,11 @@ gboolean OnButtonPressEvent(GtkWidget* widget, GdkEventButton* event, return FALSE; } +gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* event, Browser* browser) { + BrowserList::SetLastActive(browser); + return FALSE; +} + } // namespace // TODO(estade): Break up this constructor into helper functions to improve @@ -290,6 +295,8 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) G_CALLBACK(OnKeyPress), browser_.get()); g_signal_connect(window_, "button-press-event", G_CALLBACK(OnButtonPressEvent), browser_.get()); + g_signal_connect(window_, "focus-in-event", + G_CALLBACK(OnFocusIn), browser_.get()); ConnectAccelerators(); bounds_ = GetInitialWindowBounds(window_); -- cgit v1.1