OLD | NEW |
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 Loading... |
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 |
OLD | NEW |