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

Side by Side Diff: ui/events/ozone/evdev/event_converter.h

Issue 137273009: evdev: Factor common code out of key & touch converters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove duplicate variables & unneeded #include Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/ozone/evdev/event_converter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 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 #ifndef UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_
6 #define UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/events_export.h" 10 #include "ui/events/events_export.h"
11 #include "ui/events/ozone/evdev/event_modifiers.h" 11 #include "ui/events/ozone/evdev/event_modifiers.h"
12 #include "ui/events/ozone/event_converter_ozone.h" 12 #include "ui/events/ozone/event_converter_ozone.h"
13 13
14 struct input_event; 14 struct input_event;
15 15
16 namespace ui { 16 namespace ui {
17 17
18 class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone { 18 class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone {
19 public: 19 public:
20 KeyEventConverterEvdev(int fd, 20 EventConverterEvdev(int fd,
21 base::FilePath path, 21 base::FilePath path,
22 EventModifiersEvdev* modifiers); 22 EventModifiersEvdev* modifiers);
23 virtual ~KeyEventConverterEvdev(); 23 virtual ~EventConverterEvdev();
24 24
25 // Overidden from base::MessagePumpLibevent::Watcher. 25 // Overidden from base::MessagePumpLibevent::Watcher.
26 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; 26 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
27 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; 27 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
28 28
29 void ProcessEvents(const struct input_event* inputs, int count); 29 protected:
30 // Process & dispatch events read from the device.
31 virtual void ProcessEvents(const struct input_event* inputs, int count) = 0;
30 32
31 private:
32 // File descriptor for the /dev/input/event* instance. 33 // File descriptor for the /dev/input/event* instance.
33 int fd_; 34 int fd_;
34 35
35 // Path to input device. 36 // Path to input device.
36 base::FilePath path_; 37 base::FilePath path_;
37 38
38 // Shared modifier state. 39 // Shared modifier state.
39 EventModifiersEvdev* modifiers_; 40 EventModifiersEvdev* modifiers_;
40 41
41 void ConvertKeyEvent(int key, int value); 42 private:
42 43 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
43 DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev);
44 }; 44 };
45 45
46 } // namspace ui 46 } // namspace ui
47 47
48 #endif // UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_ 48 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_
49
OLDNEW
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/ozone/evdev/event_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698