OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/vr/android/gvr/gvr_device_provider.h" | 5 #include "device/vr/android/gvr/gvr_device_provider.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void GvrDeviceProvider::Initialize() { | 88 void GvrDeviceProvider::Initialize() { |
89 if (!delegate_) { | 89 if (!delegate_) { |
90 delegate_.reset(new GvrDeviceProviderDelegate()); | 90 delegate_.reset(new GvrDeviceProviderDelegate()); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void GvrDeviceProvider::OnDelegateInitialized(GvrDelegate* delegate) { | 94 void GvrDeviceProvider::OnDelegateInitialized(GvrDelegate* delegate) { |
95 if (!vr_device_) | 95 if (!vr_device_) |
96 vr_device_.reset(new GvrDevice(this, delegate)); | 96 vr_device_.reset(new GvrDevice(this, delegate)); |
97 | 97 |
98 // Should fire a vrdisplayconnected event here. | 98 if (vr_device_) |
| 99 vr_device_->UpdateConnectionStatus(true); |
99 } | 100 } |
100 | 101 |
101 void GvrDeviceProvider::OnDelegateShutdown() { | 102 void GvrDeviceProvider::OnDelegateShutdown() { |
102 // Nothing to do here just yet. Eventually want to shut down the VRDevice and | 103 // Nothing to do here just yet. Eventually want to shut down the VRDevice and |
103 // fire a vrdisplaydisconnected event. | 104 // fire a vrdisplaydisconnected event. |
| 105 if (vr_device_) |
| 106 vr_device_->UpdateConnectionStatus(false); |
| 107 } |
| 108 |
| 109 void GvrDeviceProvider::PollEvents(VRClientDispatcher* client) { |
| 110 if (vr_device_) |
| 111 vr_device_->PollEvents(client); |
104 } | 112 } |
105 | 113 |
106 } // namespace device | 114 } // namespace device |
OLD | NEW |