Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 8ccd60aca42cbccbf9550049c4ab1f3fc36e948f..8708c934f24926cbee573b45d81301ab5bb9c697 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -120,6 +120,7 @@ using blink::WebBlobRegistry; |
using blink::WebDatabaseObserver; |
using blink::WebFileInfo; |
using blink::WebFileSystem; |
+using blink::WebGamepad; |
using blink::WebGamepads; |
using blink::WebIDBFactory; |
using blink::WebMIDIAccessor; |
@@ -136,6 +137,7 @@ using blink::WebVector; |
namespace content { |
static bool g_sandbox_enabled = true; |
+static blink::WebGamepadListener* web_gamepad_listener = NULL; |
jochen (gone - plz use gerrit)
2014/03/24 12:22:40
can this be a member of RendererWebKitPlatformSupp
|
base::LazyInstance<WebGamepads>::Leaky g_test_gamepads = |
LAZY_INSTANCE_INITIALIZER; |
base::LazyInstance<blink::WebDeviceMotionData>::Leaky |
@@ -915,6 +917,11 @@ void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { |
} |
} |
+void RendererWebKitPlatformSupportImpl::setGamepadListener( |
+ blink::WebGamepadListener* listener) { |
+ web_gamepad_listener = listener; |
+} |
+ |
//------------------------------------------------------------------------------ |
WebRTCPeerConnectionHandler* |
@@ -966,6 +973,22 @@ void RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting( |
g_test_gamepads.Get() = pads; |
} |
+// static |
+void RendererWebKitPlatformSupportImpl::MockGamepadConnected( |
+ int index, |
+ const WebGamepad& pad) { |
+ if (web_gamepad_listener) |
+ web_gamepad_listener->didConnectGamepad(index, pad); |
+} |
+ |
+// static |
+void RendererWebKitPlatformSupportImpl::MockGamepadDisconnected( |
+ int index, |
+ const WebGamepad& pad) { |
+ if (web_gamepad_listener) |
+ web_gamepad_listener->didDisconnectGamepad(index, pad); |
+} |
+ |
//------------------------------------------------------------------------------ |
blink::WebSpeechSynthesizer* |