| 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 "chrome/browser/android/vr_shell/vr_shell_delegate.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h" | 10 #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 void VrShellDelegate::OnResume(JNIEnv* env, | 114 void VrShellDelegate::OnResume(JNIEnv* env, |
| 115 const JavaParamRef<jobject>& obj) { | 115 const JavaParamRef<jobject>& obj) { |
| 116 if (non_presenting_delegate_) { | 116 if (non_presenting_delegate_) { |
| 117 non_presenting_delegate_->Resume(); | 117 non_presenting_delegate_->Resume(); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 void VrShellDelegate::ShowTab(int id) { |
| 122 JNIEnv* env = AttachCurrentThread(); |
| 123 Java_VrShellDelegate_showTab(env, j_vr_shell_delegate_.obj(), id); |
| 124 } |
| 125 |
| 121 void VrShellDelegate::SetDeviceProvider( | 126 void VrShellDelegate::SetDeviceProvider( |
| 122 device::GvrDeviceProvider* device_provider) { | 127 device::GvrDeviceProvider* device_provider) { |
| 123 CHECK(!device_provider_); | 128 CHECK(!device_provider_); |
| 124 device_provider_ = device_provider; | 129 device_provider_ = device_provider; |
| 125 if (!delegate_) | 130 if (!delegate_) |
| 126 CreateNonPresentingDelegate(); | 131 CreateNonPresentingDelegate(); |
| 127 device_provider_->Device()->OnDelegateChanged(); | 132 device_provider_->Device()->OnDelegateChanged(); |
| 128 } | 133 } |
| 129 | 134 |
| 130 void VrShellDelegate::ClearDeviceProvider() { | 135 void VrShellDelegate::ClearDeviceProvider() { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 205 |
| 201 bool RegisterVrShellDelegate(JNIEnv* env) { | 206 bool RegisterVrShellDelegate(JNIEnv* env) { |
| 202 return RegisterNativesImpl(env); | 207 return RegisterNativesImpl(env); |
| 203 } | 208 } |
| 204 | 209 |
| 205 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 210 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 206 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); | 211 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); |
| 207 } | 212 } |
| 208 | 213 |
| 209 } // namespace vr_shell | 214 } // namespace vr_shell |
| OLD | NEW |