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

Unified 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: Fix license year (->2012) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/geolocation/location_provider_android.h ('k') | content/content.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/geolocation/location_provider_android.cc
diff --git a/content/browser/geolocation/location_provider_android.cc b/content/browser/geolocation/location_provider_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8628679754faf0594b2bf1afd79d7b1e1fe76252
--- /dev/null
+++ b/content/browser/geolocation/location_provider_android.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/geolocation/location_provider_android.h"
+
+#include "base/time.h"
+#include "content/browser/geolocation/location_api_adapter_android.h"
+#include "content/public/common/geoposition.h"
+
+// LocationProviderAndroid
+LocationProviderAndroid::LocationProviderAndroid() {
+}
+
+LocationProviderAndroid::~LocationProviderAndroid() {
+ StopProvider();
+}
+
+void LocationProviderAndroid::NotifyNewGeoposition(
+ const content::Geoposition& position) {
+ last_position_ = position;
+ UpdateListeners();
+}
+
+bool LocationProviderAndroid::StartProvider(bool high_accuracy) {
+ return AndroidLocationApiAdapter::GetInstance()->Start(this, high_accuracy);
+}
+
+void LocationProviderAndroid::StopProvider() {
+ AndroidLocationApiAdapter::GetInstance()->Stop();
+}
+
+void LocationProviderAndroid::GetPosition(content::Geoposition* position) {
+ *position = last_position_;
+}
+
+void LocationProviderAndroid::UpdatePosition() {
+ // Nothing to do here, android framework will call us back on new position.
+}
+
+void LocationProviderAndroid::OnPermissionGranted(
+ const GURL& requesting_frame) {
+ // Nothing to do here.
+}
+
+LocationProviderBase* NewSystemLocationProvider() {
+ return new LocationProviderAndroid;
+}
« no previous file with comments | « content/browser/geolocation/location_provider_android.h ('k') | content/content.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698