| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // The native instance of the Java VrShell. This class is not threadsafe and | 61 // The native instance of the Java VrShell. This class is not threadsafe and |
| 62 // must only be used on the UI thread. | 62 // must only be used on the UI thread. |
| 63 class VrShell : public device::GvrDelegate, | 63 class VrShell : public device::GvrDelegate, |
| 64 device::GvrGamepadDataProvider, | 64 device::GvrGamepadDataProvider, |
| 65 device::CardboardGamepadDataProvider { | 65 device::CardboardGamepadDataProvider { |
| 66 public: | 66 public: |
| 67 VrShell(JNIEnv* env, | 67 VrShell(JNIEnv* env, |
| 68 jobject obj, | 68 jobject obj, |
| 69 ui::WindowAndroid* window, | 69 ui::WindowAndroid* window, |
| 70 bool for_web_vr, | 70 bool for_web_vr, |
| 71 bool web_vr_autopresented, | 71 bool web_vr_autopresentation_expected, |
| 72 bool in_cct, | 72 bool in_cct, |
| 73 VrShellDelegate* delegate, | 73 VrShellDelegate* delegate, |
| 74 gvr_context* gvr_api, | 74 gvr_context* gvr_api, |
| 75 bool reprojected_rendering); | 75 bool reprojected_rendering); |
| 76 void SwapContents( | 76 void SwapContents( |
| 77 JNIEnv* env, | 77 JNIEnv* env, |
| 78 const base::android::JavaParamRef<jobject>& obj, | 78 const base::android::JavaParamRef<jobject>& obj, |
| 79 const base::android::JavaParamRef<jobject>& web_contents, | 79 const base::android::JavaParamRef<jobject>& web_contents, |
| 80 const base::android::JavaParamRef<jobject>& touch_event_synthesizer); | 80 const base::android::JavaParamRef<jobject>& touch_event_synthesizer); |
| 81 void LoadUIContent(JNIEnv* env, | 81 void LoadUIContent(JNIEnv* env, |
| 82 const base::android::JavaParamRef<jobject>& obj); | 82 const base::android::JavaParamRef<jobject>& obj); |
| 83 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 83 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 84 void OnTriggerEvent(JNIEnv* env, | 84 void OnTriggerEvent(JNIEnv* env, |
| 85 const base::android::JavaParamRef<jobject>& obj, | 85 const base::android::JavaParamRef<jobject>& obj, |
| 86 bool touched); | 86 bool touched); |
| 87 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 87 void OnPause(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 88 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 88 void OnResume(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 89 void SetSplashScreenIcon(JNIEnv* env, |
| 90 const base::android::JavaParamRef<jobject>& obj, |
| 91 const base::android::JavaParamRef<jobject>& bitmap); |
| 89 void SetSurface(JNIEnv* env, | 92 void SetSurface(JNIEnv* env, |
| 90 const base::android::JavaParamRef<jobject>& obj, | 93 const base::android::JavaParamRef<jobject>& obj, |
| 91 const base::android::JavaParamRef<jobject>& surface); | 94 const base::android::JavaParamRef<jobject>& surface); |
| 92 void SetWebVrMode(JNIEnv* env, | 95 void SetWebVrMode(JNIEnv* env, |
| 93 const base::android::JavaParamRef<jobject>& obj, | 96 const base::android::JavaParamRef<jobject>& obj, |
| 94 bool enabled, | 97 bool enabled, |
| 95 bool auto_presented, | |
| 96 bool show_toast); | 98 bool show_toast); |
| 97 bool GetWebVrMode(JNIEnv* env, | 99 bool GetWebVrMode(JNIEnv* env, |
| 98 const base::android::JavaParamRef<jobject>& obj); | 100 const base::android::JavaParamRef<jobject>& obj); |
| 99 void OnFullscreenChanged(bool enabled); | 101 void OnFullscreenChanged(bool enabled); |
| 100 void OnLoadProgressChanged(JNIEnv* env, | 102 void OnLoadProgressChanged(JNIEnv* env, |
| 101 const base::android::JavaParamRef<jobject>& obj, | 103 const base::android::JavaParamRef<jobject>& obj, |
| 102 double progress); | 104 double progress); |
| 103 void OnTabListCreated(JNIEnv* env, | 105 void OnTabListCreated(JNIEnv* env, |
| 104 const base::android::JavaParamRef<jobject>& obj, | 106 const base::android::JavaParamRef<jobject>& obj, |
| 105 jobjectArray tabs, | 107 jobjectArray tabs, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 base::WeakPtrFactory<VrShell> weak_ptr_factory_; | 245 base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| 244 | 246 |
| 245 DISALLOW_COPY_AND_ASSIGN(VrShell); | 247 DISALLOW_COPY_AND_ASSIGN(VrShell); |
| 246 }; | 248 }; |
| 247 | 249 |
| 248 bool RegisterVrShell(JNIEnv* env); | 250 bool RegisterVrShell(JNIEnv* env); |
| 249 | 251 |
| 250 } // namespace vr_shell | 252 } // namespace vr_shell |
| 251 | 253 |
| 252 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ | 254 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_H_ |
| OLD | NEW |