Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 virtual void OnSensorError() = 0; | 34 virtual void OnSensorError() = 0; |
| 35 virtual bool IsNotificationSuspended() = 0; | 35 virtual bool IsNotificationSuspended() = 0; |
| 36 | 36 |
| 37 protected: | 37 protected: |
| 38 virtual ~Client() {} | 38 virtual ~Client() {} |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 virtual mojom::ReportingMode GetReportingMode() = 0; | 41 virtual mojom::ReportingMode GetReportingMode() = 0; |
| 42 virtual PlatformSensorConfiguration GetDefaultConfiguration() = 0; | 42 virtual PlatformSensorConfiguration GetDefaultConfiguration() = 0; |
| 43 | 43 |
| 44 // Can be overriden to return the sensor maximum reading update frequency | |
| 45 // value obtained from the platfrom. | |
| 46 // If this information is unavailable '0.0' is returned. | |
|
darktears
2016/11/02 23:06:09
This sounds weird. I mean I would expect the defau
Mikhail
2016/11/03 12:13:17
I'm not sure we should confuse device capabilities
| |
| 47 // The default implemenmtation returns '0.0'. | |
|
darktears
2016/11/02 23:06:09
Typo here.
Mikhail
2016/11/03 12:13:17
Done.
| |
| 48 virtual double GetMaximumSupportedFrequency(); | |
| 49 | |
| 44 mojom::SensorType GetType() const; | 50 mojom::SensorType GetType() const; |
| 45 | 51 |
| 46 bool StartListening(Client* client, | 52 bool StartListening(Client* client, |
| 47 const PlatformSensorConfiguration& config); | 53 const PlatformSensorConfiguration& config); |
| 48 bool StopListening(Client* client, const PlatformSensorConfiguration& config); | 54 bool StopListening(Client* client, const PlatformSensorConfiguration& config); |
| 49 | 55 |
| 50 void UpdateSensor(); | 56 void UpdateSensor(); |
| 51 | 57 |
| 52 void AddClient(Client*); | 58 void AddClient(Client*); |
| 53 void RemoveClient(Client*); | 59 void RemoveClient(Client*); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 base::ObserverList<Client, true> clients_; | 96 base::ObserverList<Client, true> clients_; |
| 91 ConfigMap config_map_; | 97 ConfigMap config_map_; |
| 92 PlatformSensorProvider* provider_; | 98 PlatformSensorProvider* provider_; |
| 93 base::WeakPtrFactory<PlatformSensor> weak_factory_; | 99 base::WeakPtrFactory<PlatformSensor> weak_factory_; |
| 94 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); | 100 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); |
| 95 }; | 101 }; |
| 96 | 102 |
| 97 } // namespace device | 103 } // namespace device |
| 98 | 104 |
| 99 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 105 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| OLD | NEW |