OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ | 5 #ifndef UI_EVENTS_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ |
6 #define UI_EVENTS_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ | 6 #define UI_EVENTS_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ui/events/devices/input_device.h" | 10 #include "ui/events/devices/input_device.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static int32_t id(const ui::InputDevice& device) { return device.id; } | 27 static int32_t id(const ui::InputDevice& device) { return device.id; } |
28 | 28 |
29 static ui::InputDeviceType type(const ui::InputDevice& device) { | 29 static ui::InputDeviceType type(const ui::InputDevice& device) { |
30 return device.type; | 30 return device.type; |
31 } | 31 } |
32 | 32 |
33 static const std::string& name(const ui::InputDevice& device) { | 33 static const std::string& name(const ui::InputDevice& device) { |
34 return device.name; | 34 return device.name; |
35 } | 35 } |
36 | 36 |
| 37 static bool enabled(const ui::InputDevice& device) { return device.enabled; } |
| 38 |
37 static std::string sys_path(const ui::InputDevice& device) { | 39 static std::string sys_path(const ui::InputDevice& device) { |
38 return device.sys_path.AsUTF8Unsafe(); | 40 return device.sys_path.AsUTF8Unsafe(); |
39 } | 41 } |
40 | 42 |
41 static uint32_t vendor_id(const ui::InputDevice& device) { | 43 static uint32_t vendor_id(const ui::InputDevice& device) { |
42 return device.vendor_id; | 44 return device.vendor_id; |
43 } | 45 } |
44 | 46 |
45 static uint32_t product_id(const ui::InputDevice& device) { | 47 static uint32_t product_id(const ui::InputDevice& device) { |
46 return device.product_id; | 48 return device.product_id; |
(...skipping 24 matching lines...) Expand all Loading... |
71 return device.touch_points; | 73 return device.touch_points; |
72 } | 74 } |
73 | 75 |
74 static bool Read(ui::mojom::TouchscreenDeviceDataView data, | 76 static bool Read(ui::mojom::TouchscreenDeviceDataView data, |
75 ui::TouchscreenDevice* out); | 77 ui::TouchscreenDevice* out); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace mojo | 80 } // namespace mojo |
79 | 81 |
80 #endif // UI_EVENTS_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ | 82 #endif // UI_EVENTS_DEVICES_MOJO_INPUT_DEVICE_STRUCT_TRAITS_H_ |
OLD | NEW |