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" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 base::AutoLock lock(lock_); | 153 base::AutoLock lock(lock_); |
154 if (!message_loop_.get()) | 154 if (!message_loop_.get()) |
155 return; | 155 return; |
156 message_loop_->PostTask( | 156 message_loop_->PostTask( |
157 FROM_HERE, | 157 FROM_HERE, |
158 base::Bind( | 158 base::Bind( |
159 &AndroidLocationApiAdapter::NotifyProviderNewGeoposition, | 159 &AndroidLocationApiAdapter::NotifyProviderNewGeoposition, |
160 geoposition)); | 160 geoposition)); |
161 } | 161 } |
162 | 162 |
| 163 void AndroidLocationApiAdapter::Pause() { |
| 164 JNIEnv* env = AttachCurrentThread(); |
| 165 Java_LocationProvider_pause(env, |
| 166 java_location_provider_android_object_.obj()); |
| 167 } |
| 168 |
| 169 void AndroidLocationApiAdapter::Resume() { |
| 170 JNIEnv* env = AttachCurrentThread(); |
| 171 Java_LocationProvider_resume(env, |
| 172 java_location_provider_android_object_.obj()); |
| 173 } |
| 174 |
163 } // namespace content | 175 } // namespace content |
OLD | NEW |