| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // must only be used on the UI thread. | 56 // must only be used on the UI thread. |
| 57 class VrShell : public device::GvrDelegate, content::WebContentsObserver { | 57 class VrShell : public device::GvrDelegate, content::WebContentsObserver { |
| 58 public: | 58 public: |
| 59 VrShell(JNIEnv* env, jobject obj, | 59 VrShell(JNIEnv* env, jobject obj, |
| 60 content::WebContents* main_contents, | 60 content::WebContents* main_contents, |
| 61 ui::WindowAndroid* content_window, | 61 ui::WindowAndroid* content_window, |
| 62 content::WebContents* ui_contents, | 62 content::WebContents* ui_contents, |
| 63 ui::WindowAndroid* ui_window, | 63 ui::WindowAndroid* ui_window, |
| 64 bool for_web_vr, | 64 bool for_web_vr, |
| 65 VrShellDelegate* delegate, | 65 VrShellDelegate* delegate, |
| 66 gvr_context* gvr_api); | 66 gvr_context* gvr_api, |
| 67 bool reprojected_rendering); |
| 67 | 68 |
| 68 void LoadUIContent(JNIEnv* env, | 69 void LoadUIContent(JNIEnv* env, |
| 69 const base::android::JavaParamRef<jobject>& obj); | 70 const base::android::JavaParamRef<jobject>& obj); |
| 70 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 71 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 71 void OnTriggerEvent(JNIEnv* env, | 72 void OnTriggerEvent(JNIEnv* env, |
| 72 const base::android::JavaParamRef<jobject>& obj); | 73 const base::android::JavaParamRef<jobject>& obj); |
| 73 void OnPause(JNIEnv* env, | 74 void OnPause(JNIEnv* env, |
| 74 const base::android::JavaParamRef<jobject>& obj); | 75 const base::android::JavaParamRef<jobject>& obj); |
| 75 void OnResume(JNIEnv* env, | 76 void OnResume(JNIEnv* env, |
| 76 const base::android::JavaParamRef<jobject>& obj); | 77 const base::android::JavaParamRef<jobject>& obj); |
| 78 void SetSurface(JNIEnv* env, |
| 79 const base::android::JavaParamRef<jobject>& obj, |
| 80 const base::android::JavaParamRef<jobject>& surface); |
| 77 void SetWebVrMode(JNIEnv* env, | 81 void SetWebVrMode(JNIEnv* env, |
| 78 const base::android::JavaParamRef<jobject>& obj, | 82 const base::android::JavaParamRef<jobject>& obj, |
| 79 bool enabled); | 83 bool enabled); |
| 80 | 84 |
| 81 void ContentWebContentsDestroyed(); | 85 void ContentWebContentsDestroyed(); |
| 82 // Called when our WebContents have been hidden. Usually a sign that something | 86 // Called when our WebContents have been hidden. Usually a sign that something |
| 83 // like another tab placed in front of it. | 87 // like another tab placed in front of it. |
| 84 void ContentWasHidden(); | 88 void ContentWasHidden(); |
| 85 | 89 |
| 86 // html/js UI hooks. | 90 // html/js UI hooks. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 155 |
| 152 VrShellDelegate* delegate_ = nullptr; | 156 VrShellDelegate* delegate_ = nullptr; |
| 153 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 157 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 154 | 158 |
| 155 std::unique_ptr<VrInputManager> content_input_manager_; | 159 std::unique_ptr<VrInputManager> content_input_manager_; |
| 156 std::unique_ptr<VrInputManager> ui_input_manager_; | 160 std::unique_ptr<VrInputManager> ui_input_manager_; |
| 157 std::unique_ptr<VrMetricsHelper> metrics_helper_; | 161 std::unique_ptr<VrMetricsHelper> metrics_helper_; |
| 158 | 162 |
| 159 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 163 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 160 std::unique_ptr<base::Thread> gl_thread_; | 164 std::unique_ptr<base::Thread> gl_thread_; |
| 165 bool reprojected_rendering_; |
| 161 | 166 |
| 162 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 167 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 163 | 168 |
| 164 DISALLOW_COPY_AND_ASSIGN(VrShell); | 169 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 165 }; | 170 }; |
| 166 | 171 |
| 167 bool RegisterVrShell(JNIEnv* env); | 172 bool RegisterVrShell(JNIEnv* env); |
| 168 | 173 |
| 169 } // namespace vr_shell | 174 } // namespace vr_shell |
| 170 | 175 |
| 171 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 176 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |