OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MESSAGE_LOOP_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
11 class Point; | 11 class Point; |
12 } | 12 } |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class LocatedEvent; | 15 class LocatedEvent; |
16 } | 16 } |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 | 19 |
20 class MenuController; | 20 class MenuController; |
21 class Widget; | |
22 | 21 |
23 // Interface used by MenuController to run a nested message loop while | 22 // Interface used by MenuController to run a nested message loop while |
24 // showing a menu, allowing for platform specific implementations. | 23 // showing a menu, allowing for platform specific implementations. |
25 class MenuMessageLoop { | 24 class MenuMessageLoop { |
26 public: | 25 public: |
27 virtual ~MenuMessageLoop() {} | 26 virtual ~MenuMessageLoop() {} |
28 | 27 |
29 // Create a platform specific instance. | 28 // Create a platform specific instance. |
30 static MenuMessageLoop* Create(); | 29 static MenuMessageLoop* Create(); |
31 | 30 |
32 // Repost |event| to |window|. | 31 // Repost |event| to |window|. |
33 // |screen_loc| is the event's location in screen coordinates. | 32 // |screen_loc| is the event's location in screen coordinates. |
34 static void RepostEventToWindow(const ui::LocatedEvent* event, | 33 static void RepostEventToWindow(const ui::LocatedEvent* event, |
35 gfx::NativeWindow window, | 34 gfx::NativeWindow window, |
36 const gfx::Point& screen_loc); | 35 const gfx::Point& screen_loc); |
37 | 36 |
38 // Runs the platform specific bits of the message loop. | 37 // Runs the platform specific bits of the message loop. |
39 virtual void Run() = 0; | 38 virtual void Run() = 0; |
40 | 39 |
41 // Quit an earlier call to Run(). | 40 // Quit an earlier call to Run(). |
42 virtual void QuitNow() = 0; | 41 virtual void QuitNow() = 0; |
43 }; | 42 }; |
44 | 43 |
45 } // namespace views | 44 } // namespace views |
46 | 45 |
47 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_ | 46 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_ |
OLD | NEW |