summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/constrained_window_gtk.h
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 20:15:29 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 20:15:29 +0000
commit0d8446f1516e7cbcfcb3654c185a13602f9d82c4 (patch)
tree07b1c82135031d531491ab8ce648dd14d8a38d6e /chrome/browser/gtk/constrained_window_gtk.h
parente5ae96a15b687fffe178eb8c4a7ea79a1ddd679c (diff)
downloadchromium_src-0d8446f1516e7cbcfcb3654c185a13602f9d82c4.zip
chromium_src-0d8446f1516e7cbcfcb3654c185a13602f9d82c4.tar.gz
chromium_src-0d8446f1516e7cbcfcb3654c185a13602f9d82c4.tar.bz2
Fixed ESC handling on constrained dialogs on GTK. We used to stop the entire page navigation previously instead of continuing with other page elements if some can't be loaded. This change makes GTK implementation consistent with other platforms.
BUG=27585 TEST=go to http://www/~thakis/cgi-bin/test.html, press ESC when login dialog appears, observe broken image #1, press ESC on the next dialog, observe broken image #2. Review URL: http://codereview.chromium.org/1627022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/constrained_window_gtk.h')
-rw-r--r--chrome/browser/gtk/constrained_window_gtk.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/gtk/constrained_window_gtk.h b/chrome/browser/gtk/constrained_window_gtk.h
index fdfedf1..0af6e63 100644
--- a/chrome/browser/gtk/constrained_window_gtk.h
+++ b/chrome/browser/gtk/constrained_window_gtk.h
@@ -5,9 +5,10 @@
#ifndef CHROME_BROWSER_GTK_CONSTRAINED_WINDOW_GTK_H_
#define CHROME_BROWSER_GTK_CONSTRAINED_WINDOW_GTK_H_
-#include "chrome/browser/tab_contents/constrained_window.h"
+#include <gtk/gtk.h>
#include "base/basictypes.h"
+#include "chrome/browser/tab_contents/constrained_window.h"
#include "chrome/common/owned_widget_gtk.h"
class TabContents;
@@ -53,6 +54,20 @@ class ConstrainedWindowGtk : public ConstrainedWindow {
ConstrainedWindowGtk(TabContents* owner,
ConstrainedWindowGtkDelegate* delegate);
+ // Connects the ESC accelerator to the window.
+ void ConnectAccelerators();
+
+ // Handles an ESC accelerator being pressed.
+ static gboolean OnEscapeThunk(GtkAccelGroup* accel_group,
+ GObject* acceleratable,
+ guint keyval,
+ GdkModifierType modifier,
+ gpointer user_data) {
+ return reinterpret_cast<ConstrainedWindowGtk*>(user_data)->OnEscape();
+ }
+
+ gboolean OnEscape();
+
// The TabContents that owns and constrains this ConstrainedWindow.
TabContents* owner_;
@@ -65,6 +80,8 @@ class ConstrainedWindowGtk : public ConstrainedWindow {
// Stores if |ShowConstrainedWindow()| has been called.
bool visible_;
+ GtkAccelGroup* accel_group_;
+
DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowGtk);
};