| 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) || defined(USE_AURA) | |
| 242 // Dispatcher method. This returns true if the menu was canceled, or | 241 // Dispatcher method. This returns true if the menu was canceled, or |
| 243 // if the message is such that the menu should be closed. | 242 // if the message is such that the menu should be closed. |
| 244 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 243 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
| 245 #endif | 244 virtual bool ShouldExit() OVERRIDE; |
| 246 | 245 |
| 247 // Key processing. The return value of this is returned from Dispatch. | 246 // Key processing. The return value of this is returned from Dispatch. |
| 248 // In other words, if this returns false (which happens if escape was | 247 // In other words, if this returns false (which happens if escape was |
| 249 // pressed, or a matching mnemonic was found) the message loop returns. | 248 // pressed, or a matching mnemonic was found) the message loop returns. |
| 250 bool OnKeyDown(ui::KeyboardCode key_code); | 249 bool OnKeyDown(ui::KeyboardCode key_code); |
| 251 | 250 |
| 252 // Creates a MenuController. If |blocking| is true a nested message loop is | 251 // Creates a MenuController. If |blocking| is true a nested message loop is |
| 253 // started in |Run|. | 252 // started in |Run|. |
| 254 MenuController(bool blocking, internal::MenuControllerDelegate* delegate); | 253 MenuController(bool blocking, internal::MenuControllerDelegate* delegate); |
| 255 | 254 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 View* active_mouse_view_; | 523 View* active_mouse_view_; |
| 525 | 524 |
| 526 internal::MenuControllerDelegate* delegate_; | 525 internal::MenuControllerDelegate* delegate_; |
| 527 | 526 |
| 528 DISALLOW_COPY_AND_ASSIGN(MenuController); | 527 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 529 }; | 528 }; |
| 530 | 529 |
| 531 } // namespace views | 530 } // namespace views |
| 532 | 531 |
| 533 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 532 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |