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

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

Issue 168033003: Pass in correct parameter to MenuController::SelectByChar() on Linux Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix BookmarkBarViewTest10.KeyEvents Created 6 years, 10 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 | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 480c5aed0b3ad65d9f9499c3d5136e9d03f86fa2..4ee0f5d6d9c6ed335f40fa6e3b84f9daf7bdef40 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -18,6 +18,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
+#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/native_widget_types.h"
@@ -88,7 +89,7 @@ const float kMaximumLengthMovedToActivate = 4.0f;
// Returns true if the mnemonic of |menu| matches key.
bool MatchesMnemonic(MenuItemView* menu, base::char16 key) {
- return menu->GetMnemonic() == key;
+ return key != 0 && menu->GetMnemonic() == key;
}
// Returns true if |menu| doesn't have a mnemonic and first character of the its
@@ -1071,7 +1072,9 @@ uint32_t MenuController::Dispatch(const base::NativeEvent& event) {
if (!OnKeyDown(ui::KeyboardCodeFromNative(event)))
return POST_DISPATCH_QUIT_LOOP;
- bool should_exit = SelectByChar(ui::KeyboardCodeFromNative(event));
+ char c = ui::GetCharacterFromKeyCode(
+ ui::KeyboardCodeFromNative(event), flags);
+ bool should_exit = SelectByChar(c);
return should_exit ? POST_DISPATCH_QUIT_LOOP : POST_DISPATCH_NONE;
}
case ui::ET_KEY_RELEASED:
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698