Index: device/vr/android/gvr/gvr_device_provider.cc |
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc |
index ad21151426db9f44117c538c14586b8f061e47e8..6e7fd89762620e64102f44778e3079da12ec9548 100644 |
--- a/device/vr/android/gvr/gvr_device_provider.cc |
+++ b/device/vr/android/gvr/gvr_device_provider.cc |
@@ -85,22 +85,33 @@ void GvrDeviceProvider::GetDevices(std::vector<VRDevice*>* devices) { |
devices->push_back(vr_device_.get()); |
} |
+void GvrDeviceProvider::SetClient(VRClientDispatcher* client) { |
+ if (!client_) |
+ client_.reset(client); |
+} |
+ |
void GvrDeviceProvider::Initialize() { |
- if (!delegate_) { |
+ if (!delegate_) |
delegate_.reset(new GvrDeviceProviderDelegate()); |
- } |
} |
void GvrDeviceProvider::OnDelegateInitialized(GvrDelegate* delegate) { |
if (!vr_device_) |
vr_device_.reset(new GvrDevice(this, delegate)); |
- // Should fire a vrdisplayconnected event here. |
+ client_->OnDeviceConnectionStatusChanged(vr_device_.get(), true); |
} |
void GvrDeviceProvider::OnDelegateShutdown() { |
// Nothing to do here just yet. Eventually want to shut down the VRDevice and |
// fire a vrdisplaydisconnected event. |
bajones
2016/09/12 01:36:15
Happily this comment is no longer accurate! Lets r
shaobo.yan
2016/09/12 01:59:01
Done.
|
+ if (client_ && vr_device_) |
+ client_->OnDeviceConnectionStatusChanged(vr_device_.get(), false); |
+} |
+ |
+void GvrDeviceProvider::PollEvents() { |
+ if (vr_device_) |
+ vr_device_->PollEvents(); |
} |
} // namespace device |