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

Unified Diff: views/controls/menu/menu_controller.cc

Issue 3046002: Fixes crash in views/gtk when pressing space bar on a menu button. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_controller.cc
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index 2622523949f00f55f5b3020c53378084e84767df..22540e3a10a8c19544648dff2c13a2759cc1f781 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -822,8 +822,14 @@ bool MenuController::Dispatch(GdkEvent* event) {
case GDK_KEY_PRESS: {
base::KeyboardCode win_keycode =
base::WindowsKeyCodeForGdkKeyCode(event->key.keyval);
+
if (!OnKeyDown(win_keycode))
return false;
+
+ // OnKeyDown may have set exit_type_.
+ if (exit_type_ != EXIT_NONE)
+ return false;
+
guint32 keycode = gdk_keyval_to_unicode(event->key.keyval);
if (keycode)
return !SelectByChar(keycode);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698