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

Side by Side 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 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 "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <list> 10 #include <list>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 // Called by the Widget when a drag is about to start on a child view. This 154 // Called by the Widget when a drag is about to start on a child view. This
155 // could be initiated by one of our MenuItemViews, or could be through another 155 // could be initiated by one of our MenuItemViews, or could be through another
156 // child View. 156 // child View.
157 void OnDragWillStart(); 157 void OnDragWillStart();
158 158
159 // Called by the Widget when the drag has completed. |should_close| 159 // Called by the Widget when the drag has completed. |should_close|
160 // corresponds to whether or not the menu should close. 160 // corresponds to whether or not the menu should close.
161 void OnDragComplete(bool should_close); 161 void OnDragComplete(bool should_close);
162 162
163 // Called while dispatching messages to intercept key events.
164 // If |character| is other than 0, it is handled as a mnemonic.
165 // Otherwise, |key_code| is handled as a menu navigation command.
166 // Returns ui::POST_DISPATCH_NONE if the event was swallowed by the menu.
167 ui::PostDispatchAction OnWillDispatchKeyEvent(base::char16 character,
168 ui::KeyboardCode key_code);
169
163 // Update the submenu's selection based on the current mouse location 170 // Update the submenu's selection based on the current mouse location
164 void UpdateSubmenuSelection(SubmenuView* source); 171 void UpdateSubmenuSelection(SubmenuView* source);
165 172
166 // WidgetObserver overrides: 173 // WidgetObserver overrides:
167 void OnWidgetDestroying(Widget* widget) override; 174 void OnWidgetDestroying(Widget* widget) override;
168 175
169 // Only used for testing. 176 // Only used for testing.
170 bool IsCancelAllTimerRunningForTest(); 177 bool IsCancelAllTimerRunningForTest();
171 178
172 // Only used for testing. 179 // Only used for testing.
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 bool item_selected_by_touch_; 636 bool item_selected_by_touch_;
630 637
631 scoped_ptr<MenuMessageLoop> message_loop_; 638 scoped_ptr<MenuMessageLoop> message_loop_;
632 639
633 DISALLOW_COPY_AND_ASSIGN(MenuController); 640 DISALLOW_COPY_AND_ASSIGN(MenuController);
634 }; 641 };
635 642
636 } // namespace views 643 } // namespace views
637 644
638 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 645 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698