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

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 typo in GamepadProviderTest 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
« no previous file with comments | « content/shell/renderer/test_runner/gamepad_controller.cc ('k') | ppapi/shared_impl/ppb_gamepad_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c6f535d3d14ecb97f9455624f3a468afc66104f2 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;
+};
+
// 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
« no previous file with comments | « content/shell/renderer/test_runner/gamepad_controller.cc ('k') | ppapi/shared_impl/ppb_gamepad_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698