| 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 DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ | 5 #ifndef SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ | 6 #define SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "device/generic_sensor/platform_sensor_provider.h" | 8 #include "services/device/generic_sensor/platform_sensor_provider.h" |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 | 11 |
| 12 namespace device { | 12 namespace device { |
| 13 | 13 |
| 14 class PlatformSensorProviderAndroid : public PlatformSensorProvider { | 14 class PlatformSensorProviderAndroid : public PlatformSensorProvider { |
| 15 public: | 15 public: |
| 16 PlatformSensorProviderAndroid(); | 16 PlatformSensorProviderAndroid(); |
| 17 ~PlatformSensorProviderAndroid() override; | 17 ~PlatformSensorProviderAndroid() override; |
| 18 | 18 |
| 19 static PlatformSensorProviderAndroid* GetInstance(); | 19 static PlatformSensorProviderAndroid* GetInstance(); |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 void CreateSensorInternal(mojom::SensorType type, | 22 void CreateSensorInternal(mojom::SensorType type, |
| 23 mojo::ScopedSharedBufferMapping mapping, | 23 mojo::ScopedSharedBufferMapping mapping, |
| 24 const CreateSensorCallback& callback) override; | 24 const CreateSensorCallback& callback) override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 // Java object org.chromium.device.sensors.PlatformSensorProvider | 27 // Java object org.chromium.device.sensors.PlatformSensorProvider |
| 28 base::android::ScopedJavaGlobalRef<jobject> j_object_; | 28 base::android::ScopedJavaGlobalRef<jobject> j_object_; |
| 29 | 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(PlatformSensorProviderAndroid); | 30 DISALLOW_COPY_AND_ASSIGN(PlatformSensorProviderAndroid); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace device | 33 } // namespace device |
| 34 | 34 |
| 35 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ | 35 #endif // SERVICES_DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_ANDROID_H_ |
| OLD | NEW |