| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // The native instance of the Java VrShell. This class is not threadsafe and | 66 // The native instance of the Java VrShell. This class is not threadsafe and |
| 67 // must only be used on the UI thread. | 67 // must only be used on the UI thread. |
| 68 class VrShell : public device::PresentingGvrDelegate, | 68 class VrShell : public device::PresentingGvrDelegate, |
| 69 device::GvrGamepadDataProvider, | 69 device::GvrGamepadDataProvider, |
| 70 device::CardboardGamepadDataProvider { | 70 device::CardboardGamepadDataProvider { |
| 71 public: | 71 public: |
| 72 VrShell(JNIEnv* env, | 72 VrShell(JNIEnv* env, |
| 73 jobject obj, | 73 jobject obj, |
| 74 ui::WindowAndroid* window, | 74 ui::WindowAndroid* window, |
| 75 bool for_web_vr, | 75 bool for_web_vr, |
| 76 bool web_vr_autopresented, | 76 bool web_vr_autopresentation_expected, |
| 77 bool in_cct, | 77 bool in_cct, |
| 78 VrShellDelegate* delegate, | 78 VrShellDelegate* delegate, |
| 79 gvr_context* gvr_api, | 79 gvr_context* gvr_api, |
| 80 bool reprojected_rendering); | 80 bool reprojected_rendering); |
| 81 void SwapContents( | 81 void SwapContents( |
| 82 JNIEnv* env, | 82 JNIEnv* env, |
| 83 const base::android::JavaParamRef<jobject>& obj, | 83 const base::android::JavaParamRef<jobject>& obj, |
| 84 const base::android::JavaParamRef<jobject>& web_contents, | 84 const base::android::JavaParamRef<jobject>& web_contents, |
| 85 const base::android::JavaParamRef<jobject>& touch_event_synthesizer); | 85 const base::android::JavaParamRef<jobject>& touch_event_synthesizer); |
| 86 void LoadUIContent(JNIEnv* env, | 86 void LoadUIContent(JNIEnv* env, |
| 87 const base::android::JavaParamRef<jobject>& obj); | 87 const base::android::JavaParamRef<jobject>& obj); |
| 88 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 88 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 89 void OnTriggerEvent(JNIEnv* env, | 89 void OnTriggerEvent(JNIEnv* env, |
| 90 const base::android::JavaParamRef<jobject>& obj, | 90 const base::android::JavaParamRef<jobject>& obj, |
| 91 bool touched); | 91 bool touched); |
| 92 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 92 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 93 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 93 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 94 void SetSplashScreenIcon(JNIEnv* env, |
| 95 const base::android::JavaParamRef<jobject>& obj, |
| 96 const base::android::JavaParamRef<jobject>& bitmap); |
| 94 void SetSurface(JNIEnv* env, | 97 void SetSurface(JNIEnv* env, |
| 95 const base::android::JavaParamRef<jobject>& obj, | 98 const base::android::JavaParamRef<jobject>& obj, |
| 96 const base::android::JavaParamRef<jobject>& surface); | 99 const base::android::JavaParamRef<jobject>& surface); |
| 97 void SetWebVrMode(JNIEnv* env, | 100 void SetWebVrMode(JNIEnv* env, |
| 98 const base::android::JavaParamRef<jobject>& obj, | 101 const base::android::JavaParamRef<jobject>& obj, |
| 99 bool enabled, | 102 bool enabled); |
| 100 bool auto_presented); | |
| 101 bool GetWebVrMode(JNIEnv* env, | 103 bool GetWebVrMode(JNIEnv* env, |
| 102 const base::android::JavaParamRef<jobject>& obj); | 104 const base::android::JavaParamRef<jobject>& obj); |
| 103 void OnFullscreenChanged(bool enabled); | 105 void OnFullscreenChanged(bool enabled); |
| 104 void OnLoadProgressChanged(JNIEnv* env, | 106 void OnLoadProgressChanged(JNIEnv* env, |
| 105 const base::android::JavaParamRef<jobject>& obj, | 107 const base::android::JavaParamRef<jobject>& obj, |
| 106 double progress); | 108 double progress); |
| 107 void OnTabListCreated(JNIEnv* env, | 109 void OnTabListCreated(JNIEnv* env, |
| 108 const base::android::JavaParamRef<jobject>& obj, | 110 const base::android::JavaParamRef<jobject>& obj, |
| 109 jobjectArray tabs, | 111 jobjectArray tabs, |
| 110 jobjectArray incognito_tabs); | 112 jobjectArray incognito_tabs); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 262 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 261 | 263 |
| 262 DISALLOW_COPY_AND_ASSIGN(VrShell); | 264 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 263 }; | 265 }; |
| 264 | 266 |
| 265 bool RegisterVrShell(JNIEnv* env); | 267 bool RegisterVrShell(JNIEnv* env); |
| 266 | 268 |
| 267 } // namespace vr_shell | 269 } // namespace vr_shell |
| 268 | 270 |
| 269 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 271 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |