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

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

Issue 866983006: MacViews: Intercept events for Menus (after AppKit has turned them into action messages). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150127-MacViews-SendTextfieldToWindow-TEXTFIELD
Patch Set: better IME handling Created 5 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
Index: ui/views/controls/menu/menu_controller.h
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index 92ea8c4a29f0c5a811019a81cd9107e181e76ad5..76060b0164535417564b6d0e727b01a3dded88dd 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -160,6 +160,13 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// corresponds to whether or not the menu should close.
void OnDragComplete(bool should_close);
+ // Called while dispatching messages to intercept key events.
+ // If |character| is other than 0, it is handled as a mnemonic.
+ // Otherwise, |key_code| is handled as a menu navigation command.
+ // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu.
+ ui::PostDispatchAction OnWillDispatchKeyEvent(base::char16 character,
+ ui::KeyboardCode key_code);
+
// Update the submenu's selection based on the current mouse location
void UpdateSubmenuSelection(SubmenuView* source);

Powered by Google App Engine
This is Rietveld 408576698