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