summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 18:15:59 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 18:15:59 +0000
commit8798c7800a9d67ec0db0c56afba37058d89fbef3 (patch)
treeed799e5e17aa23126769f63ed74006a6eb13b1d0 /chrome/browser
parentf8df76ea2cda17224cb8df1ac9e3e82775fa5345 (diff)
downloadchromium_src-8798c7800a9d67ec0db0c56afba37058d89fbef3.zip
chromium_src-8798c7800a9d67ec0db0c56afba37058d89fbef3.tar.gz
chromium_src-8798c7800a9d67ec0db0c56afba37058d89fbef3.tar.bz2
This matches the behavior on Windows. Also this change lets user close Chrome by clicking 'x' button even if a popup (for example - bookmark bubble) is open.
BUG=NONE TEST=1. Click on bookmark star button to open bookmark bubble. Switch focus to some other Window, bubble should close automatically. 2. Click on bookmark star button to open bookmark bubble. Close chrome by clicking on Window close button ('x') and Chrome should close. Review URL: http://codereview.chromium.org/149757 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/info_bubble_gtk.cc7
-rw-r--r--chrome/browser/gtk/info_bubble_gtk.h8
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/gtk/info_bubble_gtk.cc b/chrome/browser/gtk/info_bubble_gtk.cc
index 5708818..8c8cbad 100644
--- a/chrome/browser/gtk/info_bubble_gtk.cc
+++ b/chrome/browser/gtk/info_bubble_gtk.cc
@@ -192,6 +192,8 @@ void InfoBubbleGtk::Init(GtkWindow* transient_toplevel,
G_CALLBACK(&HandleButtonPressThunk), this);
g_signal_connect(window_, "destroy",
G_CALLBACK(&HandleDestroyThunk), this);
+ g_signal_connect(window_, "focus-out-event",
+ G_CALLBACK(&HandleFocusOutThunk), this);
gtk_widget_show_all(window_);
// Make sure our window has focus, is brought to the top, etc.
@@ -248,3 +250,8 @@ gboolean InfoBubbleGtk::HandleDestroy() {
delete this;
return FALSE; // Propagate.
}
+
+gboolean InfoBubbleGtk::HandleFocusOut(GdkEventButton* event) {
+ Close();
+ return FALSE; // Propagate.
+}
diff --git a/chrome/browser/gtk/info_bubble_gtk.h b/chrome/browser/gtk/info_bubble_gtk.h
index 695537a..ac08aa0 100644
--- a/chrome/browser/gtk/info_bubble_gtk.h
+++ b/chrome/browser/gtk/info_bubble_gtk.h
@@ -103,6 +103,14 @@ class InfoBubbleGtk {
}
gboolean HandleDestroy();
+ static gboolean HandleFocusOutThunk(GtkWidget* widget,
+ GdkEventButton* event,
+ gpointer userdata) {
+ return reinterpret_cast<InfoBubbleGtk*>(userdata)->
+ HandleFocusOut(event);
+ }
+ gboolean HandleFocusOut(GdkEventButton* event);
+
// The caller supplied delegate, can be NULL.
InfoBubbleGtkDelegate* delegate_;