Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: views/widget/widget_gtk.h

Issue 3046041: [Linux Views] Refactor accelerator handler related code. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Prevent ctrl+alt. Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: views/widget/widget_gtk.h
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index d010b037e3adf3c84a51ff23b3cc4f6954011d7f..7e1bdd14c84968f42d3ff420ffae2477b8c49985 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -198,6 +198,10 @@ class WidgetGtk
// Clears the focus on the native widget having the focus.
virtual void ClearNativeFocus();
+ // Handles a keyboard event by sending it to our focus manager.
+ // Returns true if it's handled by the focus manager.
+ bool HandleKeyboardEvent(GdkEventKey* event);
+
protected:
// If widget containes another widget, translates event coordinates to the
// contained widget's coordinates, else returns original event coordinates.
@@ -247,8 +251,7 @@ class WidgetGtk
CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnButtonRelease, GdkEventButton*);
CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnFocusIn, GdkEventFocus*);
CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnFocusOut, GdkEventFocus*);
- CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnKeyPress, GdkEventKey*);
- CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnKeyRelease, GdkEventKey*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnKeyEvent, GdkEventKey*);
CHROMEGTK_CALLBACK_4(WidgetGtk, gboolean, OnQueryTooltip,
gint, gint, gboolean, GtkTooltip*);
CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnScroll, GdkEventScroll*);
@@ -436,6 +439,9 @@ class WidgetGtk
// This is false by default.
bool is_double_buffered_;
+ // Indicates if we should handle the upcoming Alt key release event.
+ bool should_handle_menu_key_release_;
+
DISALLOW_COPY_AND_ASSIGN(WidgetGtk);
};

Powered by Google App Engine
This is Rietveld 408576698