Index: content/renderer/renderer_webkitplatformsupport_impl.cc |
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc |
index 12dfa0a49a0bd9006dbbc43eddd3eb8abdd55620..e8e578b28b981b284266f17b7fdf93d4b603d510 100644 |
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc |
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc |
@@ -39,6 +39,7 @@ |
#include "media/audio/audio_output_device.h" |
#include "media/base/audio_hardware_config.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebBlobRegistry.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionListener.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebFileInfo.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebHyphenator.h" |
@@ -82,6 +83,7 @@ |
using WebKit::WebAudioDevice; |
using WebKit::WebBlobRegistry; |
+using WebKit::WebDeviceMotionListener; |
using WebKit::WebFileInfo; |
using WebKit::WebFileSystem; |
using WebKit::WebFrame; |
@@ -103,6 +105,9 @@ static bool g_sandbox_enabled = true; |
base::LazyInstance<WebGamepads>::Leaky g_test_gamepads = |
LAZY_INSTANCE_INITIALIZER; |
+base::LazyInstance<scoped_ptr<WebDeviceMotionListener> > g_test_device_motion = |
+ LAZY_INSTANCE_INITIALIZER; |
+ |
//------------------------------------------------------------------------------ |
class RendererWebKitPlatformSupportImpl::MimeRegistry |
@@ -923,4 +928,22 @@ WebKit::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
shared_offscreen_context_); |
} |
+//------------------------------------------------------------------------------ |
+ |
+void RendererWebKitPlatformSupportImpl::setDeviceMotionListener( |
+ WebKit::WebDeviceMotionListener* listener) { |
+ if (g_test_device_motion.Get().get() == 0) { |
+ // TODO(timvolodine) provide implementation and instantiation of the |
+ // event pump. |
+ } else { |
+ g_test_device_motion.Get()->setListener(listener); |
+ } |
+} |
+ |
+// static |
+void RendererWebKitPlatformSupportImpl::SetMockDeviceMotionListenerForTesting( |
+ WebDeviceMotionListener* listener) { |
+ g_test_device_motion.Get().reset(listener); |
+} |
+ |
} // namespace content |