| 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 #include "base/message_loop/message_pump_x11.h" | 5 #include "base/message_loop/message_pump_x11.h" |
| 6 | 6 |
| 7 #include <glib.h> | 7 #include <glib.h> |
| 8 #include <X11/X.h> | 8 #include <X11/X.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return static_cast<MessagePumpX11*>(loop->pump_gpu()); | 53 return static_cast<MessagePumpX11*>(loop->pump_gpu()); |
| 54 } | 54 } |
| 55 #else | 55 #else |
| 56 // static | 56 // static |
| 57 MessagePumpX11* MessagePumpX11::Current() { | 57 MessagePumpX11* MessagePumpX11::Current() { |
| 58 MessageLoopForUI* loop = MessageLoopForUI::current(); | 58 MessageLoopForUI* loop = MessageLoopForUI::current(); |
| 59 return static_cast<MessagePumpX11*>(loop->pump_ui()); | 59 return static_cast<MessagePumpX11*>(loop->pump_ui()); |
| 60 } | 60 } |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 void MessagePumpX11::AddObserver(MessagePumpObserver* observer) { | |
| 64 observers_.AddObserver(observer); | |
| 65 } | |
| 66 | |
| 67 void MessagePumpX11::RemoveObserver(MessagePumpObserver* observer) { | |
| 68 observers_.RemoveObserver(observer); | |
| 69 } | |
| 70 | |
| 71 void MessagePumpX11::WillProcessXEvent(XEvent* xevent) { | |
| 72 FOR_EACH_OBSERVER(MessagePumpObserver, observers_, WillProcessEvent(xevent)); | |
| 73 } | |
| 74 | |
| 75 void MessagePumpX11::DidProcessXEvent(XEvent* xevent) { | |
| 76 FOR_EACH_OBSERVER(MessagePumpObserver, observers_, DidProcessEvent(xevent)); | |
| 77 } | |
| 78 | |
| 79 } // namespace base | 63 } // namespace base |
| OLD | NEW |