Chromium Code Reviews| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 | 236 |
| 237 // Tracks selection information. | 237 // Tracks selection information. |
| 238 struct State { | 238 struct State { |
| 239 State(); | 239 State(); |
| 240 State(const State& other); | 240 State(const State& other); |
| 241 ~State(); | 241 ~State(); |
| 242 | 242 |
| 243 // The selected menu item. | 243 // The selected menu item. |
| 244 MenuItemView* item; | 244 MenuItemView* item; |
| 245 | 245 |
| 246 // Current hot tracked child button if any. | |
| 247 CustomButton* hot_button; | |
| 248 | |
| 246 // If item has a submenu this indicates if the submenu is showing. | 249 // If item has a submenu this indicates if the submenu is showing. |
| 247 bool submenu_open; | 250 bool submenu_open; |
| 248 | 251 |
| 249 // Bounds passed to the run menu. Used for positioning the first menu. | 252 // Bounds passed to the run menu. Used for positioning the first menu. |
| 250 gfx::Rect initial_bounds; | 253 gfx::Rect initial_bounds; |
| 251 | 254 |
| 252 // Position of the initial menu. | 255 // Position of the initial menu. |
| 253 MenuAnchorPosition anchor; | 256 MenuAnchorPosition anchor; |
| 254 | 257 |
| 255 // The direction child menus have opened in. | 258 // The direction child menus have opened in. |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 652 // underway. | 655 // underway. |
| 653 scoped_ptr<MenuScrollTask> scroll_task_; | 656 scoped_ptr<MenuScrollTask> scroll_task_; |
| 654 | 657 |
| 655 // The lock to keep the menu button pressed while a menu is visible. | 658 // The lock to keep the menu button pressed while a menu is visible. |
| 656 scoped_ptr<MenuButton::PressedLock> pressed_lock_; | 659 scoped_ptr<MenuButton::PressedLock> pressed_lock_; |
| 657 | 660 |
| 658 // ViewStorage id used to store the view mouse drag events are forwarded to. | 661 // ViewStorage id used to store the view mouse drag events are forwarded to. |
| 659 // See UpdateActiveMouseView() for details. | 662 // See UpdateActiveMouseView() for details. |
| 660 const int active_mouse_view_id_; | 663 const int active_mouse_view_id_; |
| 661 | 664 |
| 662 // Current hot tracked child button if any. | |
| 663 CustomButton* hot_button_; | |
|
sky
2016/03/23 21:42:40
I recommend keeping the member around and only add
varkha
2016/03/24 18:36:18
Done.
| |
| 664 | |
| 665 internal::MenuControllerDelegate* delegate_; | 665 internal::MenuControllerDelegate* delegate_; |
| 666 | 666 |
| 667 // How deep we are in nested message loops. This should be at most 2 (when | 667 // How deep we are in nested message loops. This should be at most 2 (when |
| 668 // showing a context menu from a menu). | 668 // showing a context menu from a menu). |
| 669 int message_loop_depth_; | 669 int message_loop_depth_; |
| 670 | 670 |
| 671 // The timestamp of the event which closed the menu - or 0 otherwise. | 671 // The timestamp of the event which closed the menu - or 0 otherwise. |
| 672 base::TimeDelta closing_event_time_; | 672 base::TimeDelta closing_event_time_; |
| 673 | 673 |
| 674 // Time when the menu is first shown. | 674 // Time when the menu is first shown. |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 703 #if defined(USE_AURA) | 703 #if defined(USE_AURA) |
| 704 scoped_ptr<MenuKeyEventHandler> key_event_handler_; | 704 scoped_ptr<MenuKeyEventHandler> key_event_handler_; |
| 705 #endif | 705 #endif |
| 706 | 706 |
| 707 DISALLOW_COPY_AND_ASSIGN(MenuController); | 707 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 708 }; | 708 }; |
| 709 | 709 |
| 710 } // namespace views | 710 } // namespace views |
| 711 | 711 |
| 712 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 712 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |