| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BROWSER_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_BROWSER_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_BROWSER_INTERFACE_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_BROWSER_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "chrome/browser/android/vr_shell/ui_interface.h" | 14 #include "chrome/browser/android/vr_shell/ui_interface.h" |
| 15 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" | 15 #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" |
| 16 #include "device/vr/vr_service.mojom.h" | 16 #include "device/vr/vr_service.mojom.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 class WebInputEvent; | 19 class WebInputEvent; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace vr_shell { | 22 namespace vr_shell { |
| 23 | 23 |
| 24 // An interface for communication with Vr Browser. Many of the functions in this | 24 // An interface for communication with Vr Browser. Many of the functions in this |
| 25 // interface are proxies to methods on VrShell. | 25 // interface are proxies to methods on VrShell. |
| 26 class VrBrowserInterface { | 26 class VrBrowserInterface { |
| 27 public: | 27 public: |
| 28 virtual ~VrBrowserInterface() = default; | 28 virtual ~VrBrowserInterface() {} |
| 29 | 29 |
| 30 virtual void ContentSurfaceChanged(jobject surface) = 0; | 30 virtual void ContentSurfaceChanged(jobject surface) = 0; |
| 31 virtual void GvrDelegateReady() = 0; | 31 virtual void GvrDelegateReady() = 0; |
| 32 virtual void UpdateGamepadData(device::GvrGamepadData) = 0; | 32 virtual void UpdateGamepadData(device::GvrGamepadData) = 0; |
| 33 virtual void AppButtonGesturePerformed(UiInterface::Direction direction) = 0; | 33 virtual void AppButtonGesturePerformed(UiInterface::Direction direction) = 0; |
| 34 virtual void AppButtonClicked() = 0; | 34 virtual void AppButtonClicked() = 0; |
| 35 virtual void ProcessContentGesture( | 35 virtual void ProcessContentGesture( |
| 36 std::unique_ptr<blink::WebInputEvent> event) = 0; | 36 std::unique_ptr<blink::WebInputEvent> event) = 0; |
| 37 virtual void ForceExitVr() = 0; | 37 virtual void ForceExitVr() = 0; |
| 38 virtual void ExitPresent() = 0; | |
| 39 virtual void RunVRDisplayInfoCallback( | 38 virtual void RunVRDisplayInfoCallback( |
| 40 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, | 39 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
| 41 device::mojom::VRDisplayInfoPtr* info) = 0; | 40 device::mojom::VRDisplayInfoPtr* info) = 0; |
| 42 virtual void OnContentPaused(bool enabled) = 0; | 41 virtual void OnContentPaused(bool enabled) = 0; |
| 43 virtual void NavigateBack() = 0; | 42 virtual void NavigateBack() = 0; |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 } // namespace vr_shell | 45 } // namespace vr_shell |
| 47 | 46 |
| 48 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_BROWSER_INTERFACE_H_ | 47 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_BROWSER_INTERFACE_H_ |
| OLD | NEW |