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/DOMWindowProperty.h" | 8 #include "core/frame/DOMWindowProperty.h" |
9 #include "core/frame/PlatformEventController.h" | 9 #include "core/frame/PlatformEventController.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "platform/Supplementable.h" | 11 #include "platform/Supplementable.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 | 17 |
17 namespace blink { | 18 namespace blink { |
18 | 19 |
19 class ScreenOrientation; | 20 class ScreenOrientation; |
20 class WebScreenOrientationClient; | 21 class WebScreenOrientationClient; |
21 | 22 |
22 class MODULES_EXPORT ScreenOrientationController final | 23 class MODULES_EXPORT ScreenOrientationController final |
23 : public GarbageCollectedFinalized<ScreenOrientationController>, | 24 : public GarbageCollectedFinalized<ScreenOrientationController>, |
24 public Supplement<LocalFrame>, | 25 public Supplement<LocalFrame>, |
25 public DOMWindowProperty, | 26 public DOMWindowProperty, |
26 public PlatformEventController { | 27 public PlatformEventController { |
27 USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); | 28 USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController); |
28 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); | 29 WTF_MAKE_NONCOPYABLE(ScreenOrientationController); |
29 | 30 |
30 public: | 31 public: |
31 ~ScreenOrientationController() override; | 32 ~ScreenOrientationController() override; |
32 | 33 |
33 void setOrientation(ScreenOrientation*); | 34 void setOrientation(ScreenOrientation*); |
34 void notifyOrientationChanged(); | 35 void notifyOrientationChanged(); |
35 | 36 |
36 void lock(WebScreenOrientationLockType, WebLockOrientationCallback*); | 37 void lock(WebScreenOrientationLockType, |
| 38 std::unique_ptr<WebLockOrientationCallback>); |
37 void unlock(); | 39 void unlock(); |
38 | 40 |
39 static void provideTo(LocalFrame&, WebScreenOrientationClient*); | 41 static void provideTo(LocalFrame&, WebScreenOrientationClient*); |
40 static ScreenOrientationController* from(LocalFrame&); | 42 static ScreenOrientationController* from(LocalFrame&); |
41 static const char* supplementName(); | 43 static const char* supplementName(); |
42 | 44 |
43 DECLARE_VIRTUAL_TRACE(); | 45 DECLARE_VIRTUAL_TRACE(); |
44 | 46 |
45 private: | 47 private: |
46 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); | 48 ScreenOrientationController(LocalFrame&, WebScreenOrientationClient*); |
(...skipping 19 matching lines...) Expand all Loading... |
66 bool isActiveAndVisible() const; | 68 bool isActiveAndVisible() const; |
67 | 69 |
68 Member<ScreenOrientation> m_orientation; | 70 Member<ScreenOrientation> m_orientation; |
69 WebScreenOrientationClient* m_client; | 71 WebScreenOrientationClient* m_client; |
70 Timer<ScreenOrientationController> m_dispatchEventTimer; | 72 Timer<ScreenOrientationController> m_dispatchEventTimer; |
71 }; | 73 }; |
72 | 74 |
73 } // namespace blink | 75 } // namespace blink |
74 | 76 |
75 #endif // ScreenOrientationController_h | 77 #endif // ScreenOrientationController_h |
OLD | NEW |