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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <jni.h> | 9 #include <jni.h> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 void GotOrientation(JNIEnv*, jobject, | 38 void GotOrientation(JNIEnv*, jobject, |
39 double alpha, double beta, double gamma); | 39 double alpha, double beta, double gamma); |
40 | 40 |
41 // Implementation of DataFetcher. | 41 // Implementation of DataFetcher. |
42 virtual bool GetOrientation(Orientation* orientation) OVERRIDE; | 42 virtual bool GetOrientation(Orientation* orientation) OVERRIDE; |
43 | 43 |
44 private: | 44 private: |
45 DataFetcherImplAndroid(); | 45 DataFetcherImplAndroid(); |
46 | 46 |
47 // Wrappers for JNI methods. | 47 // Wrappers for JNI methods. |
48 bool Start(int rateInMilliseconds); | 48 bool Start(int rate_in_milliseconds); |
49 void Stop(); | 49 void Stop(); |
50 | 50 |
51 // Value returned by GetOrientation. | 51 // Value returned by GetOrientation. |
52 scoped_ptr<Orientation> current_orientation_; | 52 scoped_ptr<Orientation> current_orientation_; |
53 | 53 |
54 // 1-element buffer, written by GotOrientation, read by GetOrientation. | 54 // 1-element buffer, written by GotOrientation, read by GetOrientation. |
55 base::Lock next_orientation_lock_; | 55 base::Lock next_orientation_lock_; |
56 scoped_ptr<Orientation> next_orientation_; | 56 scoped_ptr<Orientation> next_orientation_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid); | 58 DISALLOW_COPY_AND_ASSIGN(DataFetcherImplAndroid); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace device_orientation | 61 } // namespace device_orientation |
62 | 62 |
63 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ | 63 #endif // CHROME_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_IMPL_ANDROID_H_ |
OLD | NEW |