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