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

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

Issue 806993002: Removed deprecated navigator.webkitGetGamepads. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed one layout test expectations update Created 6 years 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 | « Source/modules/gamepad/Gamepad.h ('k') | Source/modules/gamepad/GamepadCommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/Gamepad.cpp
diff --git a/Source/modules/gamepad/Gamepad.cpp b/Source/modules/gamepad/Gamepad.cpp
index 05c65dcb8e8d33024f0d58ed8c6ad2e4c102d5a4..7f85cbb775f5f2895b663784e5e31e3ae5d390fe 100644
--- a/Source/modules/gamepad/Gamepad.cpp
+++ b/Source/modules/gamepad/Gamepad.cpp
@@ -29,6 +29,8 @@
namespace blink {
Gamepad::Gamepad()
+ : m_index(0)
+ , m_timestamp(0)
{
}
@@ -36,6 +38,13 @@ Gamepad::~Gamepad()
{
}
+void Gamepad::setAxes(unsigned count, const double* data)
+{
+ m_axes.resize(count);
+ if (count)
+ std::copy(data, data + count, m_axes.begin());
+}
+
void Gamepad::setButtons(unsigned count, const WebGamepadButton* data)
{
if (m_buttons.size() != count) {
« no previous file with comments | « Source/modules/gamepad/Gamepad.h ('k') | Source/modules/gamepad/GamepadCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698