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

Unified Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2317483002: Add support of vrdisplayconnect and vrdisplaydisconnect event (Closed)
Patch Set: Clean some style issue according to mthiesse@ Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698