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

Unified Diff: ppapi/shared_impl/ppb_gamepad_shared.h

Issue 165983005: Updating Gamepad API to match latest spec (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit tests Created 6 years, 10 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: ppapi/shared_impl/ppb_gamepad_shared.h
diff --git a/ppapi/shared_impl/ppb_gamepad_shared.h b/ppapi/shared_impl/ppb_gamepad_shared.h
index 7bc1e6102e19c9f524899b140704f83fbee28d7c..ddeaf98e3510fd211357f3490b81a72bb150cf59 100644
--- a/ppapi/shared_impl/ppb_gamepad_shared.h
+++ b/ppapi/shared_impl/ppb_gamepad_shared.h
@@ -17,10 +17,16 @@ namespace ppapi {
#pragma pack(push, 1)
+struct WebKitGamepadButton {
+ bool pressed;
+ float value;
bbudge 2014/02/24 23:11:06 nit: indent should be 2 spaces
+};
+
// This must match the definition of blink::Gamepad. The GamepadHost unit test
// has some compile asserts to validate this.
struct WebKitGamepad {
static const size_t kIdLengthCap = 128;
+ static const size_t kMappingLengthCap = 16;
static const size_t kAxesLengthCap = 16;
static const size_t kButtonsLengthCap = 32;
@@ -44,7 +50,10 @@ struct WebKitGamepad {
unsigned buttons_length;
// Normalized values representing buttons, in the range [0..1].
- float buttons[kButtonsLengthCap];
+ WebKitGamepadButton buttons[kButtonsLengthCap];
+
+ // Mapping type (for example "standard")
+ base::char16 mapping[kMappingLengthCap];
};
// This must match the definition of blink::Gamepads. The GamepadHost unit

Powered by Google App Engine
This is Rietveld 408576698