OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 BASE_MESSAGE_PUMP_WAYLAND_H_ | |
6 #define BASE_MESSAGE_PUMP_WAYLAND_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/message_pump_glib.h" | |
11 #include "base/message_pump_observer.h" | |
12 | |
13 namespace base { | |
14 | |
15 namespace wayland { | |
16 union WaylandEvent; | |
17 } | |
18 | |
19 // The documentation for this class is in message_pump_glib.h | |
20 // | |
21 // The nested loop is exited by either posting a quit, or returning false | |
22 // from Dispatch. | |
23 class MessagePumpDispatcher { | |
24 public: | |
25 enum DispatchStatus { | |
26 EVENT_IGNORED, // The event was not processed. | |
27 EVENT_PROCESSED, // The event has been processed. | |
28 EVENT_QUIT // The event was processed and the message-loop should | |
29 // terminate. | |
30 }; | |
31 | |
32 // Dispatches the event. If true is returned processing continues as | |
33 // normal. If false is returned, the nested loop exits immediately. | |
34 virtual DispatchStatus Dispatch(wayland::WaylandEvent* event) = 0; | |
35 | |
36 protected: | |
37 virtual ~MessagePumpDispatcher() {} | |
38 }; | |
39 | |
40 typedef MessagePumpGlib MessagePumpForUI; | |
41 | |
42 } // namespace base | |
43 | |
44 #endif // BASE_MESSAGE_PUMP_WAYLAND_H_ | |
OLD | NEW |