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 CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ |
6 #define CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ | 6 #define CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 private: | 50 private: |
51 DataFetcherImplAndroid(); | 51 DataFetcherImplAndroid(); |
52 const Orientation* GetOrientation(); | 52 const Orientation* GetOrientation(); |
53 | 53 |
54 // Wrappers for JNI methods. | 54 // Wrappers for JNI methods. |
55 // TODO(timvolodine): move the DeviceData::Type enum to the service class | 55 // TODO(timvolodine): move the DeviceData::Type enum to the service class |
56 // once it is implemented. | 56 // once it is implemented. |
57 bool Start(DeviceData::Type event_type, int rate_in_milliseconds); | 57 bool Start(DeviceData::Type event_type, int rate_in_milliseconds); |
58 void Stop(DeviceData::Type event_type); | 58 void Stop(DeviceData::Type event_type); |
59 | 59 |
| 60 virtual int GetNumberActiveDeviceMotionSensors(); |
| 61 |
60 // Value returned by GetDeviceData. | 62 // Value returned by GetDeviceData. |
61 scoped_refptr<Orientation> current_orientation_; | 63 scoped_refptr<Orientation> current_orientation_; |
62 | 64 |
63 // 1-element buffer, written by GotOrientation, read by GetDeviceData. | 65 // 1-element buffer, written by GotOrientation, read by GetDeviceData. |
64 base::Lock next_orientation_lock_; | 66 base::Lock next_orientation_lock_; |
65 scoped_refptr<Orientation> next_orientation_; | 67 scoped_refptr<Orientation> next_orientation_; |
66 | 68 |
67 // The Java provider of orientation info. | 69 // The Java provider of orientation info. |
68 base::android::ScopedJavaGlobalRef<jobject> device_orientation_; | 70 base::android::ScopedJavaGlobalRef<jobject> device_orientation_; |
69 | 71 |
70 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid); | 72 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid); |
71 }; | 73 }; |
72 | 74 |
73 } // namespace content | 75 } // namespace content |
74 | 76 |
75 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ | 77 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ |
OLD | NEW |