| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 jboolean can_go_forward); | 121 jboolean can_go_forward); |
| 122 | 122 |
| 123 void ContentWebContentsDestroyed(); | 123 void ContentWebContentsDestroyed(); |
| 124 // Called when our WebContents have been hidden. Usually a sign that something | 124 // Called when our WebContents have been hidden. Usually a sign that something |
| 125 // like another tab placed in front of it. | 125 // like another tab placed in front of it. |
| 126 void ContentWasHidden(); | 126 void ContentWasHidden(); |
| 127 void ContentWasShown(); | 127 void ContentWasShown(); |
| 128 | 128 |
| 129 void ContentSurfaceChanged(jobject surface); | 129 void ContentSurfaceChanged(jobject surface); |
| 130 void GvrDelegateReady(); | 130 void GvrDelegateReady(); |
| 131 void AppButtonGesturePerformed(UiInterface::Direction direction); | |
| 132 | 131 |
| 133 void ContentPhysicalBoundsChanged( | 132 void ContentPhysicalBoundsChanged( |
| 134 JNIEnv* env, | 133 JNIEnv* env, |
| 135 const base::android::JavaParamRef<jobject>& object, | 134 const base::android::JavaParamRef<jobject>& object, |
| 136 jint width, | 135 jint width, |
| 137 jint height, | 136 jint height, |
| 138 jfloat dpr); | 137 jfloat dpr); |
| 139 | 138 |
| 140 // Perform a UI action triggered by the javascript API. | 139 // Perform a UI action triggered by the javascript API. |
| 141 void DoUiAction(const UiAction action, | 140 void DoUiAction(const UiAction action, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 uint32_t device_id) override; | 175 uint32_t device_id) override; |
| 177 | 176 |
| 178 // device::PresentingGvrDelegate implementation. | 177 // device::PresentingGvrDelegate implementation. |
| 179 void SetSubmitClient( | 178 void SetSubmitClient( |
| 180 device::mojom::VRSubmitFrameClientPtr submit_client) override; | 179 device::mojom::VRSubmitFrameClientPtr submit_client) override; |
| 181 | 180 |
| 182 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); | 181 void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); |
| 183 | 182 |
| 184 bool vr_shell_enabled_; | 183 bool vr_shell_enabled_; |
| 185 | 184 |
| 186 std::unique_ptr<UiInterface> ui_; | |
| 187 bool content_paused_ = false; | 185 bool content_paused_ = false; |
| 188 bool webvr_mode_ = false; | 186 bool webvr_mode_ = false; |
| 189 | 187 |
| 190 content::WebContents* web_contents_ = nullptr; | 188 content::WebContents* web_contents_ = nullptr; |
| 191 base::android::ScopedJavaGlobalRef<jobject> j_motion_event_synthesizer_; | 189 base::android::ScopedJavaGlobalRef<jobject> j_motion_event_synthesizer_; |
| 192 ui::WindowAndroid* window_; | 190 ui::WindowAndroid* window_; |
| 193 std::unique_ptr<VrCompositor> compositor_; | 191 std::unique_ptr<VrCompositor> compositor_; |
| 194 | 192 |
| 195 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; | 193 std::unique_ptr<VrWebContentsObserver> vr_web_contents_observer_; |
| 196 | 194 |
| 197 VrShellDelegate* delegate_provider_ = nullptr; | 195 VrShellDelegate* delegate_provider_ = nullptr; |
| 198 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; | 196 base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_; |
| 199 | 197 |
| 200 std::unique_ptr<VrInputManager> input_manager_; | 198 std::unique_ptr<VrInputManager> input_manager_; |
| 201 std::unique_ptr<AndroidUiGestureTarget> android_ui_gesture_target_; | 199 std::unique_ptr<AndroidUiGestureTarget> android_ui_gesture_target_; |
| 202 std::unique_ptr<VrMetricsHelper> metrics_helper_; | 200 std::unique_ptr<VrMetricsHelper> metrics_helper_; |
| 203 | 201 |
| 204 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 202 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 205 std::unique_ptr<VrGLThread> gl_thread_; | 203 std::unique_ptr<VrGLThread> gl_thread_; |
| 204 UiInterface* ui_; |
| 206 bool reprojected_rendering_; | 205 bool reprojected_rendering_; |
| 207 | 206 |
| 208 jobject content_surface_ = nullptr; | 207 jobject content_surface_ = nullptr; |
| 209 | 208 |
| 210 // TODO(mthiesse): Remove the need for this to be stored here. | 209 // TODO(mthiesse): Remove the need for this to be stored here. |
| 211 // crbug.com/674594 | 210 // crbug.com/674594 |
| 212 gvr_context* gvr_api_; | 211 gvr_context* gvr_api_; |
| 213 | 212 |
| 214 // Are we currently providing a gamepad factory to the gamepad manager? | 213 // Are we currently providing a gamepad factory to the gamepad manager? |
| 215 bool gamepad_source_active_ = false; | 214 bool gamepad_source_active_ = false; |
| 216 // Registered fetcher, must remain alive for UpdateGamepadData calls. | 215 // Registered fetcher, must remain alive for UpdateGamepadData calls. |
| 217 // That's ok since the fetcher is only destroyed from VrShell's destructor. | 216 // That's ok since the fetcher is only destroyed from VrShell's destructor. |
| 218 device::GvrGamepadDataFetcher* gamepad_data_fetcher_ = nullptr; | 217 device::GvrGamepadDataFetcher* gamepad_data_fetcher_ = nullptr; |
| 219 | 218 |
| 220 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 219 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 221 | 220 |
| 222 DISALLOW_COPY_AND_ASSIGN(VrShell); | 221 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 223 }; | 222 }; |
| 224 | 223 |
| 225 bool RegisterVrShell(JNIEnv* env); | 224 bool RegisterVrShell(JNIEnv* env); |
| 226 | 225 |
| 227 } // namespace vr_shell | 226 } // namespace vr_shell |
| 228 | 227 |
| 229 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 228 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |