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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void ExitAsyncRun(); | 550 void ExitAsyncRun(); |
551 | 551 |
552 // Performs the teardown of the menu launched by Run(). The selected item is | 552 // Performs the teardown of the menu launched by Run(). The selected item is |
553 // returned. | 553 // returned. |
554 MenuItemView* ExitMenuRun(); | 554 MenuItemView* ExitMenuRun(); |
555 | 555 |
556 // Handles the mouse location event on the submenu |source|. | 556 // Handles the mouse location event on the submenu |source|. |
557 void HandleMouseLocation(SubmenuView* source, | 557 void HandleMouseLocation(SubmenuView* source, |
558 const gfx::Point& mouse_location); | 558 const gfx::Point& mouse_location); |
559 | 559 |
| 560 // Updates the current |hot_button_| and its hot tracked state. |
| 561 void SetHotTrackedButton(CustomButton* hot_button, bool is_hot_tracked); |
| 562 |
| 563 // Sets hot-tracked state to the first focusable descendant view of |item|. |
| 564 void SetInitialHotTrackedView(MenuItemView* item, |
| 565 SelectionIncrementDirectionType direction); |
| 566 |
560 // The active instance. | 567 // The active instance. |
561 static MenuController* active_instance_; | 568 static MenuController* active_instance_; |
562 | 569 |
563 // If true, Run blocks. If false, Run doesn't block and this is used for | 570 // If true, Run blocks. If false, Run doesn't block and this is used for |
564 // drag and drop. Note that the semantics for drag and drop are slightly | 571 // drag and drop. Note that the semantics for drag and drop are slightly |
565 // different: cancel timer is kicked off any time the drag moves outside the | 572 // different: cancel timer is kicked off any time the drag moves outside the |
566 // menu, mouse events do nothing... | 573 // menu, mouse events do nothing... |
567 bool blocking_run_; | 574 bool blocking_run_; |
568 | 575 |
569 // If true, we're showing. | 576 // If true, we're showing. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 // underway. | 655 // underway. |
649 scoped_ptr<MenuScrollTask> scroll_task_; | 656 scoped_ptr<MenuScrollTask> scroll_task_; |
650 | 657 |
651 // 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. |
652 scoped_ptr<MenuButton::PressedLock> pressed_lock_; | 659 scoped_ptr<MenuButton::PressedLock> pressed_lock_; |
653 | 660 |
654 // 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. |
655 // See UpdateActiveMouseView() for details. | 662 // See UpdateActiveMouseView() for details. |
656 const int active_mouse_view_id_; | 663 const int active_mouse_view_id_; |
657 | 664 |
| 665 // Current hot tracked view if any. |
| 666 CustomButton* hot_button_; |
| 667 |
658 internal::MenuControllerDelegate* delegate_; | 668 internal::MenuControllerDelegate* delegate_; |
659 | 669 |
660 // How deep we are in nested message loops. This should be at most 2 (when | 670 // How deep we are in nested message loops. This should be at most 2 (when |
661 // showing a context menu from a menu). | 671 // showing a context menu from a menu). |
662 int message_loop_depth_; | 672 int message_loop_depth_; |
663 | 673 |
664 // The timestamp of the event which closed the menu - or 0 otherwise. | 674 // The timestamp of the event which closed the menu - or 0 otherwise. |
665 base::TimeDelta closing_event_time_; | 675 base::TimeDelta closing_event_time_; |
666 | 676 |
667 // Time when the menu is first shown. | 677 // Time when the menu is first shown. |
(...skipping 28 matching lines...) Expand all Loading... |
696 #if defined(USE_AURA) | 706 #if defined(USE_AURA) |
697 scoped_ptr<MenuKeyEventHandler> key_event_handler_; | 707 scoped_ptr<MenuKeyEventHandler> key_event_handler_; |
698 #endif | 708 #endif |
699 | 709 |
700 DISALLOW_COPY_AND_ASSIGN(MenuController); | 710 DISALLOW_COPY_AND_ASSIGN(MenuController); |
701 }; | 711 }; |
702 | 712 |
703 } // namespace views | 713 } // namespace views |
704 | 714 |
705 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 715 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |