| OLD | NEW |
| 1 // Copyright (c) 2011 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 // This file declares GPS providers that run on linux. Currently, just uses | 5 // This file declares GPS providers that run on linux. Currently, just uses |
| 6 // the libgps (gpsd) API. Public for testing only - for normal usage this | 6 // the libgps (gpsd) API. Public for testing only - for normal usage this |
| 7 // header should not be required, as location_provider.h declares the needed | 7 // header should not be required, as location_provider.h declares the needed |
| 8 // factory function. | 8 // factory function. |
| 9 | 9 |
| 10 #ifndef CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ | 10 #ifndef CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ |
| 11 #define CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ | 11 #define CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ |
| (...skipping 29 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 void SetPollPeriodStationaryMillis(int value) { | 42 void SetPollPeriodStationaryMillis(int value) { |
| 43 poll_period_stationary_millis_ = value; | 43 poll_period_stationary_millis_ = value; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // LocationProvider | 46 // LocationProvider |
| 47 virtual bool StartProvider(bool high_accuracy) OVERRIDE; | 47 virtual bool StartProvider(bool high_accuracy) OVERRIDE; |
| 48 virtual void StopProvider() OVERRIDE; | 48 virtual void StopProvider() OVERRIDE; |
| 49 virtual void GetPosition(Geoposition* position) OVERRIDE; | 49 virtual void GetPosition(Geoposition* position) OVERRIDE; |
| 50 virtual void UpdatePosition() OVERRIDE; | 50 virtual void UpdatePosition() OVERRIDE; |
| 51 virtual void OnPermissionGranted(const GURL& requesting_frame) OVERRIDE; | |
| 52 | 51 |
| 53 private: | 52 private: |
| 54 // Task which run in the child thread. | 53 // Task which run in the child thread. |
| 55 void DoGpsPollTask(); | 54 void DoGpsPollTask(); |
| 56 | 55 |
| 57 // Will schedule a poll; i.e. enqueue DoGpsPollTask deferred task. | 56 // Will schedule a poll; i.e. enqueue DoGpsPollTask deferred task. |
| 58 void ScheduleNextGpsPoll(int interval); | 57 void ScheduleNextGpsPoll(int interval); |
| 59 | 58 |
| 60 int gpsd_reconnect_interval_millis_; | 59 int gpsd_reconnect_interval_millis_; |
| 61 int poll_period_moving_millis_; | 60 int poll_period_moving_millis_; |
| 62 int poll_period_stationary_millis_; | 61 int poll_period_stationary_millis_; |
| 63 | 62 |
| 64 const LibGpsFactory libgps_factory_; | 63 const LibGpsFactory libgps_factory_; |
| 65 scoped_ptr<LibGps> gps_; | 64 scoped_ptr<LibGps> gps_; |
| 66 Geoposition position_; | 65 Geoposition position_; |
| 67 | 66 |
| 68 // Holder for the tasks which run on the thread; takes care of cleanup. | 67 // Holder for the tasks which run on the thread; takes care of cleanup. |
| 69 base::WeakPtrFactory<GpsLocationProviderLinux> weak_factory_; | 68 base::WeakPtrFactory<GpsLocationProviderLinux> weak_factory_; |
| 70 }; | 69 }; |
| 71 | 70 |
| 72 #endif // CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ | 71 #endif // CONTENT_BROWSER_GEOLOCATION_GPS_LOCATION_PROVIDER_LINUX_H_ |
| OLD | NEW |