OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 BASE_MESSAGE_PUMP_OBSERVER_H | 5 #ifndef BASE_MESSAGE_PUMP_OBSERVER_H |
6 #define BASE_MESSAGE_PUMP_OBSERVER_H | 6 #define BASE_MESSAGE_PUMP_OBSERVER_H |
| 7 #pragma once |
7 | 8 |
8 #if defined(USE_X11) | 9 #include "base/event_types.h" |
9 typedef union _XEvent XEvent; | |
10 #endif | |
11 | 10 |
12 namespace base { | 11 namespace base { |
13 | 12 |
14 #if defined(OS_WIN) | |
15 typedef MSG NativeEvent; | |
16 #elif defined(USE_X11) | |
17 typedef XEvent* NativeEvent; | |
18 #endif | |
19 | |
20 enum EventStatus { | 13 enum EventStatus { |
21 EVENT_CONTINUE, // The event should be dispatched as normal. | 14 EVENT_CONTINUE, // The event should be dispatched as normal. |
22 #if defined(USE_X11) | 15 #if defined(USE_X11) |
23 EVENT_HANDLED // The event should not be processed any farther. | 16 EVENT_HANDLED // The event should not be processed any farther. |
24 #endif | 17 #endif |
25 }; | 18 }; |
26 | 19 |
27 // A MessagePumpObserver is an object that receives global | 20 // A MessagePumpObserver is an object that receives global |
28 // notifications from the UI MessageLoop with MessagePumpWin or | 21 // notifications from the UI MessageLoop with MessagePumpWin or |
29 // MessagePumpX. | 22 // MessagePumpX. |
(...skipping 15 matching lines...) Expand all Loading... |
45 // will not be called if WillProcessEvent returns EVENT_HANDLED. | 38 // will not be called if WillProcessEvent returns EVENT_HANDLED. |
46 virtual void DidProcessEvent(const NativeEvent& event) = 0; | 39 virtual void DidProcessEvent(const NativeEvent& event) = 0; |
47 | 40 |
48 protected: | 41 protected: |
49 virtual ~MessagePumpObserver() {} | 42 virtual ~MessagePumpObserver() {} |
50 }; | 43 }; |
51 | 44 |
52 } // namespace base | 45 } // namespace base |
53 | 46 |
54 #endif // BASE_MESSAGE_PUMP_OBSERVER_VIEWS_H | 47 #endif // BASE_MESSAGE_PUMP_OBSERVER_VIEWS_H |
OLD | NEW |