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 ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ | |
| 6 #define ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ | |
| 7 | |
| 8 #include "content/public/browser/sensor_manager_delegate.h" | |
| 9 | |
| 10 #include "ash/accelerometer/accelerometer_observer.h" | |
| 11 #include "base/callback.h" | |
| 12 #include "base/macros.h" | |
| 13 | |
| 14 namespace ash { | |
| 15 | |
| 16 // Chrome OS implementation of the Device Orientation API. Responsible for | |
| 17 // observing accelerometer events, and notifying content::SensorManagerChromeOS. | |
| 18 class SensorManagerDelegateChromeOS : public AccelerometerObserver, | |
| 19 public content::SensorManagerDelegate { | |
| 20 public: | |
| 21 SensorManagerDelegateChromeOS(); | |
| 22 ~SensorManagerDelegateChromeOS() override; | |
| 23 | |
| 24 // AccelerometerObserver: | |
| 25 void OnAccelerometerUpdated(const ui::AccelerometerUpdate& update) override; | |
| 26 | |
| 27 // content::SensorManagerDelegate: | |
| 28 void StartFetchingDeviceOrientationData( | |
| 29 const base::Callback<void(double, double, double)>& callback) override; | |
| 30 void StopFetchingDeviceOrientationData() override; | |
| 31 | |
| 32 private: | |
| 33 // Callback to direct accelerometer events to. | |
| 34 base::Callback<void(double, double, double)> orientation_callback_; | |
| 35 | |
| 36 // True if actively observing events. | |
| 37 bool observing_accelerometer_; | |
|
flackr
2014/11/13 00:07:34
This should be the same as orientation_callback_.i
jonross
2014/11/13 01:34:05
Done.
| |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(SensorManagerDelegateChromeOS); | |
| 40 }; | |
| 41 | |
| 42 } // namespace ash | |
| 43 | |
| 44 #endif // ASH_ACCELEROMETER_SENSOR_MANAGER_DELEGATE_CHROMEOS_H_ | |
| OLD | NEW |