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 #include "content/browser/geolocation/location_api_adapter_android.h" | 5 #include "content/browser/geolocation/location_api_adapter_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "content/browser/geolocation/location_provider_android.h" | 11 #include "content/browser/geolocation/location_provider_android.h" |
12 #include "jni/LocationProvider_jni.h" | 12 #include "jni/LocationProvider_jni.h" |
13 | 13 |
14 using base::android::AttachCurrentThread; | 14 using base::android::AttachCurrentThread; |
15 using base::android::CheckException; | 15 using base::android::CheckException; |
16 using base::android::ClearException; | 16 using base::android::ClearException; |
17 using base::android::GetMethodID; | |
18 | 17 |
19 static void NewLocationAvailable(JNIEnv* env, jclass, | 18 static void NewLocationAvailable(JNIEnv* env, jclass, |
20 jdouble latitude, | 19 jdouble latitude, |
21 jdouble longitude, | 20 jdouble longitude, |
22 jdouble time_stamp, | 21 jdouble time_stamp, |
23 jboolean has_altitude, jdouble altitude, | 22 jboolean has_altitude, jdouble altitude, |
24 jboolean has_accuracy, jdouble accuracy, | 23 jboolean has_accuracy, jdouble accuracy, |
25 jboolean has_heading, jdouble heading, | 24 jboolean has_heading, jdouble heading, |
26 jboolean has_speed, jdouble speed) { | 25 jboolean has_speed, jdouble speed) { |
27 AndroidLocationApiAdapter::OnNewLocationAvailable(latitude, longitude, | 26 AndroidLocationApiAdapter::OnNewLocationAvailable(latitude, longitude, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 const content::Geoposition& geoposition) { | 150 const content::Geoposition& geoposition) { |
152 base::AutoLock lock(lock_); | 151 base::AutoLock lock(lock_); |
153 if (!message_loop_) | 152 if (!message_loop_) |
154 return; | 153 return; |
155 message_loop_->PostTask( | 154 message_loop_->PostTask( |
156 FROM_HERE, | 155 FROM_HERE, |
157 base::Bind( | 156 base::Bind( |
158 &AndroidLocationApiAdapter::NotifyProviderNewGeoposition, | 157 &AndroidLocationApiAdapter::NotifyProviderNewGeoposition, |
159 geoposition)); | 158 geoposition)); |
160 } | 159 } |
OLD | NEW |