OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 DEVICE_SENSOR_SENSOR_MANAGER_H_ |
| 6 #define DEVICE_SENSOR_SENSOR_MANAGER_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "device/sensor/sensor_service.h" |
| 10 |
| 11 namespace device { |
| 12 |
| 13 // Platform specific manager class for fetching sensor data (as of now only |
| 14 // ALS). |
| 15 class SensorManager { |
| 16 public: |
| 17 // Creates a SensorManager object. |callback| should be called when the |
| 18 // ALS reading changes. |
| 19 static scoped_ptr<SensorManager> Create( |
| 20 const SensorService::SensorUpdateCallback& callback); |
| 21 |
| 22 virtual ~SensorManager() {} |
| 23 |
| 24 // Start listening for sensor reading changes. New updates are signalled |
| 25 // by invoking the callback provided at construction time. |
| 26 // Note that this is called in the IO thread. |
| 27 virtual bool StartListeningSensorChange() = 0; |
| 28 |
| 29 // Stop listening for sensor reading changes. |
| 30 // Note that this is called in the IO thread. |
| 31 virtual void StopListeningSensorChange() = 0; |
| 32 }; |
| 33 |
| 34 } // namespace device |
| 35 |
| 36 #endif // DEVICE_SENSOR_SENSOR_MANAGER_H_ |
OLD | NEW |