OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ |
7 | 7 |
8 #include "content/browser/device_orientation/data_fetcher_shared_memory_base.h" | 8 #include "content/browser/device_orientation/data_fetcher_shared_memory_base.h" |
9 | 9 |
10 #if !defined(OS_ANDROID) | 10 #if !defined(OS_ANDROID) |
11 #include "content/common/device_motion_hardware_buffer.h" | 11 #include "content/common/device_motion_hardware_buffer.h" |
12 #include "content/common/device_orientation/device_orientation_hardware_buffer.h
" | 12 #include "content/common/device_orientation/device_orientation_hardware_buffer.h
" |
13 #endif | 13 #endif |
14 | 14 |
15 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
16 class SuddenMotionSensor; | 16 class SuddenMotionSensor; |
| 17 #elif defined(OS_WIN) |
| 18 #include <SensorsApi.h> |
| 19 #include "base/win/scoped_comptr.h" |
17 #endif | 20 #endif |
18 | 21 |
19 namespace content { | 22 namespace content { |
20 | 23 |
21 class CONTENT_EXPORT DataFetcherSharedMemory | 24 class CONTENT_EXPORT DataFetcherSharedMemory |
22 : public DataFetcherSharedMemoryBase { | 25 : public DataFetcherSharedMemoryBase { |
23 | 26 |
24 public: | 27 public: |
25 DataFetcherSharedMemory(); | 28 DataFetcherSharedMemory(); |
26 virtual ~DataFetcherSharedMemory(); | 29 virtual ~DataFetcherSharedMemory(); |
27 | 30 |
28 private: | 31 private: |
29 virtual bool Start(ConsumerType consumer_type, void* buffer) OVERRIDE; | 32 virtual bool Start(ConsumerType consumer_type, void* buffer) OVERRIDE; |
30 virtual bool Stop(ConsumerType consumer_type) OVERRIDE; | 33 virtual bool Stop(ConsumerType consumer_type) OVERRIDE; |
31 | 34 |
32 #if !defined(OS_ANDROID) | 35 #if !defined(OS_ANDROID) |
33 DeviceMotionHardwareBuffer* motion_buffer_; | 36 DeviceMotionHardwareBuffer* motion_buffer_; |
34 DeviceOrientationHardwareBuffer* orientation_buffer_; | 37 DeviceOrientationHardwareBuffer* orientation_buffer_; |
35 #endif | 38 #endif |
36 #if defined(OS_MACOSX) | 39 #if defined(OS_MACOSX) |
37 virtual void Fetch(unsigned consumer_bitmask) OVERRIDE; | 40 virtual void Fetch(unsigned consumer_bitmask) OVERRIDE; |
38 virtual bool IsPolling() const OVERRIDE; | 41 virtual bool IsPolling() const OVERRIDE; |
39 | 42 |
40 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; | 43 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; |
| 44 #elif defined(OS_WIN) |
| 45 class SensorEventSink; |
| 46 friend SensorEventSink; |
| 47 |
| 48 base::win::ScopedComPtr<ISensor> sensor_; |
41 #endif | 49 #endif |
42 | 50 |
43 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); | 51 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); |
44 }; | 52 }; |
45 | 53 |
46 } // namespace content | 54 } // namespace content |
47 | 55 |
48 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ | 56 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_SHARED_MEMORY_H_ |
OLD | NEW |