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

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: Added spec comment 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..da4bab80d07836afe2ea546a6013129f320e9a3b 100644
--- a/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
+++ b/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp
@@ -72,6 +72,21 @@ 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;
haraken 2016/09/19 23:55:13 Add default: NOTREACHED().
+ }
+}
+
DEFINE_TRACE(Gamepad)
{
visitor->trace(m_buttons);

Powered by Google App Engine
This is Rietveld 408576698