Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.h

Issue 2434013002: Implement a means of letting native VR Shell control the HTML UI. (Closed)
Patch Set: Remove use of cr.define() Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 namespace content { 21 namespace content {
22 class WebContents; 22 class WebContents;
23 } 23 }
24 24
25 namespace ui { 25 namespace ui {
26 class WindowAndroid; 26 class WindowAndroid;
27 } 27 }
28 28
29 namespace vr_shell { 29 namespace vr_shell {
30 30
31 class UiInterface;
31 class UiScene; 32 class UiScene;
32 class VrCompositor; 33 class VrCompositor;
33 class VrController; 34 class VrController;
34 class VrInputManager; 35 class VrInputManager;
35 class VrShellDelegate; 36 class VrShellDelegate;
36 class VrShellRenderer; 37 class VrShellRenderer;
37 struct ContentRectangle; 38 struct ContentRectangle;
38 struct VrGesture; 39 struct VrGesture;
39 40
40 enum UiAction { 41 enum UiAction {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 73 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
73 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 74 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
74 void SetWebVrMode(JNIEnv* env, 75 void SetWebVrMode(JNIEnv* env,
75 const base::android::JavaParamRef<jobject>& obj, 76 const base::android::JavaParamRef<jobject>& obj,
76 bool enabled); 77 bool enabled);
77 78
78 // html/js UI hooks. 79 // html/js UI hooks.
79 static base::WeakPtr<VrShell> GetWeakPtr( 80 static base::WeakPtr<VrShell> GetWeakPtr(
80 const content::WebContents* web_contents); 81 const content::WebContents* web_contents);
81 UiScene* GetScene(); 82 UiScene* GetScene();
83 UiInterface* GetUiInterface();
82 void OnDomContentsLoaded(); 84 void OnDomContentsLoaded();
83 85
84 // device::GvrDelegate implementation 86 // device::GvrDelegate implementation
85 void SetWebVRSecureOrigin(bool secure_origin) override; 87 void SetWebVRSecureOrigin(bool secure_origin) override;
86 void SubmitWebVRFrame() override; 88 void SubmitWebVRFrame() override;
87 void UpdateWebVRTextureBounds( 89 void UpdateWebVRTextureBounds(
88 int eye, float left, float top, float width, float height) override; 90 int eye, float left, float top, float width, float height) override;
89 gvr::GvrApi* gvr_api() override; 91 gvr::GvrApi* gvr_api() override;
90 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override; 92 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num) override;
91 93
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 136
135 // samplerExternalOES texture data for UI content image. 137 // samplerExternalOES texture data for UI content image.
136 jint ui_texture_id_ = 0; 138 jint ui_texture_id_ = 0;
137 // samplerExternalOES texture data for main content image. 139 // samplerExternalOES texture data for main content image.
138 jint content_texture_id_ = 0; 140 jint content_texture_id_ = 0;
139 141
140 float desktop_screen_tilt_; 142 float desktop_screen_tilt_;
141 float desktop_height_; 143 float desktop_height_;
142 144
143 std::unique_ptr<UiScene> scene_; 145 std::unique_ptr<UiScene> scene_;
146 std::unique_ptr<UiInterface> html_interface_;
144 147
145 std::unique_ptr<gvr::GvrApi> gvr_api_; 148 std::unique_ptr<gvr::GvrApi> gvr_api_;
146 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_; 149 std::unique_ptr<gvr::BufferViewportList> buffer_viewport_list_;
147 std::unique_ptr<gvr::BufferViewport> buffer_viewport_; 150 std::unique_ptr<gvr::BufferViewport> buffer_viewport_;
148 std::unique_ptr<gvr::SwapChain> swap_chain_; 151 std::unique_ptr<gvr::SwapChain> swap_chain_;
149 152
150 gvr::Sizei render_size_; 153 gvr::Sizei render_size_;
151 154
152 std::queue<base::Callback<void()>> task_queue_; 155 std::queue<base::Callback<void()>> task_queue_;
153 base::Lock task_queue_lock_; 156 base::Lock task_queue_lock_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 base::WeakPtrFactory<VrShell> weak_ptr_factory_; 189 base::WeakPtrFactory<VrShell> weak_ptr_factory_;
187 190
188 DISALLOW_COPY_AND_ASSIGN(VrShell); 191 DISALLOW_COPY_AND_ASSIGN(VrShell);
189 }; 192 };
190 193
191 bool RegisterVrShell(JNIEnv* env); 194 bool RegisterVrShell(JNIEnv* env);
192 195
193 } // namespace vr_shell 196 } // namespace vr_shell
194 197
195 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ 198 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/ui_interface.cc ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698