| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/geolocation/location_provider_android.h" |
| 6 |
| 7 #include "base/time.h" |
| 8 #include "content/browser/geolocation/android_location_api_adapter.h" |
| 9 #include "content/common/geoposition.h" |
| 10 |
| 11 // LocationProviderAndroid |
| 12 LocationProviderAndroid::LocationProviderAndroid() { |
| 13 } |
| 14 |
| 15 LocationProviderAndroid::~LocationProviderAndroid() { |
| 16 StopProvider(); |
| 17 } |
| 18 |
| 19 void LocationProviderAndroid::NotifyNewGeoposition( |
| 20 const Geoposition& position) { |
| 21 last_position_ = position; |
| 22 UpdateListeners(); |
| 23 } |
| 24 |
| 25 bool LocationProviderAndroid::StartProvider(bool high_accuracy) { |
| 26 return AndroidLocationApiAdapter::GetInstance()->Start(this, high_accuracy); |
| 27 } |
| 28 |
| 29 void LocationProviderAndroid::StopProvider() { |
| 30 AndroidLocationApiAdapter::GetInstance()->Stop(); |
| 31 } |
| 32 |
| 33 void LocationProviderAndroid::GetPosition(Geoposition* position) { |
| 34 *position = last_position_; |
| 35 } |
| 36 |
| 37 void LocationProviderAndroid::UpdatePosition() { |
| 38 // Nothing to do here, android framework will call us back on new position. |
| 39 } |
| 40 |
| 41 void LocationProviderAndroid::OnPermissionGranted( |
| 42 const GURL& requesting_frame) { |
| 43 // Nothing to do here. |
| 44 } |
| 45 |
| 46 LocationProviderBase* NewSystemLocationProvider() { |
| 47 return new LocationProviderAndroid; |
| 48 } |
| OLD | NEW |