OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ | 5 #ifndef DEVICE_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
6 #define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ | 6 #define DEVICE_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
7 | 7 |
8 #include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" | 8 #include "device/device_sensors/data_fetcher_shared_memory_base.h" |
9 | 9 |
10 #if !defined(OS_ANDROID) | 10 #if !defined(OS_ANDROID) |
11 #include "content/common/device_sensors/device_light_hardware_buffer.h" | 11 #include "device/device_sensors/device_light_hardware_buffer.h" |
12 #include "content/common/device_sensors/device_motion_hardware_buffer.h" | 12 #include "device/device_sensors/device_motion_hardware_buffer.h" |
13 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" | 13 #include "device/device_sensors/device_orientation_hardware_buffer.h" |
14 #endif | 14 #endif |
15 | 15 |
16 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
17 class SuddenMotionSensor; | 17 class SuddenMotionSensor; |
18 #elif defined(OS_WIN) | 18 #elif defined(OS_WIN) |
19 #include <SensorsApi.h> | 19 #include <SensorsApi.h> |
20 #include "base/win/scoped_comptr.h" | 20 #include "base/win/scoped_comptr.h" |
21 #endif | 21 #endif |
22 | 22 |
23 namespace content { | 23 namespace device { |
24 | 24 |
25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
26 class SensorManagerChromeOS; | 26 class SensorManagerChromeOS; |
27 #elif defined(OS_MACOSX) | 27 #elif defined(OS_MACOSX) |
28 class AmbientLightSensor; | 28 class AmbientLightSensor; |
29 #endif | 29 #endif |
30 | 30 |
31 class CONTENT_EXPORT DataFetcherSharedMemory | 31 class DEVICE_SENSORS_EXPORT DataFetcherSharedMemory |
32 : public DataFetcherSharedMemoryBase { | 32 : public DataFetcherSharedMemoryBase { |
33 | |
34 public: | 33 public: |
35 DataFetcherSharedMemory(); | 34 DataFetcherSharedMemory(); |
36 ~DataFetcherSharedMemory() override; | 35 ~DataFetcherSharedMemory() override; |
37 | 36 |
38 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
39 void Shutdown() override; | 38 void Shutdown() override; |
40 #endif | 39 #endif |
41 | 40 |
42 private: | 41 private: |
43 bool Start(ConsumerType consumer_type, void* buffer) override; | 42 bool Start(ConsumerType consumer_type, void* buffer) override; |
(...skipping 14 matching lines...) Expand all Loading... |
58 scoped_ptr<AmbientLightSensor> ambient_light_sensor_; | 57 scoped_ptr<AmbientLightSensor> ambient_light_sensor_; |
59 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; | 58 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; |
60 #elif defined(OS_WIN) | 59 #elif defined(OS_WIN) |
61 class SensorEventSink; | 60 class SensorEventSink; |
62 class SensorEventSinkMotion; | 61 class SensorEventSinkMotion; |
63 class SensorEventSinkOrientation; | 62 class SensorEventSinkOrientation; |
64 class SensorEventSinkLight; | 63 class SensorEventSinkLight; |
65 | 64 |
66 FetcherType GetType() const override; | 65 FetcherType GetType() const override; |
67 | 66 |
68 bool RegisterForSensor(REFSENSOR_TYPE_ID sensor_type, ISensor** sensor, | 67 bool RegisterForSensor(REFSENSOR_TYPE_ID sensor_type, |
69 scoped_refptr<SensorEventSink> event_sink); | 68 ISensor** sensor, |
| 69 scoped_refptr<SensorEventSink> event_sink); |
70 void DisableSensors(ConsumerType consumer_type); | 70 void DisableSensors(ConsumerType consumer_type); |
71 void SetBufferAvailableState(ConsumerType consumer_type, bool enabled); | 71 void SetBufferAvailableState(ConsumerType consumer_type, bool enabled); |
72 | 72 |
73 base::win::ScopedComPtr<ISensor> sensor_inclinometer_; | 73 base::win::ScopedComPtr<ISensor> sensor_inclinometer_; |
74 base::win::ScopedComPtr<ISensor> sensor_accelerometer_; | 74 base::win::ScopedComPtr<ISensor> sensor_accelerometer_; |
75 base::win::ScopedComPtr<ISensor> sensor_gyrometer_; | 75 base::win::ScopedComPtr<ISensor> sensor_gyrometer_; |
76 base::win::ScopedComPtr<ISensor> sensor_light_; | 76 base::win::ScopedComPtr<ISensor> sensor_light_; |
77 #endif | 77 #endif |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); | 79 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace content | 82 } // namespace device |
83 | 83 |
84 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ | 84 #endif // DEVICE_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
OLD | NEW |