| 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/LocalFrameLifecycleObserver.h" | 8 #include "core/frame/LocalFrameLifecycleObserver.h" |
| 9 #include "core/frame/PlatformEventController.h" | 9 #include "core/frame/PlatformEventController.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); | 29 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); |
| 30 public: | 30 public: |
| 31 virtual ~ScreenOrientationController(); | 31 virtual ~ScreenOrientationController(); |
| 32 | 32 |
| 33 void setOrientation(ScreenOrientation*); | 33 void setOrientation(ScreenOrientation*); |
| 34 void notifyOrientationChanged(); | 34 void notifyOrientationChanged(); |
| 35 | 35 |
| 36 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); | 36 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); |
| 37 void unlock(); | 37 void unlock(); |
| 38 | 38 |
| 39 void setOverride(WebScreenOrientationType, unsigned short angle); |
| 40 void clearOverride(); |
| 41 |
| 39 static void provideTo(LocalFrame&, WebScreenOrientationClient*); | 42 static void provideTo(LocalFrame&, WebScreenOrientationClient*); |
| 40 static ScreenOrientationController* from(LocalFrame&); | 43 static ScreenOrientationController* from(LocalFrame&); |
| 41 static const char* supplementName(); | 44 static const char* supplementName(); |
| 42 | 45 |
| 43 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); | 49 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); |
| 47 | 50 |
| 48 static WebScreenOrientationType computeOrientation(ChromeClient&); | 51 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t)
; |
| 49 | 52 |
| 50 // Inherited from PlatformEventController. | 53 // Inherited from PlatformEventController. |
| 51 virtual void didUpdateData() override; | 54 virtual void didUpdateData() override; |
| 52 virtual void registerWithDispatcher() override; | 55 virtual void registerWithDispatcher() override; |
| 53 virtual void unregisterWithDispatcher() override; | 56 virtual void unregisterWithDispatcher() override; |
| 54 virtual bool hasLastData() override; | 57 virtual bool hasLastData() override; |
| 55 virtual void pageVisibilityChanged() override; | 58 virtual void pageVisibilityChanged() override; |
| 56 | 59 |
| 57 // Inherited from LocalFrameLifecycleObserver. | 60 // Inherited from LocalFrameLifecycleObserver. |
| 58 virtual void willDetachFrameHost() override; | 61 virtual void willDetachFrameHost() override; |
| 59 | 62 |
| 63 unsigned short effectiveAngle(ChromeClient&); |
| 64 WebScreenOrientationType effectiveType(ChromeClient&); |
| 65 |
| 60 void notifyDispatcher(); | 66 void notifyDispatcher(); |
| 61 | 67 |
| 62 void updateOrientation(); | 68 void updateOrientation(); |
| 63 | 69 |
| 64 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); | 70 void dispatchEventTimerFired(Timer<ScreenOrientationController>*); |
| 65 | 71 |
| 66 bool isActiveAndVisible() const; | 72 bool isActiveAndVisible() const; |
| 67 | 73 |
| 68 PersistentWillBeMember<ScreenOrientation> m_orientation; | 74 PersistentWillBeMember<ScreenOrientation> m_orientation; |
| 69 WebScreenOrientationClient* m_client; | 75 WebScreenOrientationClient* m_client; |
| 70 Timer<ScreenOrientationController> m_dispatchEventTimer; | 76 Timer<ScreenOrientationController> m_dispatchEventTimer; |
| 77 bool m_override; |
| 78 WebScreenOrientationType m_overrideType; |
| 79 unsigned short m_overrideAngle; |
| 71 }; | 80 }; |
| 72 | 81 |
| 73 } // namespace blink | 82 } // namespace blink |
| 74 | 83 |
| 75 #endif // ScreenOrientationController_h | 84 #endif // ScreenOrientationController_h |
| OLD | NEW |