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

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

Issue 10209003: Upstream Android Geolocation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add OWNERS Created 8 years, 7 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
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698