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 <list> | 10 #include <list> |
(...skipping 19 matching lines...) Expand all Loading... |
30 namespace ui { | 30 namespace ui { |
31 class NativeTheme; | 31 class NativeTheme; |
32 class OSExchangeData; | 32 class OSExchangeData; |
33 class ScopedEventDispatcher; | 33 class ScopedEventDispatcher; |
34 } | 34 } |
35 namespace views { | 35 namespace views { |
36 | 36 |
37 class MenuButton; | 37 class MenuButton; |
38 class MenuHostRootView; | 38 class MenuHostRootView; |
39 class MenuItemView; | 39 class MenuItemView; |
| 40 class MenuMessageLoop; |
40 class MouseEvent; | 41 class MouseEvent; |
41 class SubmenuView; | 42 class SubmenuView; |
42 class View; | 43 class View; |
43 | 44 |
44 namespace internal { | 45 namespace internal { |
45 class MenuControllerDelegate; | 46 class MenuControllerDelegate; |
46 class MenuEventDispatcher; | 47 class MenuEventDispatcher; |
47 class MenuMessagePumpDispatcher; | 48 class MenuMessagePumpDispatcher; |
48 class MenuRunnerImpl; | 49 class MenuRunnerImpl; |
49 } | 50 } |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 scoped_ptr<MenuScrollTask> scroll_task_; | 569 scoped_ptr<MenuScrollTask> scroll_task_; |
569 | 570 |
570 MenuButton* menu_button_; | 571 MenuButton* menu_button_; |
571 | 572 |
572 // ViewStorage id used to store the view mouse drag events are forwarded to. | 573 // ViewStorage id used to store the view mouse drag events are forwarded to. |
573 // See UpdateActiveMouseView() for details. | 574 // See UpdateActiveMouseView() for details. |
574 const int active_mouse_view_id_; | 575 const int active_mouse_view_id_; |
575 | 576 |
576 internal::MenuControllerDelegate* delegate_; | 577 internal::MenuControllerDelegate* delegate_; |
577 | 578 |
578 // How deep we are in nested message loops. This should be at most 2 (when | |
579 // showing a context menu from a menu). | |
580 int message_loop_depth_; | |
581 | |
582 views::MenuConfig menu_config_; | 579 views::MenuConfig menu_config_; |
583 | 580 |
584 // The timestamp of the event which closed the menu - or 0 otherwise. | 581 // The timestamp of the event which closed the menu - or 0 otherwise. |
585 base::TimeDelta closing_event_time_; | 582 base::TimeDelta closing_event_time_; |
586 | 583 |
587 // Time when the menu is first shown. | 584 // Time when the menu is first shown. |
588 base::TimeTicks menu_start_time_; | 585 base::TimeTicks menu_start_time_; |
589 | 586 |
590 // If a mouse press triggered this menu, this will have its location (in | 587 // If a mouse press triggered this menu, this will have its location (in |
591 // screen coordinates). Otherwise this will be (0, 0). | 588 // screen coordinates). Otherwise this will be (0, 0). |
592 gfx::Point menu_start_mouse_press_loc_; | 589 gfx::Point menu_start_mouse_press_loc_; |
593 | 590 |
594 // Controls behavior differences between a combobox and other types of menu | 591 // Controls behavior differences between a combobox and other types of menu |
595 // (like a context menu). | 592 // (like a context menu). |
596 bool is_combobox_; | 593 bool is_combobox_; |
597 | 594 |
598 // Set to true if the menu item was selected by touch. | 595 // Set to true if the menu item was selected by touch. |
599 bool item_selected_by_touch_; | 596 bool item_selected_by_touch_; |
600 | 597 |
601 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; | 598 scoped_ptr<MenuMessageLoop> message_loop_; |
602 | 599 |
603 DISALLOW_COPY_AND_ASSIGN(MenuController); | 600 DISALLOW_COPY_AND_ASSIGN(MenuController); |
604 }; | 601 }; |
605 | 602 |
606 } // namespace views | 603 } // namespace views |
607 | 604 |
608 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 605 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |