| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ScreenOrientationController_h | 5 #ifndef ScreenOrientationController_h |
| 6 #define ScreenOrientationController_h | 6 #define ScreenOrientationController_h |
| 7 | 7 |
| 8 #include "core/frame/FrameDestructionObserver.h" | 8 #include "core/frame/LocalFrameLifecycleObserver.h" |
| 9 #include "core/frame/PlatformEventController.h" | 9 #include "core/frame/PlatformEventController.h" |
| 10 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
| 11 #include "platform/Timer.h" | 11 #include "platform/Timer.h" |
| 12 #include "public/platform/WebLockOrientationCallback.h" | 12 #include "public/platform/WebLockOrientationCallback.h" |
| 13 #include "public/platform/WebScreenOrientationLockType.h" | 13 #include "public/platform/WebScreenOrientationLockType.h" |
| 14 #include "public/platform/WebScreenOrientationType.h" | 14 #include "public/platform/WebScreenOrientationType.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class FrameView; | 18 class FrameView; |
| 19 class ScreenOrientation; | 19 class ScreenOrientation; |
| 20 class WebScreenOrientationClient; | 20 class WebScreenOrientationClient; |
| 21 | 21 |
| 22 class ScreenOrientationController final | 22 class ScreenOrientationController final |
| 23 : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController> | 23 : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController> |
| 24 , public WillBeHeapSupplement<LocalFrame> | 24 , public WillBeHeapSupplement<LocalFrame> |
| 25 , public FrameDestructionObserver | 25 , public LocalFrameLifecycleObserver |
| 26 , public PlatformEventController { | 26 , public PlatformEventController { |
| 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); | 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); |
| 28 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); | 28 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); |
| 29 public: | 29 public: |
| 30 virtual ~ScreenOrientationController(); | 30 virtual ~ScreenOrientationController(); |
| 31 | 31 |
| 32 void setOrientation(ScreenOrientation*); | 32 void setOrientation(ScreenOrientation*); |
| 33 void notifyOrientationChanged(); | 33 void notifyOrientationChanged(); |
| 34 | 34 |
| 35 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); | 35 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 46 | 46 |
| 47 static WebScreenOrientationType computeOrientation(FrameView*); | 47 static WebScreenOrientationType computeOrientation(FrameView*); |
| 48 | 48 |
| 49 // Inherited from PlatformEventController. | 49 // Inherited from PlatformEventController. |
| 50 virtual void didUpdateData() override; | 50 virtual void didUpdateData() override; |
| 51 virtual void registerWithDispatcher() override; | 51 virtual void registerWithDispatcher() override; |
| 52 virtual void unregisterWithDispatcher() override; | 52 virtual void unregisterWithDispatcher() override; |
| 53 virtual bool hasLastData() override; | 53 virtual bool hasLastData() override; |
| 54 virtual void pageVisibilityChanged() override; | 54 virtual void pageVisibilityChanged() override; |
| 55 | 55 |
| 56 // Inherited from FrameDestructionObserver. | 56 // Inherited from LocalFrameLifecycleObserver. |
| 57 virtual void willDetachFrameHost() override; | 57 virtual void willDetachFrameHost() override; |
| 58 | 58 |
| 59 void notifyDispatcher(); | 59 void notifyDispatcher(); |
| 60 | 60 |
| 61 void updateOrientation(); | 61 void updateOrientation(); |
| 62 | 62 |
| 63 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); | 63 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); |
| 64 | 64 |
| 65 bool isActiveAndVisible() const; | 65 bool isActiveAndVisible() const; |
| 66 | 66 |
| 67 PersistentWillBeMember<ScreenOrientation> m_orientation; | 67 PersistentWillBeMember<ScreenOrientation> m_orientation; |
| 68 WebScreenOrientationClient* m_client; | 68 WebScreenOrientationClient* m_client; |
| 69 Timer<ScreenOrientationController> m_dispatchEventTimer; | 69 Timer<ScreenOrientationController> m_dispatchEventTimer; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| 74 #endif // ScreenOrientationController_h | 74 #endif // ScreenOrientationController_h |
| OLD | NEW |