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

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

Issue 2879973002: Expose Gamepad API instance for Cardboard button (Closed)
Patch Set: fix crash in tests Created 3 years, 7 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/BUILD.gn ('k') | device/vr/android/gvr/cardboard_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/cardboard_gamepad_data_fetcher.h
diff --git a/device/vr/android/gvr/cardboard_gamepad_data_fetcher.h b/device/vr/android/gvr/cardboard_gamepad_data_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..0b6193faf8dd74e882606493a010230f443f2374
--- /dev/null
+++ b/device/vr/android/gvr/cardboard_gamepad_data_fetcher.h
@@ -0,0 +1,51 @@
+// Copyright 2017 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_CARDBOARD_GAMEPAD_DATA_FETCHER_H_
+#define DEVICE_VR_ANDROID_CARDBOARD_GAMEPAD_DATA_FETCHER_H_
+
+#include <string>
+
+#include "device/gamepad/gamepad_data_fetcher.h"
+#include "device/vr/android/gvr/cardboard_gamepad_data_provider.h"
+#include "device/vr/vr_export.h"
+
+namespace device {
+
+class DEVICE_VR_EXPORT CardboardGamepadDataFetcher : public GamepadDataFetcher {
+ public:
+ class Factory : public GamepadDataFetcherFactory {
+ public:
+ Factory(CardboardGamepadDataProvider*, unsigned int display_id);
+ ~Factory() override;
+ std::unique_ptr<GamepadDataFetcher> CreateDataFetcher() override;
+ GamepadSource source() override;
+
+ private:
+ CardboardGamepadDataProvider* data_provider_;
+ unsigned int display_id_;
+ };
+
+ CardboardGamepadDataFetcher(CardboardGamepadDataProvider*,
+ unsigned int display_id);
+ ~CardboardGamepadDataFetcher() override;
+
+ GamepadSource source() override;
+
+ void GetGamepadData(bool devices_changed_hint) override;
+ void PauseHint(bool paused) override;
+ void OnAddedToProvider() override;
+
+ // Called from CardboardGamepadDataProvider
+ void SetGamepadData(CardboardGamepadData);
+
+ private:
+ unsigned int display_id_;
+ CardboardGamepadData gamepad_data_;
+
+ DISALLOW_COPY_AND_ASSIGN(CardboardGamepadDataFetcher);
+};
+
+} // namespace device
+#endif // DEVICE_VR_ANDROID_CARDBOARD_GAMEPAD_DATA_FETCHER_H_
« no previous file with comments | « device/vr/BUILD.gn ('k') | device/vr/android/gvr/cardboard_gamepad_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698