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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.h

Issue 207323002: Gamepad API: add test support for gamepad events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/renderer/renderer_webkitplatformsupport_impl.h
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h
index 4d3e3428b84b2199381b01dae711caa6b306a06e..85d09ac02e2329a0c22bcb9b312a6e86d751547a 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.h
+++ b/content/renderer/renderer_webkitplatformsupport_impl.h
@@ -126,7 +126,8 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
createMIDIAccessor(blink::WebMIDIAccessorClient* client);
virtual blink::WebBlobRegistry* blobRegistry();
- virtual void sampleGamepads(blink::WebGamepads&);
+ virtual void sampleGamepads(blink::WebGamepads&) OVERRIDE;
+ virtual void setGamepadListener(blink::WebGamepadListener*) OVERRIDE;
virtual blink::WebRTCPeerConnectionHandler* createRTCPeerConnectionHandler(
blink::WebRTCPeerConnectionHandlerClient* client);
virtual blink::WebMediaStreamCenter* createMediaStreamCenter(
@@ -169,6 +170,15 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
// Set WebGamepads to return when sampleGamepads() is invoked.
static void SetMockGamepadsForTesting(const blink::WebGamepads& pads);
+
+ // Notifies blink::WebGamepadListener about a new gamepad if a listener
+ // has been set via setGamepadListener.
+ static void MockGamepadConnected(int index, const blink::WebGamepad& pad);
+
+ // Notifies blink::WebGamepadListener that a gamepad has been disconnected if
+ // a listener has been set via setGamepadListener.
+ static void MockGamepadDisconnected(int index, const blink::WebGamepad& pad);
+
// Set WebDeviceMotionData to return when setDeviceMotionListener is invoked.
static void SetMockDeviceMotionDataForTesting(
const blink::WebDeviceMotionData& data);

Powered by Google App Engine
This is Rietveld 408576698