diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
| commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
| tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/dom/DeviceMotionController.h | |
| parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
| download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz | |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/dom/DeviceMotionController.h')
| -rw-r--r-- | Source/WebCore/dom/DeviceMotionController.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/Source/WebCore/dom/DeviceMotionController.h b/Source/WebCore/dom/DeviceMotionController.h index d4aad06ac..e3d72a982 100644 --- a/Source/WebCore/dom/DeviceMotionController.h +++ b/Source/WebCore/dom/DeviceMotionController.h @@ -1,5 +1,6 @@ /* * Copyright 2010 Apple Inc. All rights reserved. + * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,49 +27,31 @@ #ifndef DeviceMotionController_h #define DeviceMotionController_h -#include "DOMWindow.h" -#include "Page.h" -#include "Timer.h" -#include <wtf/HashCountedSet.h> +#include "DeviceController.h" namespace WebCore { -class DeviceMotionData; class DeviceMotionClient; +class DeviceMotionData; -class DeviceMotionController : public Supplement<Page> { +class DeviceMotionController : public DeviceController { public: - ~DeviceMotionController(); + ~DeviceMotionController() { }; static PassOwnPtr<DeviceMotionController> create(DeviceMotionClient*); - void addListener(DOMWindow*); - void removeListener(DOMWindow*); - void removeAllListeners(DOMWindow*); - - void suspendEventsForAllListeners(DOMWindow*); - void resumeEventsForAllListeners(DOMWindow*); - void didChangeDeviceMotion(DeviceMotionData*); + DeviceMotionClient* deviceMotionClient(); - bool isActive() { return !m_listeners.isEmpty(); } + virtual bool hasLastData() OVERRIDE; + virtual PassRefPtr<Event> getLastEvent() OVERRIDE; static const AtomicString& supplementName(); - static DeviceMotionController* from(Page* page) { return static_cast<DeviceMotionController*>(Supplement<Page>::from(page, supplementName())); } + static DeviceMotionController* from(Page*); static bool isActiveAt(Page*); private: explicit DeviceMotionController(DeviceMotionClient*); - - void timerFired(Timer<DeviceMotionController>*); - - DeviceMotionClient* m_client; - typedef HashCountedSet<RefPtr<DOMWindow> > ListenersCountedSet; - ListenersCountedSet m_listeners; - ListenersCountedSet m_suspendedListeners; - typedef HashSet<RefPtr<DOMWindow> > ListenersSet; - ListenersSet m_newListeners; - Timer<DeviceMotionController> m_timer; }; } // namespace WebCore |
