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

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: incorporated comments 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);
jdduke (slow) 2014/03/07 23:16:39 OVERRIDE?
kbalazs 2014/03/12 00:17:36 Done.
27
28 // Called by GamepadAdapter (java).
29 void RefreshDevice(JNIEnv* env,
jdduke (slow) 2014/03/07 23:16:39 See .cc comments about how this function can be ma
kbalazs 2014/03/12 00:17:36 I think the jni generator only supports methods so
jdduke (slow) 2014/03/12 01:06:18 ViewConfiguration https://code.google.com/p/chromi
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_;
jdduke (slow) 2014/03/07 23:16:39 I'm not sure we need to hold on to this reference.
kbalazs 2014/03/12 00:17:36 I kept it as I think it makes more sense than pass
jdduke (slow) 2014/03/12 01:06:18 Except, we're not passing "back and forth" as much
44
45 // The java GamepadAdapter object.
46 base::android::ScopedJavaGlobalRef<jobject> j_gamepad_adapter_;
jdduke (slow) 2014/03/07 23:16:39 I'm not sure we need this either. The call into t
kbalazs 2014/03/12 00:17:36 Done.
47
48 DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherAndroid);
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_DATA_FETCHER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698