| 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_READER_WIN_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_READER_WIN_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_READER_WIN_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_READER_WIN_H_ |
| 7 | 7 |
| 8 #include <SensorsApi.h> | 8 #include <SensorsApi.h> |
| 9 | 9 |
| 10 #include "base/win/scoped_comptr.h" | 10 #include "base/win/scoped_comptr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual ~Client() {} | 32 virtual ~Client() {} |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 static std::unique_ptr<PlatformSensorReaderWin> Create( | 35 static std::unique_ptr<PlatformSensorReaderWin> Create( |
| 36 mojom::SensorType type, | 36 mojom::SensorType type, |
| 37 base::win::ScopedComPtr<ISensorManager> sensor_manager); | 37 base::win::ScopedComPtr<ISensorManager> sensor_manager); |
| 38 | 38 |
| 39 // Following methods are thread safe. | 39 // Following methods are thread safe. |
| 40 void SetClient(Client* client); | 40 void SetClient(Client* client); |
| 41 unsigned long GetMinimalReportingIntervalMs() const; | 41 unsigned long GetMinimalReportingIntervalMs() const; |
| 42 mojom::ReportingMode GetReportingMode() const; | |
| 43 bool StartSensor(const PlatformSensorConfiguration& configuration); | 42 bool StartSensor(const PlatformSensorConfiguration& configuration); |
| 44 void StopSensor(); | 43 void StopSensor(); |
| 45 | 44 |
| 46 // Must be destructed on the same thread that was used during construction. | 45 // Must be destructed on the same thread that was used during construction. |
| 47 ~PlatformSensorReaderWin(); | 46 ~PlatformSensorReaderWin(); |
| 48 | 47 |
| 49 private: | 48 private: |
| 50 PlatformSensorReaderWin(base::win::ScopedComPtr<ISensor> sensor, | 49 PlatformSensorReaderWin(base::win::ScopedComPtr<ISensor> sensor, |
| 51 std::unique_ptr<ReaderInitParams> params); | 50 std::unique_ptr<ReaderInitParams> params); |
| 52 | 51 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 72 Client* client_; | 71 Client* client_; |
| 73 base::win::ScopedComPtr<ISensor> sensor_; | 72 base::win::ScopedComPtr<ISensor> sensor_; |
| 74 scoped_refptr<EventListener> event_listener_; | 73 scoped_refptr<EventListener> event_listener_; |
| 75 | 74 |
| 76 DISALLOW_COPY_AND_ASSIGN(PlatformSensorReaderWin); | 75 DISALLOW_COPY_AND_ASSIGN(PlatformSensorReaderWin); |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 } // namespace device | 78 } // namespace device |
| 80 | 79 |
| 81 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_READER_WIN_H_ | 80 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_READER_WIN_H_ |
| OLD | NEW |