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

Unified Diff: device/vr/android/gvr/gvr_gamepad_data_fetcher.h

Issue 2351573002: Added support for GVR controllers (Closed)
Patch Set: Added appropriate Webkit dep to device/vr/BUILD.gn Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.cc ('k') | device/vr/android/gvr/gvr_gamepad_data_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/android/gvr/gvr_gamepad_data_fetcher.h
diff --git a/device/vr/android/gvr/gvr_gamepad_data_fetcher.h b/device/vr/android/gvr/gvr_gamepad_data_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..f4199d3c61624dfb2f35285b13e2281d3630340a
--- /dev/null
+++ b/device/vr/android/gvr/gvr_gamepad_data_fetcher.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_FETCHER_H_
+#define DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_FETCHER_H_
+
+#include <string>
+
+#include "device/gamepad/gamepad_data_fetcher.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_controller.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h"
+
+namespace device {
+
+class GvrDelegate;
+
+class GvrGamepadDataFetcher : public GamepadDataFetcher {
+ public:
+ class Factory : public GamepadDataFetcherFactory {
+ public:
+ Factory(GvrDelegate* delegate, unsigned int display_id);
+ ~Factory() override;
+ std::unique_ptr<GamepadDataFetcher> CreateDataFetcher() override;
+ GamepadSource source() override;
+
+ private:
+ GvrDelegate* delegate_;
+ unsigned int display_id_;
+ };
+
+ GvrGamepadDataFetcher(GvrDelegate* delegate, unsigned int display_id);
+ ~GvrGamepadDataFetcher() override;
+
+ GamepadSource source() override;
+
+ void GetGamepadData(bool devices_changed_hint) override;
+ void PauseHint(bool paused) override;
+ void OnAddedToProvider() override;
+
+ private:
+ std::unique_ptr<gvr::ControllerApi> controller_api_;
+ gvr::ControllerState controller_state_;
+ unsigned int display_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(GvrGamepadDataFetcher);
+};
+
+} // namespace device
+#endif // DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_FETCHER_H_
« no previous file with comments | « device/vr/android/gvr/gvr_device_provider.cc ('k') | device/vr/android/gvr/gvr_gamepad_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698