| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 virtual void OnSensorReadingChanged() = 0; | 30 virtual void OnSensorReadingChanged() = 0; |
| 31 virtual void OnSensorError() = 0; | 31 virtual void OnSensorError() = 0; |
| 32 virtual bool IsNotificationSuspended() = 0; | 32 virtual bool IsNotificationSuspended() = 0; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 virtual ~Client() {} | 35 virtual ~Client() {} |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 virtual mojom::ReportingMode GetReportingMode() = 0; | 38 virtual mojom::ReportingMode GetReportingMode() = 0; |
| 39 virtual PlatformSensorConfiguration GetDefaultConfiguration() = 0; |
| 39 | 40 |
| 40 mojom::SensorType GetType() const; | 41 mojom::SensorType GetType() const; |
| 41 | 42 |
| 42 bool StartListening(Client* client, | 43 bool StartListening(Client* client, |
| 43 const PlatformSensorConfiguration& config); | 44 const PlatformSensorConfiguration& config); |
| 44 bool StopListening(Client* client, const PlatformSensorConfiguration& config); | 45 bool StopListening(Client* client, const PlatformSensorConfiguration& config); |
| 45 | 46 |
| 46 void UpdateSensor(); | 47 void UpdateSensor(); |
| 47 | 48 |
| 48 void AddClient(Client*); | 49 void AddClient(Client*); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 base::ObserverList<Client, true> clients_; | 73 base::ObserverList<Client, true> clients_; |
| 73 ConfigMap config_map_; | 74 ConfigMap config_map_; |
| 74 PlatformSensorProvider* provider_; | 75 PlatformSensorProvider* provider_; |
| 75 base::WeakPtrFactory<PlatformSensor> weak_factory_; | 76 base::WeakPtrFactory<PlatformSensor> weak_factory_; |
| 76 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); | 77 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 } // namespace device | 80 } // namespace device |
| 80 | 81 |
| 81 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 82 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| OLD | NEW |