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

Unified Diff: content/renderer/device_sensors/device_orientation_absolute_event_pump.h

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)
Patch Set: updated content/renderer/BUILD.gn Created 3 years, 7 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: content/renderer/device_sensors/device_orientation_absolute_event_pump.h
diff --git a/content/renderer/device_sensors/device_orientation_absolute_event_pump.h b/content/renderer/device_sensors/device_orientation_absolute_event_pump.h
new file mode 100644
index 0000000000000000000000000000000000000000..43e2f5c70f854d1f4c7f308afafa56bdba4c3c4b
--- /dev/null
+++ b/content/renderer/device_sensors/device_orientation_absolute_event_pump.h
@@ -0,0 +1,45 @@
+// Copyright 2017 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 CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_ORIENTATION_ABSOLUTE_EVENT_PUMP_H_
+#define CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_ORIENTATION_ABSOLUTE_EVENT_PUMP_H_
+
+#include "base/macros.h"
+#include "content/renderer/device_sensors/device_sensor_event_pump.h"
+#include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h"
+
+namespace blink {
+class WebDeviceOrientationListener;
+}
+
+namespace content {
+
+class CONTENT_EXPORT DeviceOrientationAbsoluteEventPump
+ : public DeviceSensorEventPump<blink::WebDeviceOrientationListener> {
+ public:
+ explicit DeviceOrientationAbsoluteEventPump(RenderThread* thread);
+ ~DeviceOrientationAbsoluteEventPump() override;
+
+ // PlatformEventObserver:
+ void SendStartMessage() override;
+ void SendFakeDataForTesting(void* fake_data) override;
+
+ protected:
+ // DeviceSensorEventPump:
+ void FireEvent() override;
+
+ private:
+ // DeviceSensorEventPump:
+ bool CanStart() const override;
+
+ bool GetDataFromSharedMemory(blink::WebDeviceOrientationData* data);
+
+ blink::WebDeviceOrientationData data_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceOrientationAbsoluteEventPump);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_DEVICE_SENSORS_DEVICE_ORIENTATION_ABSOLUTE_EVENT_PUMP_H_

Powered by Google App Engine
This is Rietveld 408576698