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