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> |
11 #include <set> | 11 #include <set> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_pump_dispatcher.h" |
17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
18 #include "ui/events/event_constants.h" | 18 #include "ui/events/event_constants.h" |
19 #include "ui/views/controls/menu/menu_delegate.h" | 19 #include "ui/views/controls/menu/menu_delegate.h" |
20 #include "ui/views/controls/menu/menu_item_view.h" | 20 #include "ui/views/controls/menu/menu_item_view.h" |
21 #include "ui/views/widget/widget_observer.h" | 21 #include "ui/views/widget/widget_observer.h" |
22 | 22 |
23 namespace ui { | 23 namespace ui { |
24 class NativeTheme; | 24 class NativeTheme; |
25 class OSExchangeData; | 25 class OSExchangeData; |
26 } | 26 } |
(...skipping 11 matching lines...) Expand all Loading... |
38 namespace internal { | 38 namespace internal { |
39 class MenuControllerDelegate; | 39 class MenuControllerDelegate; |
40 class MenuRunnerImpl; | 40 class MenuRunnerImpl; |
41 } | 41 } |
42 | 42 |
43 // MenuController ------------------------------------------------------------- | 43 // MenuController ------------------------------------------------------------- |
44 | 44 |
45 // MenuController is used internally by the various menu classes to manage | 45 // MenuController is used internally by the various menu classes to manage |
46 // showing, selecting and drag/drop for menus. All relevant events are | 46 // showing, selecting and drag/drop for menus. All relevant events are |
47 // forwarded to the MenuController from SubmenuView and MenuHost. | 47 // forwarded to the MenuController from SubmenuView and MenuHost. |
48 class VIEWS_EXPORT MenuController : public base::MessageLoop::Dispatcher, | 48 class VIEWS_EXPORT MenuController : public base::MessagePumpDispatcher, |
49 public WidgetObserver { | 49 public WidgetObserver { |
50 public: | 50 public: |
51 // Enumeration of how the menu should exit. | 51 // Enumeration of how the menu should exit. |
52 enum ExitType { | 52 enum ExitType { |
53 // Don't exit. | 53 // Don't exit. |
54 EXIT_NONE, | 54 EXIT_NONE, |
55 | 55 |
56 // All menus, including nested, should be exited. | 56 // All menus, including nested, should be exited. |
57 EXIT_ALL, | 57 EXIT_ALL, |
58 | 58 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 589 |
590 // Set to true if the menu item was selected by touch. | 590 // Set to true if the menu item was selected by touch. |
591 bool item_selected_by_touch_; | 591 bool item_selected_by_touch_; |
592 | 592 |
593 DISALLOW_COPY_AND_ASSIGN(MenuController); | 593 DISALLOW_COPY_AND_ASSIGN(MenuController); |
594 }; | 594 }; |
595 | 595 |
596 } // namespace views | 596 } // namespace views |
597 | 597 |
598 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 598 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |