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

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

Issue 2351573002: Added support for GVR controllers (Closed)
Patch Set: Remove LOG, make string length adjustment suggested by Michael 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
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..6514a8200f7f01aa15b330e784e1b70239b3a556
--- /dev/null
+++ b/device/vr/android/gvr/gvr_gamepad_data_fetcher.h
@@ -0,0 +1,48 @@
+// 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);
+ ~Factory() override;
+ std::unique_ptr<GamepadDataFetcher> CreateDataFetcher() override;
+ GamepadSource source() override;
+
+ private:
+ GvrDelegate* delegate_;
+ };
+
+ GvrGamepadDataFetcher(GvrDelegate* delegate);
+ ~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_;
+
+ DISALLOW_COPY_AND_ASSIGN(GvrGamepadDataFetcher);
+};
+
+} // namespace device
+#endif // DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_FETCHER_H_

Powered by Google App Engine
This is Rietveld 408576698