OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ACCELEROMETER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_ |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_ | 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/device_orientation/data_fetcher.h" | 13 #include "content/browser/device_orientation/data_fetcher.h" |
14 | 14 |
15 class SuddenMotionSensor; | 15 class SuddenMotionSensor; |
16 | 16 |
17 namespace device_orientation { | 17 namespace device_orientation { |
18 | 18 |
19 class AccelerometerMac : public DataFetcher { | 19 class AccelerometerMac : public DataFetcher { |
20 public: | 20 public: |
21 static DataFetcher* Create(); | 21 static DataFetcher* Create(); |
22 | 22 |
23 // Implement DataFetcher. | 23 // Implement DataFetcher. |
| 24 virtual bool GetMotion(Motion* motion) OVERRIDE; |
24 virtual bool GetOrientation(Orientation* orientation) OVERRIDE; | 25 virtual bool GetOrientation(Orientation* orientation) OVERRIDE; |
25 | 26 |
26 virtual ~AccelerometerMac(); | 27 virtual ~AccelerometerMac(); |
27 | 28 |
28 private: | 29 private: |
29 AccelerometerMac(); | 30 AccelerometerMac(); |
30 bool Init(); | 31 bool Init(); |
31 | 32 |
32 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; | 33 scoped_ptr<SuddenMotionSensor> sudden_motion_sensor_; |
33 }; | 34 }; |
34 | 35 |
35 } // namespace device_orientation | 36 } // namespace device_orientation |
36 | 37 |
37 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_ | 38 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ACCELEROMETER_MAC_H_ |
OLD | NEW |