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

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

Issue 195993007: Factor out GamepadCommon base class from Gamepad and WebKitGamepad (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove excess header 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 | « Source/modules/gamepad/Gamepad.cpp ('k') | Source/modules/gamepad/GamepadCommon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/GamepadCommon.h
diff --git a/Source/modules/gamepad/Gamepad.h b/Source/modules/gamepad/GamepadCommon.h
similarity index 78%
copy from Source/modules/gamepad/Gamepad.h
copy to Source/modules/gamepad/GamepadCommon.h
index 1787b1f83d5f63f9f51d3b66a44da924078f5a65..95aede44a0232e7d8fd21f1d1775853d3bbc4f7b 100644
--- a/Source/modules/gamepad/Gamepad.h
+++ b/Source/modules/gamepad/GamepadCommon.h
@@ -23,27 +23,19 @@
* DAMAGE.
*/
-#ifndef Gamepad_h
-#define Gamepad_h
+#ifndef GamepadCommon_h
+#define GamepadCommon_h
-#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"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class Gamepad FINAL : public RefCountedWillBeGarbageCollectedFinalized<Gamepad>, public ScriptWrappable {
+class GamepadCommon {
public:
- static PassRefPtrWillBeRawPtr<Gamepad> create()
- {
- return adoptRefWillBeNoop(new Gamepad);
- }
- ~Gamepad();
-
+ GamepadCommon();
+ ~GamepadCommon();
typedef Vector<float> FloatVector;
const String& id() const { return m_id; }
@@ -64,22 +56,15 @@ public:
const FloatVector& axes() const { return m_axes; }
void setAxes(unsigned count, const float* data);
- const GamepadButtonVector& buttons() const { return m_buttons; }
- void setButtons(unsigned count, const blink::WebGamepadButton* data);
-
- void trace(Visitor*);
-
-private:
- Gamepad();
+protected:
String m_id;
unsigned m_index;
bool m_connected;
unsigned long long m_timestamp;
String m_mapping;
FloatVector m_axes;
- GamepadButtonVector m_buttons;
};
} // namespace WebCore
-#endif // Gamepad_h
+#endif // GamepadCommon_h
« no previous file with comments | « Source/modules/gamepad/Gamepad.cpp ('k') | Source/modules/gamepad/GamepadCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698