Index: device/sensors/mojo/sensor_type_converters.h |
diff --git a/device/sensors/mojo/sensor_type_converters.h b/device/sensors/mojo/sensor_type_converters.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8181321a38ad8da566e0512ef52881b9b8fc56f3 |
--- /dev/null |
+++ b/device/sensors/mojo/sensor_type_converters.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |
+#define DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |
+ |
+#include "device/sensors/public/interfaces/sensor.mojom.h" |
+#include "mojo/public/cpp/bindings/type_converter.h" |
+ |
+namespace device { |
+class PlatformSensorConfiguration; |
+enum class SensorType : int32_t; |
+enum class ReportingMode : int32_t; |
+} |
+ |
+namespace mojo { |
+ |
+template <> |
+struct TypeConverter<device::PlatformSensorConfiguration, |
+ device::sensors::SensorConfigurationPtr> { |
+ static device::PlatformSensorConfiguration Convert( |
+ const device::sensors::SensorConfigurationPtr& sensor_configuration); |
+}; |
+ |
+template <> |
+struct TypeConverter<device::SensorType, device::sensors::SensorType> { |
+ static device::SensorType Convert(device::sensors::SensorType sensor_type); |
+}; |
+ |
+template <> |
+struct TypeConverter<device::sensors::ReportingMode, device::ReportingMode> { |
+ static device::sensors::ReportingMode Convert( |
+ device::ReportingMode reporting_mode); |
+}; |
+ |
+} // namespace mojo |
+ |
+#endif // DEVICE_SENSORS_MOJO_SENSOR_TYPE_CONVERTERS_H_ |