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

Side by Side Diff: ui/views/controls/menu/menu_controller.h

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: Fix failing interactive_ui_tests. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Called by the Widget when a drag is about to start on a child view. This 170 // Called by the Widget when a drag is about to start on a child view. This
171 // could be initiated by one of our MenuItemViews, or could be through another 171 // could be initiated by one of our MenuItemViews, or could be through another
172 // child View. 172 // child View.
173 void OnDragWillStart(); 173 void OnDragWillStart();
174 174
175 // Called by the Widget when the drag has completed. |should_close| 175 // Called by the Widget when the drag has completed. |should_close|
176 // corresponds to whether or not the menu should close. 176 // corresponds to whether or not the menu should close.
177 void OnDragComplete(bool should_close); 177 void OnDragComplete(bool should_close);
178 178
179 // Called while dispatching messages to intercept key events. 179 // Called while dispatching messages to intercept key events.
180 // If |character| is other than 0, it is handled as a mnemonic.
181 // Otherwise, |key_code| is handled as a menu navigation command.
182 // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu. 180 // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu.
183 ui::PostDispatchAction OnWillDispatchKeyEvent(base::char16 character, 181 ui::PostDispatchAction OnWillDispatchKeyEvent(ui::KeyEvent* event);
184 ui::KeyboardCode key_code);
185 182
186 // Update the submenu's selection based on the current mouse location 183 // Update the submenu's selection based on the current mouse location
187 void UpdateSubmenuSelection(SubmenuView* source); 184 void UpdateSubmenuSelection(SubmenuView* source);
188 185
189 // WidgetObserver overrides: 186 // WidgetObserver overrides:
190 void OnWidgetDestroying(Widget* widget) override; 187 void OnWidgetDestroying(Widget* widget) override;
191 188
192 // Only used for testing. 189 // Only used for testing.
193 bool IsCancelAllTimerRunningForTest(); 190 bool IsCancelAllTimerRunningForTest();
194 191
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 #if defined(USE_AURA) 703 #if defined(USE_AURA)
707 std::unique_ptr<MenuKeyEventHandler> key_event_handler_; 704 std::unique_ptr<MenuKeyEventHandler> key_event_handler_;
708 #endif 705 #endif
709 706
710 DISALLOW_COPY_AND_ASSIGN(MenuController); 707 DISALLOW_COPY_AND_ASSIGN(MenuController);
711 }; 708 };
712 709
713 } // namespace views 710 } // namespace views
714 711
715 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 712 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button_unittest.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698