Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 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_EVENT_CONVERTER_EVDEV_IMPL_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 InputDeviceType type, | 34 InputDeviceType type, |
| 35 const EventDeviceInfo& info, | 35 const EventDeviceInfo& info, |
| 36 CursorDelegateEvdev* cursor, | 36 CursorDelegateEvdev* cursor, |
| 37 DeviceEventDispatcherEvdev* dispatcher); | 37 DeviceEventDispatcherEvdev* dispatcher); |
| 38 ~EventConverterEvdevImpl() override; | 38 ~EventConverterEvdevImpl() override; |
| 39 | 39 |
| 40 // EventConverterEvdev: | 40 // EventConverterEvdev: |
| 41 void OnFileCanReadWithoutBlocking(int fd) override; | 41 void OnFileCanReadWithoutBlocking(int fd) override; |
| 42 bool HasKeyboard() const override; | 42 bool HasKeyboard() const override; |
| 43 bool HasTouchpad() const override; | 43 bool HasTouchpad() const override; |
| 44 bool HasCapsLockLed() const override; | |
| 44 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override; | 45 void SetAllowedKeys(scoped_ptr<std::set<DomCode>> allowed_keys) override; |
| 45 void AllowAllKeys() override; | 46 void AllowAllKeys() override; |
| 46 | 47 |
| 47 void ProcessEvents(const struct input_event* inputs, int count); | 48 void ProcessEvents(const struct input_event* inputs, int count); |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 void ConvertKeyEvent(const input_event& input); | 51 void ConvertKeyEvent(const input_event& input); |
| 51 | 52 |
| 52 void ConvertMouseMoveEvent(const input_event& input); | 53 void ConvertMouseMoveEvent(const input_event& input); |
| 53 | 54 |
| 54 void DispatchMouseButton(const input_event& input); | 55 void DispatchMouseButton(const input_event& input); |
| 55 | 56 |
| 56 // Flush events delimited by EV_SYN. This is useful for handling | 57 // Flush events delimited by EV_SYN. This is useful for handling |
| 57 // non-axis-aligned movement properly. | 58 // non-axis-aligned movement properly. |
| 58 void FlushEvents(const input_event& input); | 59 void FlushEvents(const input_event& input); |
| 59 | 60 |
| 60 // Input modalities for this device. | 61 // Input modalities for this device. |
| 61 bool has_keyboard_; | 62 bool has_keyboard_; |
| 62 bool has_touchpad_; | 63 bool has_touchpad_; |
| 63 | 64 |
| 65 // Leds for this device. | |
|
alexst (slow to review)
2015/03/02 22:20:23
You use both Led and LED, it should probably be LE
spang
2015/03/02 22:38:21
For camel case our code [relatively] consistently
| |
| 66 bool has_caps_lock_led_; | |
| 67 | |
| 64 // Save x-axis events of relative devices to be flushed at EV_SYN time. | 68 // Save x-axis events of relative devices to be flushed at EV_SYN time. |
| 65 int x_offset_; | 69 int x_offset_; |
| 66 | 70 |
| 67 // Save y-axis events of relative devices to be flushed at EV_SYN time. | 71 // Save y-axis events of relative devices to be flushed at EV_SYN time. |
| 68 int y_offset_; | 72 int y_offset_; |
| 69 | 73 |
| 70 // Controller for watching the input fd. | 74 // Controller for watching the input fd. |
| 71 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 75 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
| 72 | 76 |
| 73 // The keys which should be processed. nullptr if all keys should be | 77 // The keys which should be processed. nullptr if all keys should be |
| 74 // processed. | 78 // processed. |
| 75 scoped_ptr<std::set<DomCode>> allowed_keys_; | 79 scoped_ptr<std::set<DomCode>> allowed_keys_; |
| 76 | 80 |
| 77 // Shared cursor state. | 81 // Shared cursor state. |
| 78 CursorDelegateEvdev* cursor_; | 82 CursorDelegateEvdev* cursor_; |
| 79 | 83 |
| 80 // Callbacks for dispatching events. | 84 // Callbacks for dispatching events. |
| 81 DeviceEventDispatcherEvdev* dispatcher_; | 85 DeviceEventDispatcherEvdev* dispatcher_; |
| 82 | 86 |
| 83 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); | 87 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl); |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } // namespace ui | 90 } // namespace ui |
| 87 | 91 |
| 88 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ | 92 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_ |
| 89 | 93 |
| OLD | NEW |