Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: ui/events/platform/x11/x11_event_source_libevent.cc

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix deps problem. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/platform/x11/x11_event_source_libevent.cc
diff --git a/ui/events/platform/x11/x11_event_source_libevent.cc b/ui/events/platform/x11/x11_event_source_libevent.cc
deleted file mode 100644
index a3ff7a50f94486676686ff6308f08c8938b7335a..0000000000000000000000000000000000000000
--- a/ui/events/platform/x11/x11_event_source_libevent.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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.
-
-#include "ui/events/platform/x11/x11_event_source.h"
-
-#include <X11/Xlib.h>
-
-#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_pump_libevent.h"
-
-namespace ui {
-
-namespace {
-
-class X11EventSourceLibevent : public X11EventSource,
- public base::MessagePumpLibevent::Watcher {
- public:
- explicit X11EventSourceLibevent(XDisplay* display)
- : X11EventSource(display),
- initialized_(false) {
- AddEventWatcher();
- }
-
- ~X11EventSourceLibevent() override {
- }
-
- private:
- void AddEventWatcher() {
- if (initialized_)
- return;
- if (!base::MessageLoop::current())
- return;
-
- int fd = ConnectionNumber(display());
- base::MessageLoopForUI::current()->WatchFileDescriptor(fd, true,
- base::MessagePumpLibevent::WATCH_READ, &watcher_controller_, this);
- initialized_ = true;
- }
-
- // PlatformEventSource:
- void OnDispatcherListChanged() override {
- AddEventWatcher();
- }
-
- // base::MessagePumpLibevent::Watcher:
- void OnFileCanReadWithoutBlocking(int fd) override {
- DispatchXEvents();
- }
-
- void OnFileCanWriteWithoutBlocking(int fd) override {
- NOTREACHED();
- }
-
- base::MessagePumpLibevent::FileDescriptorWatcher watcher_controller_;
- bool initialized_;
-
- DISALLOW_COPY_AND_ASSIGN(X11EventSourceLibevent);
-};
-
-} // namespace
-
-scoped_ptr<PlatformEventSource> PlatformEventSource::CreateDefault() {
- return make_scoped_ptr(new X11EventSourceLibevent(gfx::GetXDisplay()));
-}
-
-} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698