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

Side by Side Diff: content/browser/gamepad/gamepad_platform_data_fetcher_android.h

Issue 165483003: Gamepad API for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated Created 6 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_ANDROID_H_
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_ANDROID_H_
7
8 #include <jni.h>
9
10 #include "base/android/jni_android.h"
11 #include "base/synchronization/lock.h"
12 #include "content/browser/gamepad/gamepad_data_fetcher.h"
13 #include "content/browser/gamepad/gamepad_standard_mappings.h"
14 #include "third_party/WebKit/public/platform/WebGamepads.h"
15
16 namespace content {
17
18 class GamepadPlatformDataFetcherAndroid : public GamepadDataFetcher {
19 public:
20 GamepadPlatformDataFetcherAndroid();
21 virtual ~GamepadPlatformDataFetcherAndroid();
22
23 // GamepadDataFetcher implementation.
24 virtual void GetGamepadData(blink::WebGamepads* pads,
25 bool devices_changed_hint) OVERRIDE;
26 virtual void PauseHint(bool paused);
27
28 // Called by GamepadAdapter (java).
29 void RefreshDevice(JNIEnv* env,
30 jobject obj,
31 int index,
32 bool connected,
33 jstring id,
34 jstring mapping,
35 long timestamp,
36 jfloatArray axes,
37 jfloatArray buttons);
38
39 static bool RegisterGamepadAdapter(JNIEnv* env);
40
41 private:
42 // Data to fetch into.
43 blink::WebGamepads* data_;
44
45 // The java GamepadAdapter object.
46 base::android::ScopedJavaLocalRef<jobject> j_gamepad_adapter_;
bulach 2014/03/05 12:34:39 this should be ScopedJavaGlobalRef instead of Loca
47
48 DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherAndroid);
49 };
50
51 }
bulach 2014/03/05 12:34:39 nit: // namespace content
52
53 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698