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

Unified Diff: content/browser/geolocation/win7_location_provider_win.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/browser/geolocation/win7_location_provider_win.h ('k') | content/common/geolocation_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/geolocation/win7_location_provider_win.cc
diff --git a/content/browser/geolocation/win7_location_provider_win.cc b/content/browser/geolocation/win7_location_provider_win.cc
index cfcf3f35158747e8e9e73066db60d785ded22394..780df8c42a345057cc8b447ac60d1ea6b6bd7fed 100644
--- a/content/browser/geolocation/win7_location_provider_win.cc
+++ b/content/browser/geolocation/win7_location_provider_win.cc
@@ -24,13 +24,13 @@ const int kMovementThresholdMeters = 20;
// The arbitrary delta is decreased (Gears used 100 meters); if we need to
// decrease it any further we'll likely want to do some smarter filtering to
// remove GPS location jitter noise.
-bool PositionsDifferSiginificantly(const Geoposition& position_1,
- const Geoposition& position_2) {
- const bool pos_1_valid = position_1.IsValidFix();
- if (pos_1_valid != position_2.IsValidFix())
+bool PositionsDifferSiginificantly(const content::Geoposition& position_1,
+ const content::Geoposition& position_2) {
+ const bool pos_1_valid = position_1.Validate();
+ if (pos_1_valid != position_2.Validate())
return true;
if (!pos_1_valid) {
- DCHECK(!position_2.IsValidFix());
+ DCHECK(!position_2.Validate());
return false;
}
double delta = std::sqrt(
@@ -66,7 +66,7 @@ void Win7LocationProvider::StopProvider() {
weak_factory_.InvalidateWeakPtrs();
}
-void Win7LocationProvider::GetPosition(Geoposition* position) {
+void Win7LocationProvider::GetPosition(content::Geoposition* position) {
DCHECK(position);
*position = position_;
}
@@ -76,12 +76,13 @@ void Win7LocationProvider::UpdatePosition() {
}
void Win7LocationProvider::DoPollTask() {
- Geoposition new_position;
+ content::Geoposition new_position;
api_->GetPosition(&new_position);
const bool differ = PositionsDifferSiginificantly(position_, new_position);
ScheduleNextPoll(differ ? kPollPeriodMovingMillis :
kPollPeriodStationaryMillis);
- if (differ || new_position.error_code != Geoposition::ERROR_CODE_NONE) {
+ if (differ ||
+ new_position.error_code != content::Geoposition::ERROR_CODE_NONE) {
// Update if the new location is interesting or we have an error to report
position_ = new_position;
UpdateListeners();
« no previous file with comments | « content/browser/geolocation/win7_location_provider_win.h ('k') | content/common/geolocation_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698