| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Perform a UI action triggered by the javascript API. | 117 // Perform a UI action triggered by the javascript API. |
| 118 void DoUiAction(const UiAction action); | 118 void DoUiAction(const UiAction action); |
| 119 | 119 |
| 120 void SetContentCssSize(float width, float height, float dpr); | 120 void SetContentCssSize(float width, float height, float dpr); |
| 121 void SetUiCssSize(float width, float height, float dpr); | 121 void SetUiCssSize(float width, float height, float dpr); |
| 122 | 122 |
| 123 void ContentFrameWasResized(bool width_changed); | 123 void ContentFrameWasResized(bool width_changed); |
| 124 | 124 |
| 125 void ForceExitVr(); | 125 void ForceExitVr(); |
| 126 | 126 |
| 127 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat, | 127 static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); |
| 128 uint32_t pose_index); | |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 virtual ~VrShell(); | 130 virtual ~VrShell(); |
| 132 void SetIsInVR(bool is_in_vr); | 131 void SetIsInVR(bool is_in_vr); |
| 133 void PostToGlThreadWhenReady(const base::Closure& task); | 132 void PostToGlThreadWhenReady(const base::Closure& task); |
| 134 | 133 |
| 135 // content::WebContentsObserver implementation. | 134 // content::WebContentsObserver implementation. |
| 136 void RenderViewHostChanged(content::RenderViewHost* old_host, | 135 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 137 content::RenderViewHost* new_host) override; | 136 content::RenderViewHost* new_host) override; |
| 138 void MainFrameWasResized(bool width_changed) override; | 137 void MainFrameWasResized(bool width_changed) override; |
| 139 void WebContentsDestroyed() override; | 138 void WebContentsDestroyed() override; |
| 140 | 139 |
| 141 // device::GvrDelegate implementation | 140 // device::GvrDelegate implementation |
| 142 void SetWebVRSecureOrigin(bool secure_origin) override; | 141 void SetWebVRSecureOrigin(bool secure_origin) override; |
| 143 void SubmitWebVRFrame() override; | 142 void SubmitWebVRFrame() override; |
| 144 void UpdateWebVRTextureBounds(const gvr::Rectf& left_bounds, | 143 void UpdateWebVRTextureBounds(int16_t frame_index, |
| 144 const gvr::Rectf& left_bounds, |
| 145 const gvr::Rectf& right_bounds) override; | 145 const gvr::Rectf& right_bounds) override; |
| 146 gvr::GvrApi* gvr_api() override; | 146 gvr::GvrApi* gvr_api() override; |
| 147 void SetWebVRRenderSurfaceSize(int width, int height) override; | 147 void SetWebVRRenderSurfaceSize(int width, int height) override; |
| 148 gvr::Sizei GetWebVRCompositorSurfaceSize() override; | 148 gvr::Sizei GetWebVRCompositorSurfaceSize() override; |
| 149 void OnVRVsyncProviderRequest( | 149 void OnVRVsyncProviderRequest( |
| 150 device::mojom::VRVSyncProviderRequest request) override; | 150 device::mojom::VRVSyncProviderRequest request) override; |
| 151 void UpdateVSyncInterval(long timebase_nanos, | 151 void UpdateVSyncInterval(long timebase_nanos, |
| 152 double interval_seconds) override; | 152 double interval_seconds) override; |
| 153 | 153 |
| 154 std::unique_ptr<UiInterface> html_interface_; | 154 std::unique_ptr<UiInterface> html_interface_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 174 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 174 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(VrShell); | 176 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 bool RegisterVrShell(JNIEnv* env); | 179 bool RegisterVrShell(JNIEnv* env); |
| 180 | 180 |
| 181 } // namespace vr_shell | 181 } // namespace vr_shell |
| 182 | 182 |
| 183 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 183 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |