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 CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
6 #define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ | 6 #define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" | 10 #include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" |
11 | 11 |
12 #if !defined(OS_ANDROID) | 12 #if !defined(OS_ANDROID) |
13 #include "content/common/device_sensors/device_light_hardware_buffer.h" | 13 #include "content/common/device_sensors/device_light_hardware_buffer.h" |
14 #include "content/common/device_sensors/device_motion_hardware_buffer.h" | 14 #include "content/common/device_sensors/device_motion_hardware_buffer.h" |
15 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" | 15 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" |
16 #endif | 16 #endif |
17 | 17 |
18 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
19 class SuddenMotionSensor; | 19 class SuddenMotionSensor; |
| 20 namespace device { |
| 21 class AmbientLightSensor; |
| 22 } |
20 #elif defined(OS_WIN) | 23 #elif defined(OS_WIN) |
21 #include <SensorsApi.h> | 24 #include <SensorsApi.h> |
22 #include "base/win/scoped_comptr.h" | 25 #include "base/win/scoped_comptr.h" |
23 #endif | 26 #endif |
24 | 27 |
25 namespace content { | 28 namespace content { |
26 | 29 |
27 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
28 class SensorManagerChromeOS; | 31 class SensorManagerChromeOS; |
29 #elif defined(OS_MACOSX) | |
30 class AmbientLightSensor; | |
31 #endif | 32 #endif |
32 | 33 |
33 class CONTENT_EXPORT DataFetcherSharedMemory | 34 class CONTENT_EXPORT DataFetcherSharedMemory |
34 : public DataFetcherSharedMemoryBase { | 35 : public DataFetcherSharedMemoryBase { |
35 | 36 |
36 public: | 37 public: |
37 DataFetcherSharedMemory(); | 38 DataFetcherSharedMemory(); |
38 ~DataFetcherSharedMemory() override; | 39 ~DataFetcherSharedMemory() override; |
39 | 40 |
40 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
(...skipping 12 matching lines...) Expand all Loading... |
53 #endif | 54 #endif |
54 DeviceOrientationHardwareBuffer* orientation_absolute_buffer_ = nullptr; | 55 DeviceOrientationHardwareBuffer* orientation_absolute_buffer_ = nullptr; |
55 #endif | 56 #endif |
56 | 57 |
57 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
58 std::unique_ptr<SensorManagerChromeOS> sensor_manager_; | 59 std::unique_ptr<SensorManagerChromeOS> sensor_manager_; |
59 #elif defined(OS_MACOSX) | 60 #elif defined(OS_MACOSX) |
60 void Fetch(unsigned consumer_bitmask) override; | 61 void Fetch(unsigned consumer_bitmask) override; |
61 FetcherType GetType() const override; | 62 FetcherType GetType() const override; |
62 | 63 |
63 std::unique_ptr<AmbientLightSensor> ambient_light_sensor_; | 64 std::unique_ptr<device::AmbientLightSensor> ambient_light_sensor_; |
64 std::unique_ptr<SuddenMotionSensor> sudden_motion_sensor_; | 65 std::unique_ptr<SuddenMotionSensor> sudden_motion_sensor_; |
65 #elif defined(OS_WIN) | 66 #elif defined(OS_WIN) |
66 class SensorEventSink; | 67 class SensorEventSink; |
67 class SensorEventSinkMotion; | 68 class SensorEventSinkMotion; |
68 class SensorEventSinkOrientation; | 69 class SensorEventSinkOrientation; |
69 class SensorEventSinkLight; | 70 class SensorEventSinkLight; |
70 | 71 |
71 FetcherType GetType() const override; | 72 FetcherType GetType() const override; |
72 | 73 |
73 bool RegisterForSensor(REFSENSOR_TYPE_ID sensor_type, ISensor** sensor, | 74 bool RegisterForSensor(REFSENSOR_TYPE_ID sensor_type, ISensor** sensor, |
74 scoped_refptr<SensorEventSink> event_sink); | 75 scoped_refptr<SensorEventSink> event_sink); |
75 void DisableSensors(ConsumerType consumer_type); | 76 void DisableSensors(ConsumerType consumer_type); |
76 void SetBufferAvailableState(ConsumerType consumer_type, bool enabled); | 77 void SetBufferAvailableState(ConsumerType consumer_type, bool enabled); |
77 | 78 |
78 base::win::ScopedComPtr<ISensor> sensor_inclinometer_; | 79 base::win::ScopedComPtr<ISensor> sensor_inclinometer_; |
79 base::win::ScopedComPtr<ISensor> sensor_inclinometer_absolute_; | 80 base::win::ScopedComPtr<ISensor> sensor_inclinometer_absolute_; |
80 base::win::ScopedComPtr<ISensor> sensor_accelerometer_; | 81 base::win::ScopedComPtr<ISensor> sensor_accelerometer_; |
81 base::win::ScopedComPtr<ISensor> sensor_gyrometer_; | 82 base::win::ScopedComPtr<ISensor> sensor_gyrometer_; |
82 base::win::ScopedComPtr<ISensor> sensor_light_; | 83 base::win::ScopedComPtr<ISensor> sensor_light_; |
83 #endif | 84 #endif |
84 | 85 |
85 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); | 86 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace content | 89 } // namespace content |
89 | 90 |
90 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ | 91 #endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ |
OLD | NEW |