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

Unified Diff: Source/modules/device_orientation/DeviceOrientationDispatcher.h

Issue 315023006: Revert of Generalize and refactor DeviceSensorEvent* architecture to support multi-event type targets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/modules/device_orientation/DeviceOrientationDispatcher.h
diff --git a/Source/modules/device_orientation/DeviceOrientationDispatcher.h b/Source/modules/device_orientation/DeviceOrientationDispatcher.h
index 42162230e81e582421fcda06489005ea875ec3a1..b1c7dfda9b87e86ca9ecaadaa21680278dd1cbad 100644
--- a/Source/modules/device_orientation/DeviceOrientationDispatcher.h
+++ b/Source/modules/device_orientation/DeviceOrientationDispatcher.h
@@ -31,7 +31,7 @@
#ifndef DeviceOrientationDispatcher_h
#define DeviceOrientationDispatcher_h
-#include "core/frame/DeviceEventDispatcherBase.h"
+#include "core/frame/DeviceSensorEventDispatcher.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebDeviceOrientationListener.h"
#include "wtf/RefPtr.h"
@@ -45,8 +45,9 @@
class DeviceOrientationController;
class DeviceOrientationData;
-// This class listens to device orientation data and notifies all registered controllers.
-class DeviceOrientationDispatcher : public DeviceEventDispatcherBase, public blink::WebDeviceOrientationListener {
+// This class listens to device motion data and dispatches it to all
+// listening controllers.
+class DeviceOrientationDispatcher : public DeviceSensorEventDispatcher, public blink::WebDeviceOrientationListener {
public:
static DeviceOrientationDispatcher& instance();
@@ -54,14 +55,15 @@
// FIXME: make the return value const, see crbug.com/233174.
DeviceOrientationData* latestDeviceOrientationData();
- // Inherited from WebDeviceOrientationListener.
+ // This method is called every time new device motion data is available.
virtual void didChangeDeviceOrientation(const blink::WebDeviceOrientationData&) OVERRIDE;
+ void addDeviceOrientationController(DeviceOrientationController*);
+ void removeDeviceOrientationController(DeviceOrientationController*);
private:
DeviceOrientationDispatcher();
~DeviceOrientationDispatcher();
- // Inherited from DeviceEventDispatcherBase.
virtual void startListening() OVERRIDE;
virtual void stopListening() OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698