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 BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H |
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H | 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Returns the UI or GPU message pump. | 42 // Returns the UI or GPU message pump. |
43 static MessagePumpX11* Current(); | 43 static MessagePumpX11* Current(); |
44 | 44 |
45 // Adds an Observer, which will start receiving notifications immediately. | 45 // Adds an Observer, which will start receiving notifications immediately. |
46 void AddObserver(MessagePumpObserver* observer); | 46 void AddObserver(MessagePumpObserver* observer); |
47 | 47 |
48 // Removes an Observer. It is safe to call this method while an Observer is | 48 // Removes an Observer. It is safe to call this method while an Observer is |
49 // receiving a notification callback. | 49 // receiving a notification callback. |
50 void RemoveObserver(MessagePumpObserver* observer); | 50 void RemoveObserver(MessagePumpObserver* observer); |
51 | 51 |
52 // Sends the event to the observers. If an observer returns true, then it does | 52 // Sends the event to the observers. |
53 // not send the event to any other observers and returns true. Returns false | 53 void WillProcessXEvent(XEvent* xevent); |
54 // if no observer returns true. | |
55 bool WillProcessXEvent(XEvent* xevent); | |
56 void DidProcessXEvent(XEvent* xevent); | 54 void DidProcessXEvent(XEvent* xevent); |
57 | 55 |
58 private: | 56 private: |
59 // List of observers. | 57 // List of observers. |
60 ObserverList<MessagePumpObserver> observers_; | 58 ObserverList<MessagePumpObserver> observers_; |
61 | 59 |
62 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11); | 60 DISALLOW_COPY_AND_ASSIGN(MessagePumpX11); |
63 }; | 61 }; |
64 | 62 |
65 #if !defined(TOOLKIT_GTK) | 63 #if !defined(TOOLKIT_GTK) |
66 typedef MessagePumpX11 MessagePumpForUI; | 64 typedef MessagePumpX11 MessagePumpForUI; |
67 #endif | 65 #endif |
68 | 66 |
69 } // namespace base | 67 } // namespace base |
70 | 68 |
71 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H | 69 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_X11_H |
OLD | NEW |