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_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // Returns our singleton. | 43 // Returns our singleton. |
44 static AndroidLocationApiAdapter* GetInstance(); | 44 static AndroidLocationApiAdapter* GetInstance(); |
45 | 45 |
46 // Called when initializing chrome_view to obtain a pointer to the java class. | 46 // Called when initializing chrome_view to obtain a pointer to the java class. |
47 static bool RegisterGeolocationService(JNIEnv* env); | 47 static bool RegisterGeolocationService(JNIEnv* env); |
48 | 48 |
49 // Called by JNI on main thread looper. | 49 // Called by JNI on main thread looper. |
50 static void OnNewLocationAvailable(double latitude, | 50 static void OnNewLocationAvailable(double latitude, |
51 double longitude, | 51 double longitude, |
52 long time_stamp, | 52 double time_stamp, |
53 bool has_altitude, double altitude, | 53 bool has_altitude, double altitude, |
54 bool has_accuracy, double accuracy, | 54 bool has_accuracy, double accuracy, |
55 bool has_heading, double heading, | 55 bool has_heading, double heading, |
56 bool has_speed, double speed); | 56 bool has_speed, double speed); |
57 static void OnNewErrorAvailable(JNIEnv* env, jstring message); | 57 static void OnNewErrorAvailable(JNIEnv* env, jstring message); |
58 | 58 |
59 private: | 59 private: |
60 friend struct DefaultSingletonTraits<AndroidLocationApiAdapter>; | 60 friend struct DefaultSingletonTraits<AndroidLocationApiAdapter>; |
61 AndroidLocationApiAdapter(); | 61 AndroidLocationApiAdapter(); |
62 ~AndroidLocationApiAdapter(); | 62 ~AndroidLocationApiAdapter(); |
(...skipping 11 matching lines...) Expand all Loading... |
74 java_location_provider_android_object_; | 74 java_location_provider_android_object_; |
75 LocationProviderAndroid* location_provider_; | 75 LocationProviderAndroid* location_provider_; |
76 | 76 |
77 // Guards against the following member which is accessed on Geolocation | 77 // Guards against the following member which is accessed on Geolocation |
78 // thread and the JNI main thread looper. | 78 // thread and the JNI main thread looper. |
79 base::Lock lock_; | 79 base::Lock lock_; |
80 scoped_refptr<base::MessageLoopProxy> message_loop_; | 80 scoped_refptr<base::MessageLoopProxy> message_loop_; |
81 }; | 81 }; |
82 | 82 |
83 #endif // CONTENT_BROWSER_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ | 83 #endif // CONTENT_BROWSER_GEOLOCATION_ANDROID_LOCATION_API_ADAPTER_H_ |
OLD | NEW |