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

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

Issue 183313003: Added non-prefixed navigator.getGamepads() with updated API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added LayoutTests Created 6 years, 9 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: Source/modules/gamepad/GamepadBase.cpp
diff --git a/Source/core/css/DocumentFontFaceSet.cpp b/Source/modules/gamepad/GamepadBase.cpp
similarity index 76%
copy from Source/core/css/DocumentFontFaceSet.cpp
copy to Source/modules/gamepad/GamepadBase.cpp
index a5952c64b271f9d5cc186f1a38b1298b202676de..a5fd5c91184494016efec50bf176a04c3362420f 100644
--- a/Source/core/css/DocumentFontFaceSet.cpp
+++ b/Source/modules/gamepad/GamepadBase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, Google Inc. All rights reserved.
+ * Copyright (C) 2011, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,15 +24,30 @@
*/
#include "config.h"
-#include "core/css/DocumentFontFaceSet.h"
-
-#include "core/css/FontFaceSet.h"
+#include "modules/gamepad/GamepadBase.h"
namespace WebCore {
-PassRefPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document)
+GamepadBase::GamepadBase()
+ : m_index(0)
+ , m_timestamp(0)
+{
+ ScriptWrappable::init(this);
+}
+
+void GamepadBase::axes(unsigned count, const float* data)
+{
+ m_axes.resize(count);
+ if (count)
+ std::copy(data, data + count, m_axes.begin());
+}
+
+GamepadBase::~GamepadBase()
+{
+}
+
+void GamepadBase::trace(Visitor* visitor)
{
- return FontFaceSet::from(document);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698