Index: ui/events/platform/x11/x11_event_source_libevent.h |
diff --git a/ui/events/platform/x11/x11_event_source_libevent.h b/ui/events/platform/x11/x11_event_source_libevent.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..15a9984fa15f36e8c6f4948cbc5498a93a7e522f |
--- /dev/null |
+++ b/ui/events/platform/x11/x11_event_source_libevent.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
+#define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |
+ |
+#include "base/macros.h" |
+#include "base/message_loop/message_loop.h" |
+#include "base/message_loop/message_pump_libevent.h" |
+#include "ui/events/events_export.h" |
+#include "ui/events/platform/x11/x11_event_source.h" |
+ |
+namespace ui { |
+ |
+class EVENTS_EXPORT X11EventSourceLibevent |
+ : public X11EventSource, |
+ public base::MessagePumpLibevent::Watcher { |
+ public: |
+ explicit X11EventSourceLibevent(XDisplay* display); |
+ |
+ ~X11EventSourceLibevent() override; |
+ |
+ private: |
+ void AddEventWatcher(); |
+ |
+ // PlatformEventSource: |
+ void OnDispatcherListChanged() override; |
+ |
+ // base::MessagePumpLibevent::Watcher: |
+ void OnFileCanReadWithoutBlocking(int fd) override; |
+ void OnFileCanWriteWithoutBlocking(int fd) override; |
+ |
+ base::MessagePumpLibevent::FileDescriptorWatcher watcher_controller_; |
+ bool initialized_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(X11EventSourceLibevent); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_LIBEVENT_H_ |