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

Unified Diff: ash/content/accelerometer/sensor_manager_delegate_chromeos.h

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « ash/content/accelerometer/DEPS ('k') | ash/content/accelerometer/sensor_manager_delegate_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/content/accelerometer/sensor_manager_delegate_chromeos.h
diff --git a/ash/content/accelerometer/sensor_manager_delegate_chromeos.h b/ash/content/accelerometer/sensor_manager_delegate_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..eba343af98906cc8e1f5107a6ed7a9ede177c75e
--- /dev/null
+++ b/ash/content/accelerometer/sensor_manager_delegate_chromeos.h
@@ -0,0 +1,42 @@
+// Copyright 2014 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 ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
+#define ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
+
+#include "content/public/browser/sensor_manager_delegate_chromeos.h"
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "chromeos/accelerometer/accelerometer_reader.h"
+
+namespace ash {
+
+// Chrome OS implementation of the Device Orientation API. Responsible for
+// observing accelerometer events, and notifying content::SensorManagerChromeOS.
+class SensorManagerDelegateChromeOS
+ : public chromeos::AccelerometerReader::Observer,
+ public content::SensorManagerDelegateChromeOS {
+ public:
+ SensorManagerDelegateChromeOS();
+ ~SensorManagerDelegateChromeOS() override;
+
+ // AccelerometerReader::Observer:
+ void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override;
+
+ // content::SensorManagerDelegateChromeOS:
+ void StartFetchingDeviceOrientationData(
+ const content::OrientationDataCallback& callback) override;
+ void StopFetchingDeviceOrientationData() override;
+
+ private:
+ // Callback to direct accelerometer events to.
+ content::OrientationDataCallback orientation_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS);
+};
+
+} // namespace ash
+
+#endif // ASH_CONTENT_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
« no previous file with comments | « ash/content/accelerometer/DEPS ('k') | ash/content/accelerometer/sensor_manager_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698