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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void Shutdown() { | 51 void Shutdown() { |
52 if (!j_device_.is_null()) { | 52 if (!j_device_.is_null()) { |
53 gvr_api_ = nullptr; | 53 gvr_api_ = nullptr; |
54 JNIEnv* env = AttachCurrentThread(); | 54 JNIEnv* env = AttachCurrentThread(); |
55 Java_GvrDeviceProvider_shutdown(env, j_device_.obj()); | 55 Java_GvrDeviceProvider_shutdown(env, j_device_.obj()); |
56 j_device_ = nullptr; | 56 j_device_ = nullptr; |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 // GvrDelegate implementation | 60 // GvrDelegate implementation |
| 61 void SetWebVRSecureOrigin(bool secure_origin) override {} |
61 void SubmitWebVRFrame() override {} | 62 void SubmitWebVRFrame() override {} |
62 void UpdateWebVRTextureBounds(int eye, | 63 void UpdateWebVRTextureBounds(int eye, |
63 float left, | 64 float left, |
64 float top, | 65 float top, |
65 float width, | 66 float width, |
66 float height) override {} | 67 float height) override {} |
67 | 68 |
68 gvr::GvrApi* gvr_api() override { return gvr_api_.get(); } | 69 gvr::GvrApi* gvr_api() override { return gvr_api_.get(); } |
69 | 70 |
70 private: | 71 private: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 145 |
145 void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) { | 146 void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) { |
146 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 147 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
147 | 148 |
148 vr_device_->SetDelegate(delegate); | 149 vr_device_->SetDelegate(delegate); |
149 GamepadDataFetcherManager::GetInstance()->AddFactory( | 150 GamepadDataFetcherManager::GetInstance()->AddFactory( |
150 new GvrGamepadDataFetcher::Factory(delegate, vr_device_->id())); | 151 new GvrGamepadDataFetcher::Factory(delegate, vr_device_->id())); |
151 } | 152 } |
152 | 153 |
153 } // namespace device | 154 } // namespace device |
OLD | NEW |