Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: device/generic_sensor/sensor_impl.h

Issue 2865263002: Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: code rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_GENERIC_SENSOR_SENSOR_IMPL_H_
6 #define DEVICE_GENERIC_SENSOR_SENSOR_IMPL_H_
7
8 #include "base/macros.h"
9 #include "device/generic_sensor/platform_sensor.h"
10 #include "device/generic_sensor/public/interfaces/sensor.mojom.h"
11
12 namespace device {
13
14 // Implementation of Sensor mojo interface.
15 // Instances of this class are created by SensorProviderImpl.
16 class SensorImpl final : public mojom::Sensor, public PlatformSensor::Client {
17 public:
18 explicit SensorImpl(scoped_refptr<PlatformSensor> sensor);
19 ~SensorImpl() override;
20
21 mojom::SensorClientRequest GetClient();
22
23 private:
24 // Sensor implementation.
25 void AddConfiguration(const PlatformSensorConfiguration& configuration,
26 const AddConfigurationCallback& callback) override;
27 void GetDefaultConfiguration(
28 const GetDefaultConfigurationCallback& callback) override;
29 void RemoveConfiguration(
30 const PlatformSensorConfiguration& configuration,
31 const RemoveConfigurationCallback& callback) override;
32 void Suspend() override;
33 void Resume() override;
34
35 // device::Sensor::Client implementation.
36 void OnSensorReadingChanged() override;
37 void OnSensorError() override;
38 bool IsNotificationSuspended() override;
39
40 private:
41 scoped_refptr<PlatformSensor> sensor_;
42 mojom::SensorClientPtr client_;
43 bool suspended_;
44
45 DISALLOW_COPY_AND_ASSIGN(SensorImpl);
46 };
47
48 } // namespace device
49
50 #endif // DEVICE_GENERIC_SENSOR_SENSOR_IMPL_H_
OLDNEW
« no previous file with comments | « device/generic_sensor/public/interfaces/typemaps.gni ('k') | device/generic_sensor/sensor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698