Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_delegate.cc

Issue 2510993002: Notify VRDeviceProviders when there are pages listening for vrdisplayactivate (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 void VrShellDelegate::DestroyNonPresentingDelegate() { 102 void VrShellDelegate::DestroyNonPresentingDelegate() {
103 if (non_presenting_delegate_) { 103 if (non_presenting_delegate_) {
104 non_presenting_delegate_.reset(nullptr); 104 non_presenting_delegate_.reset(nullptr);
105 JNIEnv* env = AttachCurrentThread(); 105 JNIEnv* env = AttachCurrentThread();
106 Java_VrShellDelegate_shutdownNonPresentingNativeContext( 106 Java_VrShellDelegate_shutdownNonPresentingNativeContext(
107 env, j_vr_shell_delegate_.obj()); 107 env, j_vr_shell_delegate_.obj());
108 } 108 }
109 } 109 }
110 110
111 void VrShellDelegate::SetListeningForActivate(bool listening) {
112 JNIEnv* env = AttachCurrentThread();
113 Java_VrShellDelegate_setListeningForWebVrActivate(
114 env, j_vr_shell_delegate_.obj(), listening);
115 }
116
111 // ---------------------------------------------------------------------------- 117 // ----------------------------------------------------------------------------
112 // Native JNI methods 118 // Native JNI methods
113 // ---------------------------------------------------------------------------- 119 // ----------------------------------------------------------------------------
114 120
115 bool RegisterVrShellDelegate(JNIEnv* env) { 121 bool RegisterVrShellDelegate(JNIEnv* env) {
116 return RegisterNativesImpl(env); 122 return RegisterNativesImpl(env);
117 } 123 }
118 124
119 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 125 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
120 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj)); 126 return reinterpret_cast<intptr_t>(new VrShellDelegate(env, obj));
121 } 127 }
122 128
123 } // namespace vr_shell 129 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698