Chromium Code Reviews| Index: device/vr/vr_service_impl.h |
| diff --git a/device/vr/vr_service_impl.h b/device/vr/vr_service_impl.h |
| index ba8b6b162dd3949158b6676a41159a3ba858dc60..64b76e5022715a2adcf7a95b13c900d34d934456 100644 |
| --- a/device/vr/vr_service_impl.h |
| +++ b/device/vr/vr_service_impl.h |
| @@ -17,6 +17,11 @@ |
| namespace device { |
| +// Browser process representation of a WebVR site session. Instantiated through |
| +// Mojo once the user navigates to a web site containing WebVR. |
|
mthiesse
2017/03/13 22:17:29
nit: s/navigates to a web site/loads a page/
tiborg
2017/03/13 23:00:58
Done.
|
| +// It instantiates a VRDisplayImpl for each newly connected VRDisplay and sends |
| +// the display's info to the browser process through its connected |
| +// mojom::VRServiceClient. |
| class VRServiceImpl : public mojom::VRService { |
|
amp
2017/03/13 22:26:05
Not required for this change, but VRServiceImpl se
tiborg
2017/03/13 23:00:58
Yep, agreed. VRSession sounds good to me. Should b
bajones
2017/03/13 23:04:57
May want to be careful with that. VRSession will h
amp
2017/03/14 17:05:50
Thanks for the clarification Brandon. I thought I
|
| public: |
| DEVICE_VR_EXPORT VRServiceImpl(); |
| @@ -25,26 +30,25 @@ class VRServiceImpl : public mojom::VRService { |
| DEVICE_VR_EXPORT static void Create( |
| mojo::InterfaceRequest<mojom::VRService> request); |
| - mojom::VRServiceClient* client() { return client_.get(); } |
| - |
| - DEVICE_VR_EXPORT VRDisplayImpl* GetVRDisplayImpl(VRDevice* device); |
| - |
| // mojom::VRService implementation |
| + // Adds this service to the VRDeviceManager. |
| void SetClient(mojom::VRServiceClientPtr service_client, |
| const SetClientCallback& callback) override; |
| bool listening_for_activate() { return listening_for_activate_; } |
| + // Tell the render process that a new VR device is available. |
| + void ConnectDevice(VRDevice* device); |
| + |
| private: |
| friend class FakeVRServiceClient; |
| friend class VRDeviceManagerTest; |
| - friend class VRDisplayImpl; |
| friend class VRDisplayImplTest; |
| friend class VRServiceImplTest; |
| - void RemoveDevice(VRDevice* device); |
| - |
| void SetListeningForActivate(bool listening) override; |
| + void OnVRDisplayInfoCreated(VRDevice* device, |
| + mojom::VRDisplayInfoPtr display_info); |
| std::map<VRDevice*, std::unique_ptr<VRDisplayImpl>> displays_; |
| @@ -52,6 +56,11 @@ class VRServiceImpl : public mojom::VRService { |
| bool listening_for_activate_; |
| + base::WeakPtrFactory<VRServiceImpl> weak_ptr_factory_; |
| + |
| + // Getter for testing. |
| + VRDisplayImpl* GetVRDisplayImpl(VRDevice* device); |
| + |
| DISALLOW_COPY_AND_ASSIGN(VRServiceImpl); |
| }; |