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

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

Issue 336693004: Deduplicate DeviceEvent* classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: derive from *Base Created 6 years, 6 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/GamepadDispatcher.h
diff --git a/Source/modules/gamepad/GamepadDispatcher.h b/Source/modules/gamepad/GamepadDispatcher.h
index 8ee91a024cfac4afce91f4d445dd4b2ad14a5f71..470afd165de47e6b0a9dd3daea4cd8208de50d95 100644
--- a/Source/modules/gamepad/GamepadDispatcher.h
+++ b/Source/modules/gamepad/GamepadDispatcher.h
@@ -5,11 +5,12 @@
#ifndef GamepadDispatcher_h
#define GamepadDispatcher_h
-#include "core/frame/DeviceSensorEventDispatcher.h"
+#include "core/frame/DeviceEventDispatcherBase.h"
+#include "platform/heap/Handle.h"
+#include "public/platform/WebGamepad.h"
#include "public/platform/WebGamepadListener.h"
namespace blink {
-class WebGamepad;
class WebGamepads;
}
@@ -17,14 +18,14 @@ namespace WebCore {
class NavigatorGamepad;
-class GamepadDispatcher : public DeviceSensorEventDispatcher, public blink::WebGamepadListener {
+class GamepadDispatcher : public DeviceEventDispatcherBase, public blink::WebGamepadListener {
public:
static GamepadDispatcher& instance();
- void addClient(NavigatorGamepad*);
- void removeClient(NavigatorGamepad*);
void sampleGamepads(blink::WebGamepads&);
+ const blink::WebGamepad& latestGamepadEventData(unsigned& index) const;
timvolodine 2014/06/16 13:05:17 drop the index argument here?
+
private:
GamepadDispatcher();
virtual ~GamepadDispatcher();
@@ -35,6 +36,9 @@ private:
virtual void startListening() OVERRIDE;
virtual void stopListening() OVERRIDE;
+
+ blink::WebGamepad m_latestGamepad;
+ unsigned m_latestGamepadIndex;
timvolodine 2014/06/16 13:05:17 is this needed?
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698