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

Unified Diff: content/renderer/geolocation_dispatcher.cc

Issue 10316007: Make the Geoposition helper class public (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix forward-declaration of struct as class. Created 8 years, 8 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/renderer/geolocation_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/geolocation_dispatcher.cc
diff --git a/content/renderer/geolocation_dispatcher.cc b/content/renderer/geolocation_dispatcher.cc
index d745ba4c45aaa789badc22a67b06eb8e526cef36..9551a2fc29501accb953513bc883445f545dc859 100644
--- a/content/renderer/geolocation_dispatcher.cc
+++ b/content/renderer/geolocation_dispatcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -112,35 +112,38 @@ void GeolocationDispatcher::OnPermissionSet(int bridge_id, bool is_allowed) {
}
// We have an updated geolocation position or error code.
-void GeolocationDispatcher::OnPositionUpdated(const Geoposition& geoposition) {
+void GeolocationDispatcher::OnPositionUpdated(
+ const content::Geoposition& geoposition) {
// It is possible for the browser process to have queued an update message
// before receiving the stop updating message.
if (!updating_)
return;
- DCHECK(geoposition.IsInitialized());
- if (geoposition.IsValidFix()) {
+ if (geoposition.Validate()) {
controller_->positionChanged(
WebGeolocationPosition(
geoposition.timestamp.ToDoubleT(),
geoposition.latitude, geoposition.longitude,
geoposition.accuracy,
- geoposition.is_valid_altitude(), geoposition.altitude,
- geoposition.is_valid_altitude_accuracy(),
+ // Lowest point on land is at approximately -400 meters.
+ geoposition.altitude > -10000.,
+ geoposition.altitude,
+ geoposition.altitude_accuracy >= 0.,
geoposition.altitude_accuracy,
- geoposition.is_valid_heading(), geoposition.heading,
- geoposition.is_valid_speed(), geoposition.speed));
+ geoposition.heading >= 0. && geoposition.heading <= 360.,
+ geoposition.heading,
+ geoposition.speed >= 0.,
+ geoposition.speed));
} else {
WebGeolocationError::Error code;
switch (geoposition.error_code) {
- case Geoposition::ERROR_CODE_PERMISSION_DENIED:
+ case content::Geoposition::ERROR_CODE_PERMISSION_DENIED:
code = WebGeolocationError::ErrorPermissionDenied;
break;
- case Geoposition::ERROR_CODE_POSITION_UNAVAILABLE:
+ case content::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE:
code = WebGeolocationError::ErrorPositionUnavailable;
break;
default:
- DCHECK(false);
NOTREACHED() << geoposition.error_code;
return;
}
« no previous file with comments | « content/renderer/geolocation_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698