 Chromium Code Reviews
 Chromium Code Reviews Issue 137273009:
  evdev: Factor common code out of key & touch converters  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 137273009:
  evdev: Factor common code out of key & touch converters  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 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 "base/message_loop/message_pump_ozone.h" | |
| 
rjkroege
2014/01/24 22:25:36
this is unfortunate. Can it be removed?
 
spang
2014/01/24 22:56:35
Oops. Removed.
 | |
| 9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" | 
| 10 #include "ui/events/events_export.h" | 11 #include "ui/events/events_export.h" | 
| 11 #include "ui/events/ozone/evdev/event_modifiers.h" | 12 #include "ui/events/ozone/evdev/event_modifiers.h" | 
| 12 #include "ui/events/ozone/event_converter_ozone.h" | 13 #include "ui/events/ozone/event_converter_ozone.h" | 
| 13 | 14 | 
| 14 struct input_event; | 15 struct input_event; | 
| 15 | 16 | 
| 16 namespace ui { | 17 namespace ui { | 
| 17 | 18 | 
| 18 class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone { | 19 class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone { | 
| 19 public: | 20 public: | 
| 20 KeyEventConverterEvdev(int fd, | 21 EventConverterEvdev(int fd, | 
| 21 base::FilePath path, | 22 base::FilePath path, | 
| 22 EventModifiersEvdev* modifiers); | 23 EventModifiersEvdev* modifiers); | 
| 23 virtual ~KeyEventConverterEvdev(); | 24 virtual ~EventConverterEvdev(); | 
| 24 | 25 | 
| 25 // Overidden from base::MessagePumpLibevent::Watcher. | 26 // Overidden from base::MessagePumpLibevent::Watcher. | 
| 26 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 27 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 
| 27 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 28 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 
| 28 | 29 | 
| 29 void ProcessEvents(const struct input_event* inputs, int count); | 30 protected: | 
| 31 // Process & dispatch events read from the device. | |
| 32 virtual void ProcessEvents(const struct input_event* inputs, int count) = 0; | |
| 30 | 33 | 
| 31 private: | |
| 32 // File descriptor for the /dev/input/event* instance. | 34 // File descriptor for the /dev/input/event* instance. | 
| 
rjkroege
2014/01/24 22:25:36
why can't the instance variables still be private?
 
spang
2014/01/24 22:56:35
They are used in the subclasses. Would you prefer
 | |
| 33 int fd_; | 35 int fd_; | 
| 34 | 36 | 
| 35 // Path to input device. | 37 // Path to input device. | 
| 36 base::FilePath path_; | 38 base::FilePath path_; | 
| 37 | 39 | 
| 38 // Shared modifier state. | 40 // Shared modifier state. | 
| 39 EventModifiersEvdev* modifiers_; | 41 EventModifiersEvdev* modifiers_; | 
| 40 | 42 | 
| 41 void ConvertKeyEvent(int key, int value); | 43 private: | 
| 42 | 44 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); | 
| 43 DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev); | |
| 44 }; | 45 }; | 
| 45 | 46 | 
| 46 } // namspace ui | 47 } // namspace ui | 
| 47 | 48 | 
| 48 #endif // UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_ | 49 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_ | 
| 49 | |
| OLD | NEW |