OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 10 #include "content/common/content_export.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 typedef base::Callback<void(double x, double y, double z)> |
| 15 OrientationDataCallback; |
| 16 |
| 17 // For platforms with a push API for accelerometer sensors this delegate can be |
| 18 // implemented. Once notified to start fetching data, the callback provided can |
| 19 // be used to send the data. |
| 20 // TODO(jonross): Once accelerometer reading has been moved to |
| 21 // content/browser/device_sensors/ remove this delegate. Instead have |
| 22 // content/public/browser expose an observer for ChromeOS. (crbug.com/431865) |
| 23 class CONTENT_EXPORT SensorManagerDelegateChromeOS { |
| 24 public: |
| 25 virtual ~SensorManagerDelegateChromeOS(); |
| 26 |
| 27 // Allows platforms to provide a delegate. |
| 28 static void SetDelegate(SensorManagerDelegateChromeOS* delegate); |
| 29 |
| 30 // Start processing accelerometer events for orientation. The values can be |
| 31 // passed via |callback| |
| 32 virtual void StartFetchingDeviceOrientationData( |
| 33 const OrientationDataCallback& callback) = 0; |
| 34 |
| 35 // Stop processing accelerometer events for orientation. |
| 36 virtual void StopFetchingDeviceOrientationData() = 0; |
| 37 |
| 38 protected: |
| 39 SensorManagerDelegateChromeOS(); |
| 40 |
| 41 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS); |
| 43 }; |
| 44 |
| 45 } // namespace content |
| 46 |
| 47 #endif // CONTENT_PUBLIC_BROWSER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ |
OLD | NEW |