Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell.h |
| diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h |
| index da83a6a714deeb035a04e90d60d2478b2089d0d4..0b3a2795abe04c20c8349497c44c87b36907fee7 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell.h |
| +++ b/chrome/browser/android/vr_shell/vr_shell.h |
| @@ -17,6 +17,7 @@ |
| #include "chrome/browser/android/vr_shell/ui_interface.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "device/vr/android/gvr/gvr_delegate.h" |
| +#include "device/vr/android/gvr/gvr_gamepad_data_provider.h" |
| #include "device/vr/vr_service.mojom.h" |
| #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h" |
| #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" |
| @@ -71,7 +72,9 @@ class VrMetricsHelper; |
| // The native instance of the Java VrShell. This class is not threadsafe and |
| // must only be used on the UI thread. |
| -class VrShell : public device::GvrDelegate, content::WebContentsObserver { |
| +class VrShell : public device::GvrDelegate, |
| + content::WebContentsObserver, |
| + device::GvrGamepadDataProvider { |
| public: |
| VrShell(JNIEnv* env, |
| jobject obj, |
| @@ -175,6 +178,10 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver { |
| void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); |
| void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); |
| + // device::GvrGamepadDataProvider implementation. |
| + void UpdateGamepadData(device::GvrGamepadData) override; |
| + void RegisterGamepadDataFetcher(device::GvrGamepadDataFetcher*); |
|
mthiesse
2017/03/22 22:30:47
Add a comment that this DataFetcher* must outlive
klausw
2017/03/22 22:53:25
Done, added some more detailed lifecycle comments
|
| + |
| // TODO(mthiesse): Find a better place for these functions to live. |
| static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); |
| static gvr::Sizei GetRecommendedWebVrSize(gvr::GvrApi* gvr_api); |
| @@ -248,6 +255,10 @@ class VrShell : public device::GvrDelegate, content::WebContentsObserver { |
| // crbug.com/674594 |
| gvr_context* gvr_api_; |
| + // Are we currently providing a gamepad factory to the gamepad manager? |
| + bool gamepad_source_active_ = false; |
| + device::GvrGamepadDataFetcher* gamepad_data_fetcher_ = nullptr; |
| + |
| base::WeakPtrFactory<VrShell> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(VrShell); |