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 DeviceOrientationController_h | 5 #ifndef DeviceOrientationController_h |
6 #define DeviceOrientationController_h | 6 #define DeviceOrientationController_h |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/DeviceSingleWindowEventController.h" | 9 #include "core/frame/DeviceSingleWindowEventController.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class DeviceOrientationData; | 14 class DeviceOrientationData; |
| 15 class DeviceOrientationDispatcher; |
15 class Event; | 16 class Event; |
16 | 17 |
17 class MODULES_EXPORT DeviceOrientationController final : public DeviceSingleWind
owEventController, public WillBeHeapSupplement<Document> { | 18 class MODULES_EXPORT DeviceOrientationController : public DeviceSingleWindowEven
tController, public WillBeHeapSupplement<Document> { |
18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationController); | 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationController); |
19 public: | 20 public: |
20 ~DeviceOrientationController() override; | 21 ~DeviceOrientationController() override; |
21 | 22 |
22 static const char* supplementName(); | 23 static const char* supplementName(); |
23 static DeviceOrientationController& from(Document&); | 24 static DeviceOrientationController& from(Document&); |
24 | 25 |
25 // Inherited from DeviceSingleWindowEventController. | 26 // Inherited from DeviceSingleWindowEventController. |
26 void didUpdateData() override; | 27 void didUpdateData() override; |
27 void didAddEventListener(LocalDOMWindow*, const AtomicString& eventType) ove
rride; | 28 void didAddEventListener(LocalDOMWindow*, const AtomicString& eventType) ove
rride; |
28 | 29 |
29 void setOverride(DeviceOrientationData*); | 30 void setOverride(DeviceOrientationData*); |
30 void clearOverride(); | 31 void clearOverride(); |
31 | 32 |
32 DECLARE_VIRTUAL_TRACE(); | 33 DECLARE_VIRTUAL_TRACE(); |
33 | 34 |
34 private: | 35 protected: |
35 explicit DeviceOrientationController(Document&); | 36 explicit DeviceOrientationController(Document&); |
36 | 37 |
| 38 virtual DeviceOrientationDispatcher& dispatcherInstance() const; |
| 39 |
| 40 private: |
37 // Inherited from DeviceEventControllerBase. | 41 // Inherited from DeviceEventControllerBase. |
38 void registerWithDispatcher() override; | 42 void registerWithDispatcher() override; |
39 void unregisterWithDispatcher() override; | 43 void unregisterWithDispatcher() override; |
40 bool hasLastData() override; | 44 bool hasLastData() override; |
41 | 45 |
42 // Inherited from DeviceSingleWindowEventController. | 46 // Inherited from DeviceSingleWindowEventController. |
43 PassRefPtrWillBeRawPtr<Event> lastEvent() const override; | 47 PassRefPtrWillBeRawPtr<Event> lastEvent() const override; |
44 const AtomicString& eventTypeName() const override; | 48 const AtomicString& eventTypeName() const override; |
45 bool isNullEvent(Event*) const override; | 49 bool isNullEvent(Event*) const override; |
46 | 50 |
47 DeviceOrientationData* lastData() const; | 51 DeviceOrientationData* lastData() const; |
48 | 52 |
49 PersistentWillBeMember<DeviceOrientationData> m_overrideOrientationData; | 53 PersistentWillBeMember<DeviceOrientationData> m_overrideOrientationData; |
50 }; | 54 }; |
51 | 55 |
52 } // namespace blink | 56 } // namespace blink |
53 | 57 |
54 #endif // DeviceOrientationController_h | 58 #endif // DeviceOrientationController_h |
OLD | NEW |