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

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

Issue 2317483002: Add support of vrdisplayconnect and vrdisplaydisconnect event (Closed)
Patch Set: fix missing brace 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
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.h ('k') | device/vr/vr_client_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5d80f2652670d2ee96f7ee4a44bd5ef411c1364e 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -85,22 +85,26 @@ 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.
+ if (client_ && vr_device_)
+ client_->OnDeviceConnectionStatusChanged(vr_device_.get(), false);
}
} // namespace device
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.h ('k') | device/vr/vr_client_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698