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

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

Issue 2144623003: [sensors] Introduce Generic Sensor API interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Definition for PlatformSensorProvider ctor/dtor Created 4 years, 3 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
« no previous file with comments | « device/generic_sensor/sensor_impl.cc ('k') | device/generic_sensor/sensor_provider_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PROVIDER_IMPL_H_
6 #define DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_
7
8 #include "base/macros.h"
9 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom.h"
10 #include "device/generic_sensor/sensor_export.h"
11 #include "mojo/public/cpp/bindings/strong_binding.h"
12
13 namespace device {
14
15 class PlatformSensorProvider;
16
17 // Implementation of SensorProvider mojo interface.
18 // Uses PlatformSensorProvider singleton to create platform specific instances
19 // of PlatformSensor which are used by SensorImpl.
20 class SensorProviderImpl final : public mojom::SensorProvider {
21 public:
22 DEVICE_SENSOR_EXPORT static void Create(
23 mojo::InterfaceRequest<mojom::SensorProvider> request);
24
25 ~SensorProviderImpl() override;
26
27 private:
28 SensorProviderImpl(mojo::InterfaceRequest<mojom::SensorProvider> request,
29 PlatformSensorProvider* provider);
30
31 // SensorProvider implementation.
32 void GetSensor(mojom::SensorType type,
33 mojom::SensorRequest sensor_request,
34 const GetSensorCallback& callback) override;
35
36 mojo::StrongBinding<mojom::SensorProvider> binding_;
37 PlatformSensorProvider* provider_;
38 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl);
39 };
40
41 } // namespace device
42
43 #endif // DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « device/generic_sensor/sensor_impl.cc ('k') | device/generic_sensor/sensor_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698