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

Unified Diff: third_party/WebKit/Source/modules/gamepad/Gamepad.cpp

Issue 2300883003: Added Hand attribute to Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gamepad_pose
Patch Set: Address haraken@'s feedback Created 4 years, 3 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: third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
diff --git a/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp b/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
index b0c16b7db7ea6b36fa8cc1a0ba5f4838e9d4deec..eb19c47c3772f6b095b6bc853eeb7f1a77cd7199 100644
--- a/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
+++ b/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
@@ -72,6 +72,23 @@ void Gamepad::setPose(const WebGamepadPose& pose)
m_pose->setPose(pose);
}
+void Gamepad::setHand(const WebGamepadHand& hand)
+{
+ switch (hand) {
+ case GamepadHandNone:
+ m_hand = "";
+ break;
+ case GamepadHandLeft:
+ m_hand = "left";
+ break;
+ case GamepadHandRight:
+ m_hand = "right";
+ break;
+ default:
+ NOTREACHED();
+ }
+}
+
DEFINE_TRACE(Gamepad)
{
visitor->trace(m_buttons);
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/Gamepad.h ('k') | third_party/WebKit/Source/modules/gamepad/Gamepad.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698