#ifndef ScreenOrientationController_h
#define ScreenOrientationController_h
+#include "core/frame/FrameDestructionObserver.h"
#include "core/frame/PlatformEventController.h"
#include "platform/Supplementable.h"
#include "platform/Timer.h"
class ScreenOrientationController FINAL
: public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController>
, public WillBeHeapSupplement<LocalFrame>
+ , public FrameDestructionObserver
, public PlatformEventController {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController);
WTF_MAKE_NONCOPYABLE(ScreenOrientationController);
public:
virtual ~ScreenOrientationController();
- virtual void persistentHostHasBeenDestroyed() OVERRIDE;
-
void setOrientation(ScreenOrientation*);
void notifyOrientationChanged();
void lock(WebScreenOrientationLockType, WebLockOrientationCallback*);
void unlock();
- const LocalFrame& frame() const;
-
static void provideTo(LocalFrame&, WebScreenOrientationClient*);
static ScreenOrientationController* from(LocalFrame&);
static const char* supplementName();
- virtual void trace(Visitor*);
+ virtual void trace(Visitor*) OVERRIDE;
private:
explicit ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*);
virtual bool hasLastData() OVERRIDE;
virtual void pageVisibilityChanged() OVERRIDE;
+ // Inherited from FrameDestructionObserver.
+ virtual void willDetachFrameHost() override;
+
void notifyDispatcher();
void updateOrientation();
void dispatchEventTimerFired(Timer<ScreenOrientationController>*);
+ bool isActiveAndVisible() const;
+
PersistentWillBeMember<ScreenOrientation> m_orientation;
WebScreenOrientationClient* m_client;
- LocalFrame& m_frame;
Timer<ScreenOrientationController> m_dispatchEventTimer;
};