summaryrefslogtreecommitdiffstats
path: root/ui/events/ozone/event_converter_ozone.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 20:12:59 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 20:12:59 +0000
commit38191afc4c8573ee57312a580a22196df9817eed (patch)
tree4d187fa6f7921d3b157c5c49f0b6c528baf7ad44 /ui/events/ozone/event_converter_ozone.h
parent1effbd4b2add4102733dc85a9fd8e4502830613c (diff)
downloadchromium_src-38191afc4c8573ee57312a580a22196df9817eed.zip
chromium_src-38191afc4c8573ee57312a580a22196df9817eed.tar.gz
chromium_src-38191afc4c8573ee57312a580a22196df9817eed.tar.bz2
Move Ozone event stuff to ui/events
BUG=none R=rjkroege@chromium.org Review URL: https://codereview.chromium.org/23465037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/events/ozone/event_converter_ozone.h')
-rw-r--r--ui/events/ozone/event_converter_ozone.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/ui/events/ozone/event_converter_ozone.h b/ui/events/ozone/event_converter_ozone.h
new file mode 100644
index 0000000..b28df34
--- /dev/null
+++ b/ui/events/ozone/event_converter_ozone.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 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_OZONE_EVENT_CONVERTER_OZONE_H_
+#define UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_pump_libevent.h"
+
+namespace ui {
+class Event;
+
+// In ozone, Chrome reads events from file descriptors created from Linux device
+// drivers. The |MessagePumpLibevent::Watcher| parent class provides the
+// functionality to watch a file descriptor for the arrival of new data and
+// notify its subclasses. Device-specific event converters turn bytes read from
+// the file descriptor into |ui::Event| instances. This class provides the
+// functionality needed in common across all converters: dispatching the
+// |ui::Event| to aura.
+class EventConverterOzone : public base::MessagePumpLibevent::Watcher {
+ public:
+ EventConverterOzone();
+ virtual ~EventConverterOzone();
+
+ protected:
+ // Subclasses should use this method to post a task that will dispatch
+ // |event| from the UI message loop. This method takes ownership of
+ // |event|. |event| will be deleted at the end of the posted task.
+ void DispatchEvent(scoped_ptr<ui::Event> event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EventConverterOzone);
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_