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

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: excluded orientation pump tests on win bots Created 7 years, 4 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
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 09ceac16ce4770b9a7755f6dac0aa175e8dfa932..796cb34a0340e19796b50455b2f0b881ebf42e40 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/media/audio_decoder.h"
@@ -54,6 +55,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/WebMediaStreamCenter.h"
@@ -1043,6 +1045,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 =
« no previous file with comments | « content/renderer/renderer_webkitplatformsupport_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698