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_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ |
7 | 7 |
8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
14 #include "ui/events/ozone/evdev/event_converter_evdev.h" | 15 #include "ui/events/ozone/evdev/event_converter_evdev.h" |
15 #include "ui/events/ozone/evdev/event_device_info.h" | 16 #include "ui/events/ozone/evdev/event_device_info.h" |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 | 19 |
19 // Basic wrapper for libevdev-cros. | 20 // Basic wrapper for libevdev-cros. |
20 // | 21 // |
21 // This drives libevdev-cros from a file descriptor and calls delegate | 22 // This drives libevdev-cros from a file descriptor and calls delegate |
22 // with the updated event state from libevdev-cros. | 23 // with the updated event state from libevdev-cros. |
(...skipping 15 matching lines...) Expand all Loading... |
38 const timeval& time) = 0; | 39 const timeval& time) = 0; |
39 | 40 |
40 // Notifier for stop. This is called with the final event state. | 41 // Notifier for stop. This is called with the final event state. |
41 virtual void OnLibEvdevCrosStopped(Evdev* evdev, EventStateRec* state) = 0; | 42 virtual void OnLibEvdevCrosStopped(Evdev* evdev, EventStateRec* state) = 0; |
42 }; | 43 }; |
43 | 44 |
44 EventReaderLibevdevCros(int fd, | 45 EventReaderLibevdevCros(int fd, |
45 const base::FilePath& path, | 46 const base::FilePath& path, |
46 int id, | 47 int id, |
47 const EventDeviceInfo& devinfo, | 48 const EventDeviceInfo& devinfo, |
48 scoped_ptr<Delegate> delegate); | 49 std::unique_ptr<Delegate> delegate); |
49 ~EventReaderLibevdevCros() override; | 50 ~EventReaderLibevdevCros() override; |
50 | 51 |
51 // EventConverterEvdev: | 52 // EventConverterEvdev: |
52 void OnFileCanReadWithoutBlocking(int fd) override; | 53 void OnFileCanReadWithoutBlocking(int fd) override; |
53 bool HasKeyboard() const override; | 54 bool HasKeyboard() const override; |
54 bool HasMouse() const override; | 55 bool HasMouse() const override; |
55 bool HasTouchpad() const override; | 56 bool HasTouchpad() const override; |
56 bool HasCapsLockLed() const override; | 57 bool HasCapsLockLed() const override; |
57 void OnDisabled() override; | 58 void OnDisabled() override; |
58 | 59 |
(...skipping 14 matching lines...) Expand all Loading... |
73 // Libevdev state. | 74 // Libevdev state. |
74 Evdev evdev_; | 75 Evdev evdev_; |
75 | 76 |
76 // Event state. | 77 // Event state. |
77 EventStateRec evstate_; | 78 EventStateRec evstate_; |
78 | 79 |
79 // Path to input device. | 80 // Path to input device. |
80 base::FilePath path_; | 81 base::FilePath path_; |
81 | 82 |
82 // Delegate for event processing. | 83 // Delegate for event processing. |
83 scoped_ptr<Delegate> delegate_; | 84 std::unique_ptr<Delegate> delegate_; |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(EventReaderLibevdevCros); | 86 DISALLOW_COPY_AND_ASSIGN(EventReaderLibevdevCros); |
86 }; | 87 }; |
87 | 88 |
88 } // namspace ui | 89 } // namspace ui |
89 | 90 |
90 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ | 91 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_EVENT_READER_LIBEVDEV_CROS_H_ |
OLD | NEW |