OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DeviceOrientationAbsoluteDispatcher_h |
| 6 #define DeviceOrientationAbsoluteDispatcher_h |
| 7 |
| 8 #include "core/frame/PlatformEventDispatcher.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 #include "public/platform/modules/device_orientation/WebDeviceOrientationListene
r.h" |
| 11 #include "wtf/RefPtr.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class DeviceOrientationData; |
| 16 class WebDeviceOrientationData; |
| 17 |
| 18 // This class listens to device orientation data and notifies all registered con
trollers. |
| 19 class DeviceOrientationAbsoluteDispatcher final : public GarbageCollectedFinaliz
ed<DeviceOrientationAbsoluteDispatcher>, public PlatformEventDispatcher, public
WebDeviceOrientationListener { |
| 20 USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationAbsoluteDispatcher); |
| 21 public: |
| 22 static DeviceOrientationAbsoluteDispatcher& instance(); |
| 23 ~DeviceOrientationAbsoluteDispatcher() override; |
| 24 |
| 25 // Note that the returned object is owned by this class. |
| 26 // FIXME: make the return value const, see crbug.com/233174. |
| 27 DeviceOrientationData* latestDeviceOrientationData(); |
| 28 |
| 29 // Inherited from WebDeviceOrientationListener. |
| 30 void didChangeDeviceOrientation(const WebDeviceOrientationData&) override; |
| 31 |
| 32 DECLARE_VIRTUAL_TRACE(); |
| 33 |
| 34 private: |
| 35 DeviceOrientationAbsoluteDispatcher(); |
| 36 |
| 37 // Inherited from PlatformEventDispatcher. |
| 38 void startListening() override; |
| 39 void stopListening() override; |
| 40 |
| 41 Member<DeviceOrientationData> m_lastDeviceOrientationData; |
| 42 }; |
| 43 |
| 44 } // namespace blink |
| 45 |
| 46 #endif // DeviceOrientationAbsoluteDispatcher_h |
OLD | NEW |