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

Side by Side Diff: device/geolocation/location_provider_android.cc

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into lai Created 4 years, 4 months 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 "device/geolocation/location_provider_android.h" 5 #include "device/geolocation/location_provider_android.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "device/geolocation/geoposition.h" 9 #include "device/geolocation/geoposition.h"
10 #include "device/geolocation/location_api_adapter_android.h" 10 #include "device/geolocation/location_api_adapter_android.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 bool LocationProviderAndroid::StartProvider(bool high_accuracy) { 27 bool LocationProviderAndroid::StartProvider(bool high_accuracy) {
28 return AndroidLocationApiAdapter::GetInstance()->Start(this, high_accuracy); 28 return AndroidLocationApiAdapter::GetInstance()->Start(this, high_accuracy);
29 } 29 }
30 30
31 void LocationProviderAndroid::StopProvider() { 31 void LocationProviderAndroid::StopProvider() {
32 AndroidLocationApiAdapter::GetInstance()->Stop(); 32 AndroidLocationApiAdapter::GetInstance()->Stop();
33 } 33 }
34 34
35 void LocationProviderAndroid::GetPosition(Geoposition* position) { 35 const Geoposition& LocationProviderAndroid::GetPosition() {
36 *position = last_position_; 36 return last_position_;
37 } 37 }
38 38
39 void LocationProviderAndroid::RequestRefresh() { 39 void LocationProviderAndroid::RequestRefresh() {
40 // Nothing to do here, android framework will call us back on new position. 40 // Nothing to do here, android framework will call us back on new position.
41 } 41 }
42 42
43 void LocationProviderAndroid::OnPermissionGranted() { 43 void LocationProviderAndroid::OnPermissionGranted() {
44 // Nothing to do here. 44 // Nothing to do here.
45 } 45 }
46 46
47 // static 47 // static
48 std::unique_ptr<LocationProvider> NewSystemLocationProvider() { 48 std::unique_ptr<LocationProvider> NewSystemLocationProvider() {
49 return base::WrapUnique(new LocationProviderAndroid); 49 return base::WrapUnique(new LocationProviderAndroid);
50 } 50 }
51 51
52 } // namespace device 52 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698