Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / screen_orientation / ScreenOrientationController.h
index d81826f..beacc04 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef ScreenOrientationController_h
 #define ScreenOrientationController_h
 
+#include "core/frame/FrameDestructionObserver.h"
 #include "core/frame/PlatformEventController.h"
 #include "platform/Supplementable.h"
 #include "platform/Timer.h"
@@ -21,27 +22,24 @@ class WebScreenOrientationClient;
 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*);
@@ -54,15 +52,19 @@ private:
     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;
 };