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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // Internally this updates pending_state_ immediatley. state_ is only updated | 231 // Internally this updates pending_state_ immediatley. state_ is only updated |
232 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If | 232 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If |
233 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked | 233 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked |
234 // to show/hide submenus and update state_. | 234 // to show/hide submenus and update state_. |
235 void SetSelection(MenuItemView* menu_item, int types); | 235 void SetSelection(MenuItemView* menu_item, int types); |
236 | 236 |
237 void SetSelectionOnPointerDown(SubmenuView* source, | 237 void SetSelectionOnPointerDown(SubmenuView* source, |
238 const LocatedEvent& event); | 238 const LocatedEvent& event); |
239 void StartDrag(SubmenuView* source, const gfx::Point& location); | 239 void StartDrag(SubmenuView* source, const gfx::Point& location); |
240 | 240 |
241 #if defined(OS_WIN) | 241 #if defined(OS_WIN) || defined(USE_AURA) |
242 // Dispatcher method. This returns true if the menu was canceled, or | 242 // Dispatcher method. This returns true if the menu was canceled, or |
243 // if the message is such that the menu should be closed. | 243 // if the message is such that the menu should be closed. |
244 virtual bool Dispatch(const MSG& msg) OVERRIDE; | 244 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
245 #elif defined(USE_AURA) | |
246 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | |
247 XEvent* xevent) OVERRIDE; | |
248 #endif | 245 #endif |
249 | 246 |
250 // Key processing. The return value of this is returned from Dispatch. | 247 // Key processing. The return value of this is returned from Dispatch. |
251 // In other words, if this returns false (which happens if escape was | 248 // In other words, if this returns false (which happens if escape was |
252 // pressed, or a matching mnemonic was found) the message loop returns. | 249 // pressed, or a matching mnemonic was found) the message loop returns. |
253 bool OnKeyDown(ui::KeyboardCode key_code); | 250 bool OnKeyDown(ui::KeyboardCode key_code); |
254 | 251 |
255 // Creates a MenuController. If |blocking| is true a nested message loop is | 252 // Creates a MenuController. If |blocking| is true a nested message loop is |
256 // started in |Run|. | 253 // started in |Run|. |
257 MenuController(bool blocking, internal::MenuControllerDelegate* delegate); | 254 MenuController(bool blocking, internal::MenuControllerDelegate* delegate); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 View* active_mouse_view_; | 524 View* active_mouse_view_; |
528 | 525 |
529 internal::MenuControllerDelegate* delegate_; | 526 internal::MenuControllerDelegate* delegate_; |
530 | 527 |
531 DISALLOW_COPY_AND_ASSIGN(MenuController); | 528 DISALLOW_COPY_AND_ASSIGN(MenuController); |
532 }; | 529 }; |
533 | 530 |
534 } // namespace views | 531 } // namespace views |
535 | 532 |
536 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 533 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |