OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/geolocation/gps_location_provider_linux.h" | 5 #include "content/browser/geolocation/gps_location_provider_linux.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 poll_period_stationary_millis_); | 278 poll_period_stationary_millis_); |
279 if (differ || new_position.error_code != Geoposition::ERROR_CODE_NONE) { | 279 if (differ || new_position.error_code != Geoposition::ERROR_CODE_NONE) { |
280 // Update if the new location is interesting or we have an error to report. | 280 // Update if the new location is interesting or we have an error to report. |
281 position_ = new_position; | 281 position_ = new_position; |
282 UpdateListeners(); | 282 UpdateListeners(); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { | 286 void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { |
287 weak_factory_.InvalidateWeakPtrs(); | 287 weak_factory_.InvalidateWeakPtrs(); |
288 MessageLoop::current()->PostDelayedTask( | 288 base::MessageLoop::current()->PostDelayedTask( |
289 FROM_HERE, | 289 FROM_HERE, |
290 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, | 290 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, |
291 weak_factory_.GetWeakPtr()), | 291 weak_factory_.GetWeakPtr()), |
292 base::TimeDelta::FromMilliseconds(interval)); | 292 base::TimeDelta::FromMilliseconds(interval)); |
293 } | 293 } |
294 | 294 |
295 LocationProviderBase* NewSystemLocationProvider() { | 295 LocationProviderBase* NewSystemLocationProvider() { |
296 return new GpsLocationProviderLinux(LibGps::New); | 296 return new GpsLocationProviderLinux(LibGps::New); |
297 } | 297 } |
298 | 298 |
299 } // namespace content | 299 } // namespace content |
OLD | NEW |