| Index: Source/modules/gamepad/Gamepad.h
|
| diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/Gamepad.h
|
| index 1e4cfafad5d41341501300f734136996acf67a4e..8075a8383a2ac9d22466added8e51b5b0e039cb6 100644
|
| --- a/Source/modules/gamepad/Gamepad.h
|
| +++ b/Source/modules/gamepad/Gamepad.h
|
| @@ -26,61 +26,25 @@
|
| #ifndef Gamepad_h
|
| #define Gamepad_h
|
|
|
| -#include "bindings/v8/ScriptWrappable.h"
|
| -#include "heap/Handle.h"
|
| -#include "public/platform/WebGamepad.h"
|
| -#include "wtf/RefCounted.h"
|
| -#include "wtf/Vector.h"
|
| -#include "wtf/text/WTFString.h"
|
| +#include "modules/gamepad/GamepadBase.h"
|
| +#include "modules/gamepad/GamepadButton.h"
|
|
|
| namespace WebCore {
|
|
|
| -class Gamepad: public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
|
| +class Gamepad FINAL: public GamepadBase {
|
| public:
|
| static PassRefPtrWillBeRawPtr<Gamepad> create()
|
| {
|
| return adoptRefWillBeNoop(new Gamepad);
|
| }
|
| - ~Gamepad();
|
| + virtual ~Gamepad();
|
|
|
| - typedef Vector<float> FloatVector;
|
| -
|
| - const String& id() const { return m_id; }
|
| - void id(const String& id) { m_id = id; }
|
| -
|
| - unsigned index() const { return m_index; }
|
| - void index(unsigned val) { m_index = val; }
|
| -
|
| - bool connected() const { return m_connected; }
|
| - void connected(bool val) { m_connected = val; }
|
| -
|
| - unsigned long long timestamp() const { return m_timestamp; }
|
| - void timestamp(unsigned long long val) { m_timestamp = val; }
|
| -
|
| - const String& mapping() const { return m_mapping; }
|
| - void mapping(const String& val) { m_mapping = val; }
|
| -
|
| - const FloatVector& axes() const { return m_axes; }
|
| - void axes(unsigned count, float* 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*);
|
| + const GamepadButtonVector& buttons() const { return m_buttons; }
|
| + virtual void buttons(unsigned count, const blink::WebGamepadButton* data);
|
|
|
| private:
|
| Gamepad();
|
| - String m_id;
|
| - unsigned m_index;
|
| - bool m_connected;
|
| - unsigned long long m_timestamp;
|
| - String m_mapping;
|
| - FloatVector m_axes;
|
| - FloatVector m_buttons;
|
| + GamepadButtonVector m_buttons;
|
| };
|
|
|
| } // namespace WebCore
|
|
|