| 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); |
| 562 |
| 560 // The active instance. | 563 // The active instance. |
| 561 static MenuController* active_instance_; | 564 static MenuController* active_instance_; |
| 562 | 565 |
| 563 // If true, Run blocks. If false, Run doesn't block and this is used for | 566 // 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 | 567 // 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 | 568 // different: cancel timer is kicked off any time the drag moves outside the |
| 566 // menu, mouse events do nothing... | 569 // menu, mouse events do nothing... |
| 567 bool blocking_run_; | 570 bool blocking_run_; |
| 568 | 571 |
| 569 // If true, we're showing. | 572 // If true, we're showing. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 // underway. | 651 // underway. |
| 649 scoped_ptr<MenuScrollTask> scroll_task_; | 652 scoped_ptr<MenuScrollTask> scroll_task_; |
| 650 | 653 |
| 651 // The lock to keep the menu button pressed while a menu is visible. | 654 // The lock to keep the menu button pressed while a menu is visible. |
| 652 scoped_ptr<MenuButton::PressedLock> pressed_lock_; | 655 scoped_ptr<MenuButton::PressedLock> pressed_lock_; |
| 653 | 656 |
| 654 // ViewStorage id used to store the view mouse drag events are forwarded to. | 657 // ViewStorage id used to store the view mouse drag events are forwarded to. |
| 655 // See UpdateActiveMouseView() for details. | 658 // See UpdateActiveMouseView() for details. |
| 656 const int active_mouse_view_id_; | 659 const int active_mouse_view_id_; |
| 657 | 660 |
| 661 // Current hot tracked child button if any. |
| 662 CustomButton* hot_button_; |
| 663 |
| 658 internal::MenuControllerDelegate* delegate_; | 664 internal::MenuControllerDelegate* delegate_; |
| 659 | 665 |
| 660 // How deep we are in nested message loops. This should be at most 2 (when | 666 // How deep we are in nested message loops. This should be at most 2 (when |
| 661 // showing a context menu from a menu). | 667 // showing a context menu from a menu). |
| 662 int message_loop_depth_; | 668 int message_loop_depth_; |
| 663 | 669 |
| 664 // The timestamp of the event which closed the menu - or 0 otherwise. | 670 // The timestamp of the event which closed the menu - or 0 otherwise. |
| 665 base::TimeDelta closing_event_time_; | 671 base::TimeDelta closing_event_time_; |
| 666 | 672 |
| 667 // Time when the menu is first shown. | 673 // Time when the menu is first shown. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 696 #if defined(USE_AURA) | 702 #if defined(USE_AURA) |
| 697 scoped_ptr<MenuKeyEventHandler> key_event_handler_; | 703 scoped_ptr<MenuKeyEventHandler> key_event_handler_; |
| 698 #endif | 704 #endif |
| 699 | 705 |
| 700 DISALLOW_COPY_AND_ASSIGN(MenuController); | 706 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 701 }; | 707 }; |
| 702 | 708 |
| 703 } // namespace views | 709 } // namespace views |
| 704 | 710 |
| 705 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 711 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |