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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 14678012: Implement the content/renderer and content/browser part of the Device Motion API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: factored out as much code as possible from the templated reader Created 7 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: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 8f053cc8a85026c4876cce5fd9997e4deefc5b82..1eafaa45db8233febf1b853548a045b7fa708eff 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -26,6 +26,7 @@
#include "content/common/view_messages.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/content_renderer_client.h"
+#include "content/renderer/device_orientation/device_motion_event_pump.h"
#include "content/renderer/dom_storage/webstoragenamespace_impl.h"
#include "content/renderer/gamepad_shared_memory_reader.h"
#include "content/renderer/hyphenator/hyphenator.h"
@@ -921,4 +922,15 @@ WebKit::WebString RendererWebKitPlatformSupportImpl::convertIDNToUnicode(
return net::IDNToUnicode(host.utf8(), languages.utf8());
}
+//------------------------------------------------------------------------------
+
+void RendererWebKitPlatformSupportImpl::setDeviceMotionListener(
+ WebKit::WebDeviceMotionListener* listener) {
+ if (!device_motion_event_pump_) {
+ device_motion_event_pump_.reset(new DeviceMotionEventPump);
+ device_motion_event_pump_->Attach(RenderThreadImpl::current());
+ }
+ device_motion_event_pump_->SetListener(listener);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698