Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Unified Diff: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationAbsoluteDispatcher.h

Issue 1416123002: Absolute Device Orientation API: blink implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698