Index: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteDispatcher.h |
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteDispatcher.h b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteDispatcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..af5368f726152b8d46fffc0506bc1091fd90a90c |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteDispatcher.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DeviceOrientationAbsoluteDispatcher_h |
+#define DeviceOrientationAbsoluteDispatcher_h |
+ |
+#include "core/frame/PlatformEventDispatcher.h" |
+#include "platform/heap/Handle.h" |
+#include "public/platform/modules/device_orientation/WebDeviceOrientationListener.h" |
+#include "wtf/RefPtr.h" |
+ |
+namespace blink { |
+ |
+class DeviceOrientationData; |
+class WebDeviceOrientationData; |
+ |
+// This class listens to device orientation data and notifies all registered controllers. |
+class DeviceOrientationAbsoluteDispatcher final : public GarbageCollectedFinalized<DeviceOrientationAbsoluteDispatcher>, public PlatformEventDispatcher, public WebDeviceOrientationListener { |
+ USING_GARBAGE_COLLECTED_MIXIN(DeviceOrientationAbsoluteDispatcher); |
+public: |
+ static DeviceOrientationAbsoluteDispatcher& instance(); |
+ ~DeviceOrientationAbsoluteDispatcher() override; |
+ |
+ // Note that the returned object is owned by this class. |
+ // FIXME: make the return value const, see crbug.com/233174. |
+ DeviceOrientationData* latestDeviceOrientationData(); |
+ |
+ // Inherited from WebDeviceOrientationListener. |
+ void didChangeDeviceOrientation(const WebDeviceOrientationData&) override; |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+private: |
+ DeviceOrientationAbsoluteDispatcher(); |
+ |
+ // Inherited from PlatformEventDispatcher. |
+ void startListening() override; |
+ void stopListening() override; |
+ |
+ Member<DeviceOrientationData> m_lastDeviceOrientationData; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // DeviceOrientationAbsoluteDispatcher_h |