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

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

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

Powered by Google App Engine
This is Rietveld 408576698