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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 class WebInputEvent; | 28 class WebInputEvent; |
29 } | 29 } |
30 | 30 |
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 ViewRoot; |
37 } | 37 } |
38 | 38 |
39 namespace vr_shell { | 39 namespace vr_shell { |
40 | 40 |
41 class UiInterface; | 41 class UiInterface; |
42 class VrCompositor; | 42 class VrCompositor; |
43 class VrGLThread; | 43 class VrGLThread; |
44 class VrInputManager; | 44 class VrInputManager; |
45 class VrMetricsHelper; | 45 class VrMetricsHelper; |
46 class VrShellDelegate; | 46 class VrShellDelegate; |
(...skipping 10 matching lines...) Expand all Loading... |
57 OMNIBOX_CONTENT, | 57 OMNIBOX_CONTENT, |
58 SET_CONTENT_PAUSED, | 58 SET_CONTENT_PAUSED, |
59 }; | 59 }; |
60 | 60 |
61 class VrMetricsHelper; | 61 class VrMetricsHelper; |
62 | 62 |
63 // The native instance of the Java VrShell. This class is not threadsafe and | 63 // The native instance of the Java VrShell. This class is not threadsafe and |
64 // must only be used on the UI thread. | 64 // must only be used on the UI thread. |
65 class VrShell : public device::GvrDelegate, content::WebContentsObserver { | 65 class VrShell : public device::GvrDelegate, content::WebContentsObserver { |
66 public: | 66 public: |
67 VrShell(JNIEnv* env, jobject obj, | 67 VrShell(JNIEnv* env, |
68 ui::WindowAndroid* content_window, | 68 jobject obj, |
| 69 ui::ViewRoot* content_view_root, |
69 content::WebContents* ui_contents, | 70 content::WebContents* ui_contents, |
70 ui::WindowAndroid* ui_window, | 71 ui::ViewRoot* ui_view_root, |
71 bool for_web_vr, | 72 bool for_web_vr, |
72 VrShellDelegate* delegate, | 73 VrShellDelegate* delegate, |
73 gvr_context* gvr_api, | 74 gvr_context* gvr_api, |
74 bool reprojected_rendering); | 75 bool reprojected_rendering); |
75 void SwapContents(JNIEnv* env, | 76 void SwapContents(JNIEnv* env, |
76 const base::android::JavaParamRef<jobject>& obj, | 77 const base::android::JavaParamRef<jobject>& obj, |
77 const base::android::JavaParamRef<jobject>& web_contents); | 78 const base::android::JavaParamRef<jobject>& web_contents); |
78 void LoadUIContent(JNIEnv* env, | 79 void LoadUIContent(JNIEnv* env, |
79 const base::android::JavaParamRef<jobject>& obj); | 80 const base::android::JavaParamRef<jobject>& obj); |
80 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 81 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 190 |
190 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); | 191 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); |
191 | 192 |
192 bool vr_shell_enabled_; | 193 bool vr_shell_enabled_; |
193 | 194 |
194 std::unique_ptr<UiInterface> html_interface_; | 195 std::unique_ptr<UiInterface> html_interface_; |
195 bool content_paused_ = false; | 196 bool content_paused_ = false; |
196 bool webvr_mode_ = false; | 197 bool webvr_mode_ = false; |
197 | 198 |
198 content::WebContents* main_contents_ = nullptr; | 199 content::WebContents* main_contents_ = nullptr; |
199 ui::WindowAndroid* content_window_; | 200 ui::ViewRoot* content_view_root_; |
200 std::unique_ptr<VrCompositor> content_compositor_; | 201 std::unique_ptr<VrCompositor> content_compositor_; |
201 content::WebContents* ui_contents_; | 202 content::WebContents* ui_contents_; |
202 std::unique_ptr<VrCompositor> ui_compositor_; | 203 std::unique_ptr<VrCompositor> ui_compositor_; |
203 | 204 |
204 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; | 205 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; |
205 | 206 |
206 VrShellDelegate* delegate_provider_ = nullptr; | 207 VrShellDelegate* delegate_provider_ = nullptr; |
207 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 208 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
208 | 209 |
209 std::unique_ptr<VrInputManager> content_input_manager_; | 210 std::unique_ptr<VrInputManager> content_input_manager_; |
(...skipping 13 matching lines...) Expand all Loading... |
223 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 224 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
224 | 225 |
225 DISALLOW_COPY_AND_ASSIGN(VrShell); | 226 DISALLOW_COPY_AND_ASSIGN(VrShell); |
226 }; | 227 }; |
227 | 228 |
228 bool RegisterVrShell(JNIEnv* env); | 229 bool RegisterVrShell(JNIEnv* env); |
229 | 230 |
230 } // namespace vr_shell | 231 } // namespace vr_shell |
231 | 232 |
232 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 233 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
OLD | NEW |