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

Side by Side 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, 1 month 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698