OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ui/events/platform/x11/x11_event_source_libevent.h" | 5 #include "ui/events/platform/x11/x11_event_source_libevent.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 case GenericEvent: | 127 case GenericEvent: |
128 return TranslateXI2EventToEvent(xev); | 128 return TranslateXI2EventToEvent(xev); |
129 } | 129 } |
130 return nullptr; | 130 return nullptr; |
131 } | 131 } |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 X11EventSourceLibevent::X11EventSourceLibevent(XDisplay* display) | 135 X11EventSourceLibevent::X11EventSourceLibevent(XDisplay* display) |
136 : event_source_(this, display) { | 136 : event_source_(this, display), watcher_controller_(FROM_HERE) { |
137 AddEventWatcher(); | 137 AddEventWatcher(); |
138 } | 138 } |
139 | 139 |
140 X11EventSourceLibevent::~X11EventSourceLibevent() {} | 140 X11EventSourceLibevent::~X11EventSourceLibevent() {} |
141 | 141 |
142 // static | 142 // static |
143 X11EventSourceLibevent* X11EventSourceLibevent::GetInstance() { | 143 X11EventSourceLibevent* X11EventSourceLibevent::GetInstance() { |
144 return static_cast<X11EventSourceLibevent*>( | 144 return static_cast<X11EventSourceLibevent*>( |
145 PlatformEventSource::GetInstance()); | 145 PlatformEventSource::GetInstance()); |
146 } | 146 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) { | 197 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) { |
198 event_source_.DispatchXEvents(); | 198 event_source_.DispatchXEvents(); |
199 } | 199 } |
200 | 200 |
201 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { | 201 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { |
202 NOTREACHED(); | 202 NOTREACHED(); |
203 } | 203 } |
204 | 204 |
205 } // namespace ui | 205 } // namespace ui |
OLD | NEW |