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

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

Issue 196503004: Share Gamepad and WebKitGamepad implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Compiles and links 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/Gamepad.h
diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/Gamepad.h
index 1e4cfafad5d41341501300f734136996acf67a4e..74911fb52eebba5e3277eb558a2f5cee16b3a2e0 100644
--- a/Source/modules/gamepad/Gamepad.h
+++ b/Source/modules/gamepad/Gamepad.h
@@ -28,6 +28,7 @@
#include "bindings/v8/ScriptWrappable.h"
#include "heap/Handle.h"
+#include "modules/gamepad/GamepadButton.h"
#include "public/platform/WebGamepad.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
@@ -35,40 +36,40 @@
namespace WebCore {
-class Gamepad: public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
+class Gamepad FINAL : public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
public:
static PassRefPtrWillBeRawPtr<Gamepad> create()
{
return adoptRefWillBeNoop(new Gamepad);
}
- ~Gamepad();
+ virtual ~Gamepad();
eseidel 2014/03/12 20:05:49 What's virtual? Do we need an OVERRIDE somewhere?
Nils Barth (inactive) 2014/03/13 08:55:46 (This was from upstream and is gone now.)
typedef Vector<float> FloatVector;
const String& id() const { return m_id; }
- void id(const String& id) { m_id = id; }
+ void setId(const String& id) { m_id = id; }
unsigned index() const { return m_index; }
- void index(unsigned val) { m_index = val; }
+ void setIndex(unsigned val) { m_index = val; }
bool connected() const { return m_connected; }
- void connected(bool val) { m_connected = val; }
+ void setConnected(bool val) { m_connected = val; }
unsigned long long timestamp() const { return m_timestamp; }
- void timestamp(unsigned long long val) { m_timestamp = val; }
+ void setTimestamp(unsigned long long val) { m_timestamp = val; }
const String& mapping() const { return m_mapping; }
- void mapping(const String& val) { m_mapping = val; }
+ void setMapping(const String& val) { m_mapping = val; }
const FloatVector& axes() const { return m_axes; }
- void axes(unsigned count, float* data);
+ void setAxes(unsigned count, const float* data);
+
+ const GamepadButtonVector& buttons() const { return m_buttons; }
+ void setButtons(unsigned count, const blink::WebGamepadButton* data);
+
+ const FloatVector& webkitButtons() const { return m_webkitButtons; }
+ void setWebkitButtons(unsigned count, const blink::WebGamepadButton* data);
- const FloatVector& buttons() const { return m_buttons; }
-#if defined(ENABLE_NEW_GAMEPAD_API)
- void buttons(unsigned count, blink::WebGamepadButton* data);
-#else
- void buttons(unsigned count, float* data);
-#endif
void trace(Visitor*);
@@ -80,7 +81,8 @@ private:
unsigned long long m_timestamp;
String m_mapping;
FloatVector m_axes;
- FloatVector m_buttons;
+ GamepadButtonVector m_buttons;
eseidel 2014/03/12 20:05:49 Unclear how these should relate. If you call both
Nils Barth (inactive) 2014/03/13 08:55:46 This was mess from shoving both into the same clas
+ FloatVector m_webkitButtons;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698