OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |
| 6 #define DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |
| 7 |
| 8 #include "device/sensors/public/interfaces/sensor.mojom.h" |
| 9 #include "mojo/public/cpp/bindings/type_converter.h" |
| 10 |
| 11 namespace device { |
| 12 class PlatformSensorConfiguration; |
| 13 enum class SensorType : int32_t; |
| 14 enum class ReportingMode : int32_t; |
| 15 } |
| 16 |
| 17 namespace mojo { |
| 18 |
| 19 template <> |
| 20 struct TypeConverter<device::PlatformSensorConfiguration, |
| 21 device::sensors::SensorConfigurationPtr> { |
| 22 static device::PlatformSensorConfiguration Convert( |
| 23 const device::sensors::SensorConfigurationPtr& sensor_configuration); |
| 24 }; |
| 25 |
| 26 template <> |
| 27 struct TypeConverter<device::SensorType, device::sensors::SensorType> { |
| 28 static device::SensorType Convert(device::sensors::SensorType sensor_type); |
| 29 }; |
| 30 |
| 31 template <> |
| 32 struct TypeConverter<device::sensors::ReportingMode, device::ReportingMode> { |
| 33 static device::sensors::ReportingMode Convert( |
| 34 device::ReportingMode reporting_mode); |
| 35 }; |
| 36 |
| 37 } // namespace mojo |
| 38 |
| 39 #endif // DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |
OLD | NEW |