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

Side by Side Diff: ui/events/ozone/event_converter_ozone.h

Issue 133233008: evdev: Move EventConverterOzone ownership from EventFactoryOzone to subclass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dropped EventConverterEvdev Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 5 #ifndef UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
6 #define UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 6 #define UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_pump_libevent.h"
10 #include "ui/events/events_export.h" 9 #include "ui/events/events_export.h"
11 10
12 namespace ui { 11 namespace ui {
13 class Event; 12 class Event;
14 13
15 // In ozone, Chrome reads events from file descriptors created from Linux device 14 // Ozone implementations can generate input events in whatever way is
16 // drivers. The |MessagePumpLibevent::Watcher| parent class provides the 15 // appropriate for the platform.
17 // functionality to watch a file descriptor for the arrival of new data and 16 // This class provides the functionality needed in common across all
18 // notify its subclasses. Device-specific event converters turn bytes read from 17 // converters: dispatching the |ui::Event| to aura.
19 // the file descriptor into |ui::Event| instances. This class provides the 18 class EVENTS_EXPORT EventConverterOzone {
20 // functionality needed in common across all converters: dispatching the
21 // |ui::Event| to aura.
22 class EVENTS_EXPORT EventConverterOzone
23 : public base::MessagePumpLibevent::Watcher {
24 public: 19 public:
25 EventConverterOzone(); 20 EventConverterOzone();
26 virtual ~EventConverterOzone(); 21 virtual ~EventConverterOzone();
27 22
28 protected: 23 protected:
29 // Subclasses should use this method to post a task that will dispatch 24 // Subclasses should use this method to post a task that will dispatch
30 // |event| from the UI message loop. This method takes ownership of 25 // |event| from the UI message loop. This method takes ownership of
31 // |event|. |event| will be deleted at the end of the posted task. 26 // |event|. |event| will be deleted at the end of the posted task.
32 virtual void DispatchEvent(scoped_ptr<ui::Event> event); 27 static void DispatchEvent(scoped_ptr<ui::Event> event);
spang 2014/01/28 22:01:32 This is looking pretty lonely. All that's left her
rjkroege 2014/01/28 23:27:55 sgtm. Added to EventFactory perhaps?
33 28
34 private: 29 private:
35 DISALLOW_COPY_AND_ASSIGN(EventConverterOzone); 30 DISALLOW_COPY_AND_ASSIGN(EventConverterOzone);
36 }; 31 };
37 32
38 } // namespace ui 33 } // namespace ui
39 34
40 #endif // UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 35 #endif // UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter.cc ('k') | ui/events/ozone/event_converter_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698