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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 void ExitAsyncRun(); | 558 void ExitAsyncRun(); |
559 | 559 |
560 // Performs the teardown of the menu launched by Run(). The selected item is | 560 // Performs the teardown of the menu launched by Run(). The selected item is |
561 // returned. | 561 // returned. |
562 MenuItemView* ExitMenuRun(); | 562 MenuItemView* ExitMenuRun(); |
563 | 563 |
564 // Handles the mouse location event on the submenu |source|. | 564 // Handles the mouse location event on the submenu |source|. |
565 void HandleMouseLocation(SubmenuView* source, | 565 void HandleMouseLocation(SubmenuView* source, |
566 const gfx::Point& mouse_location); | 566 const gfx::Point& mouse_location); |
567 | 567 |
| 568 // Updates the current |hot_button_| and its hot tracked state. |
| 569 void SetHotTrackedButton(CustomButton* hot_button, bool is_hot_tracked); |
| 570 |
| 571 // Sets hot-tracked state to the first focusable descendant view of |item|. |
| 572 void SetInitialHotTrackedView(MenuItemView* item, |
| 573 SelectionIncrementDirectionType direction); |
| 574 |
568 // The active instance. | 575 // The active instance. |
569 static MenuController* active_instance_; | 576 static MenuController* active_instance_; |
570 | 577 |
571 // If true, Run blocks. If false, Run doesn't block and this is used for | 578 // If true, Run blocks. If false, Run doesn't block and this is used for |
572 // drag and drop. Note that the semantics for drag and drop are slightly | 579 // drag and drop. Note that the semantics for drag and drop are slightly |
573 // different: cancel timer is kicked off any time the drag moves outside the | 580 // different: cancel timer is kicked off any time the drag moves outside the |
574 // menu, mouse events do nothing... | 581 // menu, mouse events do nothing... |
575 bool blocking_run_; | 582 bool blocking_run_; |
576 | 583 |
577 // If true, we're showing. | 584 // If true, we're showing. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 // underway. | 663 // underway. |
657 scoped_ptr<MenuScrollTask> scroll_task_; | 664 scoped_ptr<MenuScrollTask> scroll_task_; |
658 | 665 |
659 // The lock to keep the menu button pressed while a menu is visible. | 666 // The lock to keep the menu button pressed while a menu is visible. |
660 scoped_ptr<MenuButton::PressedLock> pressed_lock_; | 667 scoped_ptr<MenuButton::PressedLock> pressed_lock_; |
661 | 668 |
662 // ViewStorage id used to store the view mouse drag events are forwarded to. | 669 // ViewStorage id used to store the view mouse drag events are forwarded to. |
663 // See UpdateActiveMouseView() for details. | 670 // See UpdateActiveMouseView() for details. |
664 const int active_mouse_view_id_; | 671 const int active_mouse_view_id_; |
665 | 672 |
| 673 // Current hot tracked view if any. |
| 674 CustomButton* hot_button_; |
| 675 |
666 internal::MenuControllerDelegate* delegate_; | 676 internal::MenuControllerDelegate* delegate_; |
667 | 677 |
668 // How deep we are in nested message loops. This should be at most 2 (when | 678 // How deep we are in nested message loops. This should be at most 2 (when |
669 // showing a context menu from a menu). | 679 // showing a context menu from a menu). |
670 int message_loop_depth_; | 680 int message_loop_depth_; |
671 | 681 |
672 // The timestamp of the event which closed the menu - or 0 otherwise. | 682 // The timestamp of the event which closed the menu - or 0 otherwise. |
673 base::TimeDelta closing_event_time_; | 683 base::TimeDelta closing_event_time_; |
674 | 684 |
675 // Time when the menu is first shown. | 685 // Time when the menu is first shown. |
(...skipping 28 matching lines...) Expand all Loading... |
704 #if defined(USE_AURA) | 714 #if defined(USE_AURA) |
705 scoped_ptr<MenuKeyEventHandler> key_event_handler_; | 715 scoped_ptr<MenuKeyEventHandler> key_event_handler_; |
706 #endif | 716 #endif |
707 | 717 |
708 DISALLOW_COPY_AND_ASSIGN(MenuController); | 718 DISALLOW_COPY_AND_ASSIGN(MenuController); |
709 }; | 719 }; |
710 | 720 |
711 } // namespace views | 721 } // namespace views |
712 | 722 |
713 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 723 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |