| OLD | NEW |
| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Called by the Widget when a drag is about to start on a child view. This | 169 // Called by the Widget when a drag is about to start on a child view. This |
| 170 // could be initiated by one of our MenuItemViews, or could be through another | 170 // could be initiated by one of our MenuItemViews, or could be through another |
| 171 // child View. | 171 // child View. |
| 172 void OnDragWillStart(); | 172 void OnDragWillStart(); |
| 173 | 173 |
| 174 // Called by the Widget when the drag has completed. |should_close| | 174 // Called by the Widget when the drag has completed. |should_close| |
| 175 // corresponds to whether or not the menu should close. | 175 // corresponds to whether or not the menu should close. |
| 176 void OnDragComplete(bool should_close); | 176 void OnDragComplete(bool should_close); |
| 177 | 177 |
| 178 // Called while dispatching messages to intercept key events. | 178 // Called while dispatching messages to intercept key events. |
| 179 // If |character| is other than 0, it is handled as a mnemonic. | |
| 180 // Otherwise, |key_code| is handled as a menu navigation command. | |
| 181 // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu. | 179 // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu. |
| 182 ui::PostDispatchAction OnWillDispatchKeyEvent(base::char16 character, | 180 ui::PostDispatchAction OnWillDispatchKeyEvent(ui::KeyEvent* event); |
| 183 ui::KeyboardCode key_code); | |
| 184 | 181 |
| 185 // Update the submenu's selection based on the current mouse location | 182 // Update the submenu's selection based on the current mouse location |
| 186 void UpdateSubmenuSelection(SubmenuView* source); | 183 void UpdateSubmenuSelection(SubmenuView* source); |
| 187 | 184 |
| 188 // WidgetObserver overrides: | 185 // WidgetObserver overrides: |
| 189 void OnWidgetDestroying(Widget* widget) override; | 186 void OnWidgetDestroying(Widget* widget) override; |
| 190 | 187 |
| 191 // Only used for testing. | 188 // Only used for testing. |
| 192 bool IsCancelAllTimerRunningForTest(); | 189 bool IsCancelAllTimerRunningForTest(); |
| 193 | 190 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 #if defined(USE_AURA) | 702 #if defined(USE_AURA) |
| 706 std::unique_ptr<MenuKeyEventHandler> key_event_handler_; | 703 std::unique_ptr<MenuKeyEventHandler> key_event_handler_; |
| 707 #endif | 704 #endif |
| 708 | 705 |
| 709 DISALLOW_COPY_AND_ASSIGN(MenuController); | 706 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 710 }; | 707 }; |
| 711 | 708 |
| 712 } // namespace views | 709 } // namespace views |
| 713 | 710 |
| 714 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 711 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |