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