Commit 596d1c90 authored by haraken's avatar haraken Committed by Commit bot

Remove DOMWindowProperty from ScreenOrientationCoontroller

We're replacing DOMWindowProperty with ContextLifecycleObserver.
This CL does the replacement for ScreenOrientationCoontroller.

BUG=610176

Review-Url: https://codereview.chromium.org/2568913003
Cr-Commit-Position: refs/heads/master@{#439421}
parent ee81deee
......@@ -4,6 +4,7 @@
#include "modules/screen_orientation/ScreenOrientationControllerImpl.h"
#include "core/dom/Document.h"
#include "core/events/Event.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
......@@ -39,7 +40,7 @@ ScreenOrientationControllerImpl* ScreenOrientationControllerImpl::from(
ScreenOrientationControllerImpl::ScreenOrientationControllerImpl(
LocalFrame& frame,
WebScreenOrientationClient* client)
: DOMWindowProperty(&frame),
: ContextLifecycleObserver(frame.document()),
PlatformEventController(frame.page()),
m_client(client),
m_dispatchEventTimer(
......@@ -82,7 +83,6 @@ void ScreenOrientationControllerImpl::updateOrientation() {
DCHECK(m_orientation);
DCHECK(frame());
DCHECK(frame()->host());
ChromeClient& chromeClient = frame()->host()->chromeClient();
WebScreenInfo screenInfo = chromeClient.screenInfo();
WebScreenOrientationType orientationType = screenInfo.orientationType;
......@@ -208,10 +208,9 @@ bool ScreenOrientationControllerImpl::hasLastData() {
return true;
}
void ScreenOrientationControllerImpl::frameDestroyed() {
void ScreenOrientationControllerImpl::contextDestroyed() {
stopUpdating();
m_client = nullptr;
DOMWindowProperty::frameDestroyed();
m_activeLock = false;
}
......@@ -224,7 +223,7 @@ void ScreenOrientationControllerImpl::notifyDispatcher() {
DEFINE_TRACE(ScreenOrientationControllerImpl) {
visitor->trace(m_orientation);
DOMWindowProperty::trace(visitor);
ContextLifecycleObserver::trace(visitor);
Supplement<LocalFrame>::trace(visitor);
PlatformEventController::trace(visitor);
}
......
......@@ -5,7 +5,7 @@
#ifndef ScreenOrientationControllerImpl_h
#define ScreenOrientationControllerImpl_h
#include "core/frame/DOMWindowProperty.h"
#include "core/dom/Document.h"
#include "core/frame/PlatformEventController.h"
#include "core/frame/ScreenOrientationController.h"
#include "modules/ModulesExport.h"
......@@ -23,7 +23,7 @@ class WebScreenOrientationClient;
class MODULES_EXPORT ScreenOrientationControllerImpl final
: public GarbageCollectedFinalized<ScreenOrientationControllerImpl>,
public ScreenOrientationController,
public DOMWindowProperty,
public ContextLifecycleObserver,
public PlatformEventController {
USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationControllerImpl);
WTF_MAKE_NONCOPYABLE(ScreenOrientationControllerImpl);
......@@ -57,8 +57,8 @@ class MODULES_EXPORT ScreenOrientationControllerImpl final
bool hasLastData() override;
void pageVisibilityChanged() override;
// Inherited from DOMWindowProperty.
void frameDestroyed() override;
// Inherited from ContextLifecycleObserver.
void contextDestroyed() override;
void notifyDispatcher();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment