[go: nahoru, domu]

blob: 4076e97072e56ab1b97fdf7d0bdcf2807f82ffe5 [file] [log] [blame]
Avi Drissman0db84842022-09-13 19:47:041// Copyright 2017 The Chromium Authors
Anna Maria114d35052017-12-08 23:13:292// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Lei Zhang4d3c5812021-04-21 20:31:055#ifndef DEVICE_VR_ORIENTATION_ORIENTATION_DEVICE_PROVIDER_H_
6#define DEVICE_VR_ORIENTATION_ORIENTATION_DEVICE_PROVIDER_H_
Anna Maria114d35052017-12-08 23:13:297
8#include <memory>
9
Alexander Coopercb573b02020-04-21 22:16:3510#include "base/component_export.h"
Avi Drissmanbb9cd022023-01-11 01:03:2911#include "base/functional/callback_forward.h"
Keishi Hattorie175ac52022-06-07 06:24:5712#include "base/memory/raw_ptr.h"
Anna Maria114d35052017-12-08 23:13:2913#include "device/vr/orientation/orientation_device.h"
Alexander Cooper20e912c72020-04-20 22:51:2814#include "device/vr/public/cpp/vr_device_provider.h"
Miyoung Shin3a4bd172019-10-15 02:55:0115#include "mojo/public/cpp/bindings/pending_remote.h"
Miyoung Shind012ec72019-09-24 03:10:5416#include "mojo/public/cpp/bindings/remote.h"
Ke He31d0bb02018-02-24 07:16:2417#include "services/device/public/mojom/sensor_provider.mojom.h"
Anna Maria114d35052017-12-08 23:13:2918
19namespace device {
20
Alexander Coopercb573b02020-04-21 22:16:3521class COMPONENT_EXPORT(VR_ORIENTATION) VROrientationDeviceProvider
22 : public VRDeviceProvider {
Anna Maria114d35052017-12-08 23:13:2923 public:
Ken Rockot05499cf2019-12-12 05:22:5424 explicit VROrientationDeviceProvider(
25 mojo::PendingRemote<device::mojom::SensorProvider> sensor_provider);
Peter Boströmec0e7662021-09-23 21:20:5726
27 VROrientationDeviceProvider(const VROrientationDeviceProvider&) = delete;
28 VROrientationDeviceProvider& operator=(const VROrientationDeviceProvider&) =
29 delete;
30
Anna Maria114d35052017-12-08 23:13:2931 ~VROrientationDeviceProvider() override;
32
Alexander Cooper6aa525b2021-12-16 21:56:3433 void Initialize(VRDeviceProviderClient* client) override;
Anna Maria114d35052017-12-08 23:13:2934
35 bool Initialized() override;
36
37 private:
38 void DeviceInitialized();
39
40 bool initialized_ = false;
41
Miyoung Shind012ec72019-09-24 03:10:5442 mojo::Remote<device::mojom::SensorProvider> sensor_provider_;
Anna Maria114d35052017-12-08 23:13:2943
44 std::unique_ptr<VROrientationDevice> device_;
Keishi Hattorie175ac52022-06-07 06:24:5745 raw_ptr<VRDeviceProviderClient> client_ = nullptr;
Anna Maria114d35052017-12-08 23:13:2946};
47
48} // namespace device
49
Lei Zhang4d3c5812021-04-21 20:31:0550#endif // DEVICE_VR_ORIENTATION_ORIENTATION_DEVICE_PROVIDER_H_