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

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

Issue 195993007: Factor out GamepadCommon base class from Gamepad and WebKitGamepad (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised 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
« no previous file with comments | « no previous file | Source/modules/gamepad/Gamepad.cpp » ('j') | Source/modules/gamepad/GamepadCommon.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/Gamepad.h
diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/Gamepad.h
index 1787b1f83d5f63f9f51d3b66a44da924078f5a65..ee864cd2d6cce51265e6d03f166008edd01ebd53 100644
--- a/Source/modules/gamepad/Gamepad.h
+++ b/Source/modules/gamepad/Gamepad.h
@@ -29,40 +29,19 @@
#include "bindings/v8/ScriptWrappable.h"
#include "heap/Handle.h"
#include "modules/gamepad/GamepadButton.h"
+#include "modules/gamepad/GamepadCommon.h"
#include "public/platform/WebGamepad.h"
#include "wtf/RefCounted.h"
-#include "wtf/Vector.h"
-#include "wtf/text/WTFString.h"
namespace WebCore {
-class Gamepad FINAL : public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
+class Gamepad FINAL : public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public GamepadCommon, public ScriptWrappable {
public:
static PassRefPtrWillBeRawPtr<Gamepad> create()
{
return adoptRefWillBeNoop(new Gamepad);
}
- ~Gamepad();
-
- typedef Vector<float> FloatVector;
-
- const String& id() const { return m_id; }
- void setId(const String& id) { m_id = id; }
-
- unsigned index() const { return m_index; }
- void setIndex(unsigned val) { m_index = val; }
-
- bool connected() const { return m_connected; }
- void setConnected(bool val) { m_connected = val; }
-
- unsigned long long timestamp() const { return m_timestamp; }
- void setTimestamp(unsigned long long val) { m_timestamp = val; }
-
- const String& mapping() const { return m_mapping; }
- void setMapping(const String& val) { m_mapping = val; }
-
- const FloatVector& axes() const { return m_axes; }
- void setAxes(unsigned count, const float* data);
+ ~Gamepad() { }
zerny-chromium 2014/03/13 09:48:00 Nit: keep the impl in the cpp file.
Nils Barth (inactive) 2014/03/13 12:51:14 Done.
const GamepadButtonVector& buttons() const { return m_buttons; }
void setButtons(unsigned count, const blink::WebGamepadButton* data);
@@ -70,13 +49,7 @@ public:
void trace(Visitor*);
haraken 2014/03/13 09:33:50 Add virtual.
zerny-chromium 2014/03/13 09:48:00 Gamepad is final and GCFinalized at that type, so
haraken 2014/03/13 10:22:35 sorry, you're right.
private:
- Gamepad();
- String m_id;
- unsigned m_index;
- bool m_connected;
- unsigned long long m_timestamp;
- String m_mapping;
- FloatVector m_axes;
+ Gamepad() { ScriptWrappable::init(this); }
GamepadButtonVector m_buttons;
};
« no previous file with comments | « no previous file | Source/modules/gamepad/Gamepad.cpp » ('j') | Source/modules/gamepad/GamepadCommon.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698