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

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: oops - fix grammar in test expectation as well 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
« no previous file with comments | « Source/modules/device_light/DeviceLightDispatcher.cpp ('k') | Source/modules/gamepad/GamepadDispatcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/GamepadDispatcher.h
diff --git a/Source/modules/gamepad/GamepadDispatcher.h b/Source/modules/gamepad/GamepadDispatcher.h
index 8ee91a024cfac4afce91f4d445dd4b2ad14a5f71..f86eeefd09af68043209670dc807c816988be9b6 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,24 +18,34 @@ 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&);
+ struct ConnectionChange {
+ blink::WebGamepad pad;
+ unsigned index;
+ };
+
+ const ConnectionChange& latestConnectionChange() const { return m_latestChange; }
+
private:
GamepadDispatcher();
virtual ~GamepadDispatcher();
+ // WebGamepadListener
virtual void didConnectGamepad(unsigned index, const blink::WebGamepad&) OVERRIDE;
virtual void didDisconnectGamepad(unsigned index, const blink::WebGamepad&) OVERRIDE;
- void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected);
+ // DeviceEventDispatcherBase
virtual void startListening() OVERRIDE;
virtual void stopListening() OVERRIDE;
+
+ void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebGamepad&, bool connected);
+
+ ConnectionChange m_latestChange;
};
} // namespace WebCore
« no previous file with comments | « Source/modules/device_light/DeviceLightDispatcher.cpp ('k') | Source/modules/gamepad/GamepadDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698