| 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 20 matching lines...) Expand all Loading... |
| 31 namespace content { | 31 namespace content { |
| 32 class WebContents; | 32 class WebContents; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace ui { | 35 namespace ui { |
| 36 class WindowAndroid; | 36 class WindowAndroid; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace vr_shell { | 39 namespace vr_shell { |
| 40 | 40 |
| 41 class AndroidUiGestureTarget; |
| 41 class UiInterface; | 42 class UiInterface; |
| 42 class VrCompositor; | 43 class VrCompositor; |
| 43 class VrGLThread; | 44 class VrGLThread; |
| 44 class VrInputManager; | 45 class VrInputManager; |
| 45 class VrMetricsHelper; | 46 class VrMetricsHelper; |
| 46 class VrShellDelegate; | 47 class VrShellDelegate; |
| 47 class VrWebContentsObserver; | 48 class VrWebContentsObserver; |
| 48 | 49 |
| 49 enum UiAction { | 50 enum UiAction { |
| 50 HISTORY_BACK = 0, | 51 HISTORY_BACK = 0, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 67 public: | 68 public: |
| 68 VrShell(JNIEnv* env, | 69 VrShell(JNIEnv* env, |
| 69 jobject obj, | 70 jobject obj, |
| 70 ui::WindowAndroid* content_window, | 71 ui::WindowAndroid* content_window, |
| 71 content::WebContents* ui_contents, | 72 content::WebContents* ui_contents, |
| 72 ui::WindowAndroid* ui_window, | 73 ui::WindowAndroid* ui_window, |
| 73 bool for_web_vr, | 74 bool for_web_vr, |
| 74 VrShellDelegate* delegate, | 75 VrShellDelegate* delegate, |
| 75 gvr_context* gvr_api, | 76 gvr_context* gvr_api, |
| 76 bool reprojected_rendering); | 77 bool reprojected_rendering); |
| 77 void SwapContents(JNIEnv* env, | 78 void SwapContents( |
| 78 const base::android::JavaParamRef<jobject>& obj, | 79 JNIEnv* env, |
| 79 const base::android::JavaParamRef<jobject>& web_contents); | 80 const base::android::JavaParamRef<jobject>& obj, |
| 81 const base::android::JavaParamRef<jobject>& web_contents, |
| 82 const base::android::JavaParamRef<jobject>& touch_event_synthesizer); |
| 80 void LoadUIContent(JNIEnv* env, | 83 void LoadUIContent(JNIEnv* env, |
| 81 const base::android::JavaParamRef<jobject>& obj); | 84 const base::android::JavaParamRef<jobject>& obj); |
| 82 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 85 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 83 void OnTriggerEvent(JNIEnv* env, | 86 void OnTriggerEvent(JNIEnv* env, |
| 84 const base::android::JavaParamRef<jobject>& obj); | 87 const base::android::JavaParamRef<jobject>& obj); |
| 85 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 88 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 86 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 89 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 87 void SetSurface(JNIEnv* env, | 90 void SetSurface(JNIEnv* env, |
| 88 const base::android::JavaParamRef<jobject>& obj, | 91 const base::android::JavaParamRef<jobject>& obj, |
| 89 const base::android::JavaParamRef<jobject>& surface); | 92 const base::android::JavaParamRef<jobject>& surface); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 200 |
| 198 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); | 201 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); |
| 199 | 202 |
| 200 bool vr_shell_enabled_; | 203 bool vr_shell_enabled_; |
| 201 | 204 |
| 202 std::unique_ptr<UiInterface> html_interface_; | 205 std::unique_ptr<UiInterface> html_interface_; |
| 203 bool content_paused_ = false; | 206 bool content_paused_ = false; |
| 204 bool webvr_mode_ = false; | 207 bool webvr_mode_ = false; |
| 205 | 208 |
| 206 content::WebContents* main_contents_ = nullptr; | 209 content::WebContents* main_contents_ = nullptr; |
| 210 base::android::ScopedJavaGlobalRef<jobject> j_motion_event_synthesizer_; |
| 207 ui::WindowAndroid* content_window_; | 211 ui::WindowAndroid* content_window_; |
| 208 std::unique_ptr<VrCompositor> content_compositor_; | 212 std::unique_ptr<VrCompositor> content_compositor_; |
| 209 content::WebContents* ui_contents_; | 213 content::WebContents* ui_contents_; |
| 210 std::unique_ptr<VrCompositor> ui_compositor_; | 214 std::unique_ptr<VrCompositor> ui_compositor_; |
| 211 | 215 |
| 212 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; | 216 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; |
| 213 | 217 |
| 214 VrShellDelegate* delegate_provider_ = nullptr; | 218 VrShellDelegate* delegate_provider_ = nullptr; |
| 215 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 219 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 216 | 220 |
| 217 std::unique_ptr<VrInputManager> content_input_manager_; | 221 std::unique_ptr<VrInputManager> content_input_manager_; |
| 222 std::unique_ptr<AndroidUiGestureTarget> android_ui_gesture_target_; |
| 218 std::unique_ptr<VrInputManager> ui_input_manager_; | 223 std::unique_ptr<VrInputManager> ui_input_manager_; |
| 219 std::unique_ptr<VrMetricsHelper> metrics_helper_; | 224 std::unique_ptr<VrMetricsHelper> metrics_helper_; |
| 220 | 225 |
| 221 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 226 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 222 std::unique_ptr<VrGLThread> gl_thread_; | 227 std::unique_ptr<VrGLThread> gl_thread_; |
| 223 bool reprojected_rendering_; | 228 bool reprojected_rendering_; |
| 224 | 229 |
| 225 jobject content_surface_ = nullptr; | 230 jobject content_surface_ = nullptr; |
| 226 | 231 |
| 227 // TODO(mthiesse): Remove the need for this to be stored here. | 232 // TODO(mthiesse): Remove the need for this to be stored here. |
| 228 // crbug.com/674594 | 233 // crbug.com/674594 |
| 229 gvr_context* gvr_api_; | 234 gvr_context* gvr_api_; |
| 230 | 235 |
| 231 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 236 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 232 | 237 |
| 233 DISALLOW_COPY_AND_ASSIGN(VrShell); | 238 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 234 }; | 239 }; |
| 235 | 240 |
| 236 bool RegisterVrShell(JNIEnv* env); | 241 bool RegisterVrShell(JNIEnv* env); |
| 237 | 242 |
| 238 } // namespace vr_shell | 243 } // namespace vr_shell |
| 239 | 244 |
| 240 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 245 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |