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

Unified Diff: content/public/browser/sensor_manager_delegate_chromeos.h

Issue 680383007: DeviceOrientation API on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/public/browser/sensor_manager_delegate_chromeos.h
diff --git a/content/public/browser/sensor_manager_delegate_chromeos.h b/content/public/browser/sensor_manager_delegate_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..cf3271a02260be0f65e856a898aa415c80766527
--- /dev/null
+++ b/content/public/browser/sensor_manager_delegate_chromeos.h
@@ -0,0 +1,47 @@
+// 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 CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
+#define CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+typedef base::Callback<void(double x, double y, double z)>
+ OrientationDataCallback;
+
+// For platforms with a push API for accelerometer sensors this delegate can be
+// implemented. Once notified to start fetching data, the callback provided can
+// be used to send the data.
+// TODO(jonross): Once accelerometer reading has been moved to
+// content/browser/device_sensors/ remove this delegate. Instead have
+// content/public/browser expose an observer for ChromeOS. crbug.com/431865
timvolodine 2014/12/03 13:19:55 nit: ". crbug.com/431865" -> "(crbug.com/431865)."
jonross 2014/12/03 14:43:58 Done.
+class CONTENT_EXPORT SensorManagerDelegateChromeOS {
+ public:
+ virtual ~SensorManagerDelegateChromeOS();
+
+ // Allows platforms to provide a delegate.
+ static void SetDelegate(SensorManagerDelegateChromeOS* delegate);
+
+ // Start processing accelerometer events for orientation. The values can be
+ // passed via |callback|
+ virtual void StartFetchingDeviceOrientationData(
+ const OrientationDataCallback& callback) = 0;
+
+ // Stop processing accelerometer events for orientation.
+ virtual void StopFetchingDeviceOrientationData() = 0;
+
+ protected:
+ SensorManagerDelegateChromeOS();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698