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

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

Issue 2033433006: MacViews: Modify insertText handlers to correctly handle space key and simplify menu event dispatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: 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 030600f84cc8b37673ff65c744c67c5c68e11f35..02a5b62841fec89da5920a4ec418d95abb751d8b 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1023,18 +1023,17 @@ void MenuController::OnDragComplete(bool should_close) {
}
ui::PostDispatchAction MenuController::OnWillDispatchKeyEvent(
- base::char16 character,
- ui::KeyboardCode key_code) {
+ const ui::KeyEvent& key_event) {
if (exit_type() == MenuController::EXIT_ALL ||
exit_type() == MenuController::EXIT_DESTROYED) {
TerminateNestedMessageLoopIfNecessary();
return ui::POST_DISPATCH_PERFORM_DEFAULT;
}
- if (character)
- SelectByChar(character);
+ if (key_event.is_char())
+ SelectByChar(key_event.GetCharacter());
else
- OnKeyDown(key_code);
+ OnKeyDown(key_event.key_code());
// MenuController may have been deleted, so check for an active instance
// before accessing member variables.
« ui/views/cocoa/bridged_content_view.mm ('K') | « ui/views/controls/menu/menu_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698