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_RUNNER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/views/controls/menu/menu_item_view.h" | 11 #include "ui/base/ui_base_types.h" |
| 12 #include "ui/views/controls/menu/menu_types.h" |
| 13 #include "ui/views/views_export.h" |
| 14 |
| 15 namespace base { |
| 16 class TimeDelta; |
| 17 } |
| 18 |
| 19 namespace gfx { |
| 20 class Rect; |
| 21 } |
12 | 22 |
13 namespace ui { | 23 namespace ui { |
14 class MenuModel; | 24 class MenuModel; |
15 } | 25 } |
16 | 26 |
17 namespace views { | 27 namespace views { |
18 | 28 |
19 class MenuButton; | 29 class MenuButton; |
| 30 class MenuItemView; |
20 class MenuModelAdapter; | 31 class MenuModelAdapter; |
21 class MenuRunnerHandler; | 32 class MenuRunnerHandler; |
22 class Widget; | 33 class Widget; |
23 | 34 |
24 namespace internal { | 35 namespace internal { |
25 class DisplayChangeListener; | 36 class DisplayChangeListener; |
26 class MenuRunnerImpl; | 37 class MenuRunnerImpl; |
27 } | 38 } |
28 | 39 |
29 namespace test { | 40 namespace test { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 107 |
97 // Runs the menu. |types| is a bitmask of RunTypes. If this returns | 108 // Runs the menu. |types| is a bitmask of RunTypes. If this returns |
98 // MENU_DELETED the method is returning because the MenuRunner was deleted. | 109 // MENU_DELETED the method is returning because the MenuRunner was deleted. |
99 // Typically callers should NOT do any processing if this returns | 110 // Typically callers should NOT do any processing if this returns |
100 // MENU_DELETED. | 111 // MENU_DELETED. |
101 // If |anchor| uses a |BUBBLE_..| type, the bounds will get determined by | 112 // If |anchor| uses a |BUBBLE_..| type, the bounds will get determined by |
102 // using |bounds| as the thing to point at in screen coordinates. | 113 // using |bounds| as the thing to point at in screen coordinates. |
103 RunResult RunMenuAt(Widget* parent, | 114 RunResult RunMenuAt(Widget* parent, |
104 MenuButton* button, | 115 MenuButton* button, |
105 const gfx::Rect& bounds, | 116 const gfx::Rect& bounds, |
106 MenuItemView::AnchorPosition anchor, | 117 MenuAnchorPosition anchor, |
107 ui::MenuSourceType source_type, | 118 ui::MenuSourceType source_type, |
108 int32 types) WARN_UNUSED_RESULT; | 119 int32 types) WARN_UNUSED_RESULT; |
109 | 120 |
110 // Returns true if we're in a nested message loop running the menu. | 121 // Returns true if we're in a nested message loop running the menu. |
111 bool IsRunning() const; | 122 bool IsRunning() const; |
112 | 123 |
113 // Hides and cancels the menu. This does nothing if the menu is not open. | 124 // Hides and cancels the menu. This does nothing if the menu is not open. |
114 void Cancel(); | 125 void Cancel(); |
115 | 126 |
116 // Returns the time from the event which closed the menu - or 0. | 127 // Returns the time from the event which closed the menu - or 0. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 162 |
152 protected: | 163 protected: |
153 DisplayChangeListener() {} | 164 DisplayChangeListener() {} |
154 }; | 165 }; |
155 | 166 |
156 } | 167 } |
157 | 168 |
158 } // namespace views | 169 } // namespace views |
159 | 170 |
160 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 171 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
OLD | NEW |