Chromium Code Reviews| 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 | |
|
Charlie Reis
2014/12/10 01:02:41
"For platforms with" vs "ChromeOS" in the class na
| |
| 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) | |
|
Charlie Reis
2014/12/10 01:02:41
Avoiding this delegate in the public interface wou
jonross
2014/12/10 13:58:27
It's a decent amount of work. I had been planning
jam
2014/12/10 21:57:05
can you explain some more on what work is needed?
jonross
2014/12/10 23:06:21
My end goal is to have the ChromeOS accelerometer
| |
| 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 |