| Index: device/sensors/sensor_type_converters.h
|
| diff --git a/device/sensors/sensor_type_converters.h b/device/sensors/sensor_type_converters.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..71abbc2ec1be31e4f7711dcbf598995492d9f85b
|
| --- /dev/null
|
| +++ b/device/sensors/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_SENSOR_TYPE_CONVERTERS_H_
|
| +#define DEVICE_SENSORS_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::mojom::SensorConfigurationPtr> {
|
| + static device::PlatformSensorConfiguration Convert(
|
| + const device::mojom::SensorConfigurationPtr& sensor_configuration);
|
| +};
|
| +
|
| +template <>
|
| +struct TypeConverter<device::SensorType, device::mojom::SensorType> {
|
| + static device::SensorType Convert(device::mojom::SensorType sensor_type);
|
| +};
|
| +
|
| +template <>
|
| +struct TypeConverter<device::mojom::ReportingMode, device::ReportingMode> {
|
| + static device::mojom::ReportingMode Convert(
|
| + device::ReportingMode reporting_mode);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // DEVICE_SENSORS_SENSOR_TYPE_CONVERTERS_H_
|
|
|