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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "chrome/browser/android/vr_shell/vr_shell.h" | 8 #include "chrome/browser/android/vr_shell/vr_shell.h" |
9 #include "device/vr/android/gvr/gvr_device_provider.h" | 9 #include "device/vr/android/gvr/gvr_device_provider.h" |
10 #include "jni/VrShellDelegate_jni.h" | 10 #include "jni/VrShellDelegate_jni.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 void VrShellDelegate::DestroyNonPresentingDelegate() { | 114 void VrShellDelegate::DestroyNonPresentingDelegate() { |
115 if (non_presenting_delegate_) { | 115 if (non_presenting_delegate_) { |
116 non_presenting_delegate_.reset(nullptr); | 116 non_presenting_delegate_.reset(nullptr); |
117 JNIEnv* env = AttachCurrentThread(); | 117 JNIEnv* env = AttachCurrentThread(); |
118 Java_VrShellDelegate_shutdownNonPresentingNativeContext( | 118 Java_VrShellDelegate_shutdownNonPresentingNativeContext( |
119 env, j_vr_shell_delegate_.obj()); | 119 env, j_vr_shell_delegate_.obj()); |
120 } | 120 } |
121 } | 121 } |
122 | 122 |
| 123 void VrShellDelegate::SetListeningForActivate(bool listening) { |
| 124 JNIEnv* env = AttachCurrentThread(); |
| 125 Java_VrShellDelegate_setListeningForWebVrActivate( |
| 126 env, j_vr_shell_delegate_.obj(), listening); |
| 127 } |
| 128 |
123 // ---------------------------------------------------------------------------- | 129 // ---------------------------------------------------------------------------- |
124 // Native JNI methods | 130 // Native JNI methods |
125 // ---------------------------------------------------------------------------- | 131 // ---------------------------------------------------------------------------- |
126 | 132 |
127 bool RegisterVrShellDelegate(JNIEnv* env) { | 133 bool RegisterVrShellDelegate(JNIEnv* env) { |
128 return RegisterNativesImpl(env); | 134 return RegisterNativesImpl(env); |
129 } | 135 } |
130 | 136 |
131 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 137 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
132 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); | 138 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); |
133 } | 139 } |
134 | 140 |
135 } // namespace vr_shell | 141 } // namespace vr_shell |
OLD | NEW |