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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | blimp/client/core/geolocation/geolocation_feature_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/client/core/geolocation/geolocation_feature.h" 5 #include "blimp/client/core/geolocation/geolocation_feature.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 am_sending_message_ = true; 138 am_sending_message_ = true;
139 outgoing_message_processor_->ProcessMessage( 139 outgoing_message_processor_->ProcessMessage(
140 std::move(blimp_message), 140 std::move(blimp_message),
141 base::Bind(&GeolocationFeature::OnSendComplete, base::Unretained(this))); 141 base::Bind(&GeolocationFeature::OnSendComplete, base::Unretained(this)));
142 } 142 }
143 143
144 void GeolocationFeature::OnSendComplete(int result) { 144 void GeolocationFeature::OnSendComplete(int result) {
145 am_sending_message_ = false; 145 am_sending_message_ = false;
146 if (need_to_send_message_) { 146 if (need_to_send_message_) {
147 device::Geoposition new_position = location_provider_->GetPosition();
148 if (new_position.Validate()) {
149 OnLocationUpdate(location_provider_.get(), new_position);
150 }
147 need_to_send_message_ = false; 151 need_to_send_message_ = false;
148 OnLocationUpdate(location_provider_.get(),
149 location_provider_->GetPosition());
150 } 152 }
151 } 153 }
152 154
153 } // namespace client 155 } // namespace client
154 } // namespace blimp 156 } // namespace blimp
OLDNEW
« 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