Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: device/sensors/mojo/sensor_type_converters.h

Issue 2078433002: [sensors] Introduce Generic Sensor API interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Interfaces + implementation of common part. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698