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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 base::Bind(&GvrDeviceProvider::ExitPresent, base::Unretained(this))); | 150 base::Bind(&GvrDeviceProvider::ExitPresent, base::Unretained(this))); |
150 } | 151 } |
151 | 152 |
152 void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) { | 153 void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) { |
153 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 154 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
154 | 155 |
155 vr_device_->SetDelegate(delegate); | 156 vr_device_->SetDelegate(delegate); |
156 } | 157 } |
157 | 158 |
158 } // namespace device | 159 } // namespace device |
OLD | NEW |