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

Unified Diff: blimp/client/core/geolocation/geolocation_feature.cc

Issue 2331513002: Checks to see if the position is valid before OnLocationUpdate call. (Closed)
Patch Set: Tidy up. Created 4 years, 3 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 | « no previous file | blimp/client/core/geolocation/geolocation_feature_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/geolocation/geolocation_feature.cc
diff --git a/blimp/client/core/geolocation/geolocation_feature.cc b/blimp/client/core/geolocation/geolocation_feature.cc
index 201a9a0eca4a9037471cda4692ad8a023a8ed837..012e0fdce8f8c040270bf8b1816249bfd34887e2 100644
--- a/blimp/client/core/geolocation/geolocation_feature.cc
+++ b/blimp/client/core/geolocation/geolocation_feature.cc
@@ -144,9 +144,11 @@ void GeolocationFeature::SendGeolocationErrorMessage(
void GeolocationFeature::OnSendComplete(int result) {
am_sending_message_ = false;
if (need_to_send_message_) {
+ device::Geoposition new_position = location_provider_->GetPosition();
+ if (new_position.Validate()) {
+ OnLocationUpdate(location_provider_.get(), new_position);
+ }
need_to_send_message_ = false;
- OnLocationUpdate(location_provider_.get(),
- location_provider_->GetPosition());
}
}
« no previous file with comments | « no previous file | blimp/client/core/geolocation/geolocation_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698