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 ScreenOrientationControllerImpl_h | 5 #ifndef ScreenOrientationControllerImpl_h |
6 #define ScreenOrientationControllerImpl_h | 6 #define ScreenOrientationControllerImpl_h |
7 | 7 |
8 #include "core/frame/DOMWindowProperty.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/PlatformEventController.h" | 9 #include "core/frame/PlatformEventController.h" |
10 #include "core/frame/ScreenOrientationController.h" | 10 #include "core/frame/ScreenOrientationController.h" |
11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
12 #include "platform/Timer.h" | 12 #include "platform/Timer.h" |
13 #include "public/platform/modules/screen_orientation/WebLockOrientationCallback.
h" | 13 #include "public/platform/modules/screen_orientation/WebLockOrientationCallback.
h" |
14 #include "public/platform/modules/screen_orientation/WebScreenOrientationLockTyp
e.h" | 14 #include "public/platform/modules/screen_orientation/WebScreenOrientationLockTyp
e.h" |
15 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" | 15 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class ScreenOrientation; | 20 class ScreenOrientation; |
21 class WebScreenOrientationClient; | 21 class WebScreenOrientationClient; |
22 | 22 |
23 class MODULES_EXPORT ScreenOrientationControllerImpl final | 23 class MODULES_EXPORT ScreenOrientationControllerImpl final |
24 : public GarbageCollectedFinalized<ScreenOrientationControllerImpl>, | 24 : public GarbageCollectedFinalized<ScreenOrientationControllerImpl>, |
25 public ScreenOrientationController, | 25 public ScreenOrientationController, |
26 public DOMWindowProperty, | 26 public ContextLifecycleObserver, |
27 public PlatformEventController { | 27 public PlatformEventController { |
28 USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationControllerImpl); | 28 USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationControllerImpl); |
29 WTF_MAKE_NONCOPYABLE(ScreenOrientationControllerImpl); | 29 WTF_MAKE_NONCOPYABLE(ScreenOrientationControllerImpl); |
30 | 30 |
31 public: | 31 public: |
32 ~ScreenOrientationControllerImpl() override; | 32 ~ScreenOrientationControllerImpl() override; |
33 | 33 |
34 void setOrientation(ScreenOrientation*); | 34 void setOrientation(ScreenOrientation*); |
35 void notifyOrientationChanged(); | 35 void notifyOrientationChanged(); |
36 | 36 |
(...skipping 13 matching lines...) Expand all Loading... |
50 | 50 |
51 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t); | 51 static WebScreenOrientationType computeOrientation(const IntRect&, uint16_t); |
52 | 52 |
53 // Inherited from PlatformEventController. | 53 // Inherited from PlatformEventController. |
54 void didUpdateData() override; | 54 void didUpdateData() override; |
55 void registerWithDispatcher() override; | 55 void registerWithDispatcher() override; |
56 void unregisterWithDispatcher() override; | 56 void unregisterWithDispatcher() override; |
57 bool hasLastData() override; | 57 bool hasLastData() override; |
58 void pageVisibilityChanged() override; | 58 void pageVisibilityChanged() override; |
59 | 59 |
60 // Inherited from DOMWindowProperty. | 60 // Inherited from ContextLifecycleObserver. |
61 void frameDestroyed() override; | 61 void contextDestroyed() override; |
62 | 62 |
63 void notifyDispatcher(); | 63 void notifyDispatcher(); |
64 | 64 |
65 void updateOrientation(); | 65 void updateOrientation(); |
66 | 66 |
67 void dispatchEventTimerFired(TimerBase*); | 67 void dispatchEventTimerFired(TimerBase*); |
68 | 68 |
69 bool isActiveAndVisible() const; | 69 bool isActiveAndVisible() const; |
70 | 70 |
71 Member<ScreenOrientation> m_orientation; | 71 Member<ScreenOrientation> m_orientation; |
72 WebScreenOrientationClient* m_client; | 72 WebScreenOrientationClient* m_client; |
73 Timer<ScreenOrientationControllerImpl> m_dispatchEventTimer; | 73 Timer<ScreenOrientationControllerImpl> m_dispatchEventTimer; |
74 bool m_activeLock = false; | 74 bool m_activeLock = false; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // ScreenOrientationControllerImpl_h | 79 #endif // ScreenOrientationControllerImpl_h |
OLD | NEW |