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

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

Issue 22599005: Blink-side layout tests for the new Device Orientation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased once more Created 7 years, 3 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/inspector/InspectorPageAgent.cpp ('k') | Source/testing/runner/TestRunner.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 0dec954f0355468eb02f035a9bbac5c80804ec3b..7cc24a9cf366a86e592d5e012c4279942416ff4f 100644
--- a/Source/core/page/DOMWindow.cpp
+++ b/Source/core/page/DOMWindow.cpp
@@ -44,7 +44,6 @@
#include "core/css/MediaQueryMatcher.h"
#include "core/css/StyleMedia.h"
#include "core/css/resolver/StyleResolver.h"
-#include "core/dom/DeviceOrientationController.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/events/EventListener.h"
@@ -95,6 +94,7 @@
#include "core/storage/Storage.h"
#include "core/storage/StorageArea.h"
#include "core/storage/StorageNamespace.h"
+#include "modules/device_orientation/NewDeviceOrientationController.h"
#include "weborigin/KURL.h"
#include "weborigin/SecurityOrigin.h"
#include "weborigin/SecurityPolicy.h"
@@ -434,8 +434,8 @@ void DOMWindow::willDetachPage()
InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
// FIXME: Once DeviceOrientationController is a ScriptExecutionContext
// Supplement, this will no longer be needed.
- if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
- controller->removeAllDeviceEventListeners(this);
+ if (NewDeviceOrientationController* controller = NewDeviceOrientationController::from(document()))
+ controller->stopUpdating();
}
void DOMWindow::willDestroyDocumentInFrame()
@@ -1432,8 +1432,8 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
UseCounter::count(this, UseCounter::SubFrameBeforeUnloadRegistered);
}
} else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
- if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
- controller->addDeviceEventListener(this);
+ if (NewDeviceOrientationController* controller = NewDeviceOrientationController::from(document()))
+ controller->startUpdating();
}
return true;
@@ -1456,8 +1456,8 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
} else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this)) {
removeBeforeUnloadEventListener(this);
} else if (eventType == eventNames().deviceorientationEvent) {
- if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
- controller->removeDeviceEventListener(this);
+ if (NewDeviceOrientationController* controller = NewDeviceOrientationController::from(document()))
+ controller->stopUpdating();
}
return true;
@@ -1511,8 +1511,8 @@ void DOMWindow::removeAllEventListeners()
lifecycleNotifier()->notifyRemoveAllEventListeners(this);
- if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
- controller->removeAllDeviceEventListeners(this);
+ if (NewDeviceOrientationController* controller = NewDeviceOrientationController::from(document()))
+ controller->stopUpdating();
if (Document* document = this->document())
document->didRemoveEventTargetNode(document);
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/testing/runner/TestRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698