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

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

Issue 14460010: Implement the Blink part of the Device Motion API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed files incorrectly listed in WebKit.gyp Created 7 years, 7 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 | « Source/core/core.gypi ('k') | Source/core/platform/chromium/support/WebDeviceMotionData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DOMWindow.cpp
diff --git a/Source/core/page/DOMWindow.cpp b/Source/core/page/DOMWindow.cpp
index 16d983c8d6d21cca515b553c6d9b6daa6809ab05..943bca3e914c1d5be061e3d262ac4f8c55e81e1e 100644
--- a/Source/core/page/DOMWindow.cpp
+++ b/Source/core/page/DOMWindow.cpp
@@ -1530,8 +1530,8 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
addBeforeUnloadEventListener(this);
else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->addDeviceEventListener(this);
+ if (DeviceMotionController* controller = DeviceMotionController::from(document()))
+ controller->startUpdating();
} else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->addDeviceEventListener(this);
@@ -1557,8 +1557,8 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
removeBeforeUnloadEventListener(this);
else if (eventType == eventNames().devicemotionEvent) {
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->removeDeviceEventListener(this);
+ if (DeviceMotionController* controller = DeviceMotionController::from(document()))
+ controller->stopUpdating();
} else if (eventType == eventNames().deviceorientationEvent) {
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->removeDeviceEventListener(this);
@@ -1613,8 +1613,8 @@ void DOMWindow::removeAllEventListeners()
{
EventTarget::removeAllEventListeners();
- if (DeviceMotionController* controller = DeviceMotionController::from(page()))
- controller->removeAllDeviceEventListeners(this);
+ if (DeviceMotionController* controller = DeviceMotionController::from(document()))
+ controller->stopUpdating();
if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
controller->removeAllDeviceEventListeners(this);
if (Document* document = this->document())
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/platform/chromium/support/WebDeviceMotionData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698