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

Side by Side Diff: device/vr/vr_service_impl.h

Issue 2167643003: Refactored VRService interaction and added VRServiceClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed issues that showed up on an Android compile Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_VR_VR_SERVICE_IMPL_H
6 #define DEVICE_VR_VR_SERVICE_IMPL_H
7
8 #include <memory>
9
10 #include "base/macros.h"
11
12 #include "device/vr/vr_export.h"
13 #include "device/vr/vr_service.mojom.h"
14 #include "mojo/public/cpp/bindings/binding.h"
15
16 namespace device {
17
18 class VRServiceImpl : public VRService {
19 public:
20 DEVICE_VR_EXPORT ~VRServiceImpl() override;
21
22 DEVICE_VR_EXPORT static void BindRequest(
23 mojo::InterfaceRequest<VRService> request);
24
25 VRServiceClientPtr& client() { return client_; }
26
27 private:
28 VRServiceImpl();
29
30 // Mojo connection handling.
31 void Bind(mojo::InterfaceRequest<VRService> request);
32 void OnConnectionError();
33 void OnClientConnectionError();
34
35 // mojom::VRService implementation
36 void SetClient(VRServiceClientPtr client) override;
37 void GetDisplays(const GetDisplaysCallback& callback) override;
38 void GetPose(uint32_t index, const GetPoseCallback& callback) override;
39 void ResetPose(uint32_t index) override;
40
41 std::unique_ptr<mojo::Binding<VRService>> binding_;
42 VRServiceClientPtr client_;
43
44 DISALLOW_COPY_AND_ASSIGN(VRServiceImpl);
45 };
46
47 } // namespace device
48
49 #endif // DEVICE_VR_VR_SERVICE_IMPL_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698