summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 19:06:00 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 19:06:00 +0000
commit9371ece3daf3ae30cec6bcfce42a4daf75944481 (patch)
treeaaaec7dde8117116114dbb61736058ae193a0f98 /chrome/browser/gtk
parent92ecb839397040d8ddd2342a72532fd83d375535 (diff)
downloadchromium_src-9371ece3daf3ae30cec6bcfce42a4daf75944481.zip
chromium_src-9371ece3daf3ae30cec6bcfce42a4daf75944481.tar.gz
chromium_src-9371ece3daf3ae30cec6bcfce42a4daf75944481.tar.bz2
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
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc7
1 files changed, 7 insertions, 0 deletions
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_);