Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: content/browser/geolocation/location_api_adapter_android.cc

Issue 65273002: Add a mechanism to pause and resume geolocation requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wire up onPause/onResume Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698