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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 20707002: Implement Device Orientation using shared memory in content/renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed owners Created 7 years, 5 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 917ce1f50047d0235af77bfde0e6216ed7c1d73b..d15b530b512584d75fc8258f8a5d749671c80e3a 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -32,6 +32,7 @@
#include "content/public/common/webplugininfo.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/device_orientation/device_motion_event_pump.h"
+#include "content/renderer/device_orientation/device_orientation_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"
@@ -55,6 +56,7 @@
#include "net/base/net_util.h"
#include "third_party/WebKit/public/platform/WebBlobRegistry.h"
#include "third_party/WebKit/public/platform/WebDeviceMotionListener.h"
+#include "third_party/WebKit/public/platform/WebDeviceOrientationListener.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
#include "third_party/WebKit/public/platform/WebHyphenator.h"
@@ -1108,6 +1110,17 @@ void RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting(
//------------------------------------------------------------------------------
+void RendererWebKitPlatformSupportImpl::setDeviceOrientationListener(
+ WebKit::WebDeviceOrientationListener* listener) {
+ if (!device_orientation_event_pump_) {
+ device_orientation_event_pump_.reset(new DeviceOrientationEventPump);
+ device_orientation_event_pump_->Attach(RenderThreadImpl::current());
+ }
+ device_orientation_event_pump_->SetListener(listener);
+}
+
+//------------------------------------------------------------------------------
+
WebKit::WebCrypto* RendererWebKitPlatformSupportImpl::crypto() {
// Use a mock implementation for testing in-progress work.
WebKit::WebCrypto* crypto =

Powered by Google App Engine
This is Rietveld 408576698