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

Unified Diff: Source/WebCore/page/DOMWindow.cpp

Issue 13866007: WebKit & WebCore part of the device motion implementation using the platform layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@devicemotion-webcore
Patch Set: added new LICENSE header Created 7 years, 8 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: Source/WebCore/page/DOMWindow.cpp
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 75bd58521d638c1595697025c5e12873cf8e29c6..475dabff48ed734ed75a5bf88e46a1636c9eff61 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -1622,8 +1622,7 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
addBeforeUnloadEventListener(this);
#if ENABLE(DEVICE_ORIENTATION)
else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->addDeviceEventListener(this);
+ DeviceMotionController::shared().addDeviceEventListener(this);
} else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->addDeviceEventListener(this);
@@ -1658,8 +1657,7 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
removeBeforeUnloadEventListener(this);
#if ENABLE(DEVICE_ORIENTATION)
else if (eventType == eventNames().devicemotionEvent) {
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->removeDeviceEventListener(this);
+ DeviceMotionController::shared().removeDeviceEventListener(this);
} else if (eventType == eventNames().deviceorientationEvent) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->removeDeviceEventListener(this);
@@ -1723,8 +1721,7 @@ void DOMWindow::removeAllEventListeners()
EventTarget::removeAllEventListeners();
#if ENABLE(DEVICE_ORIENTATION)
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->removeAllDeviceEventListeners(this);
+ DeviceMotionController::shared().removeAllDeviceEventListeners(this);
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->removeAllDeviceEventListeners(this);
#endif

Powered by Google App Engine
This is Rietveld 408576698