| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class GeolocationArbitrator : public LocationProviderBase::ListenerInterface { | 33 class GeolocationArbitrator : public LocationProviderBase::ListenerInterface { |
| 34 public: | 34 public: |
| 35 // Number of milliseconds newer a location provider has to be that it's worth | 35 // Number of milliseconds newer a location provider has to be that it's worth |
| 36 // switching to this location provider on the basis of it being fresher | 36 // switching to this location provider on the basis of it being fresher |
| 37 // (regardles of relative accuracy). Public for tests. | 37 // (regardles of relative accuracy). Public for tests. |
| 38 static const int64 kFixStaleTimeoutMilliseconds; | 38 static const int64 kFixStaleTimeoutMilliseconds; |
| 39 | 39 |
| 40 // Defines a function that returns the current time. | 40 // Defines a function that returns the current time. |
| 41 typedef base::Time (*GetTimeNow)(); | 41 typedef base::Time (*GetTimeNow)(); |
| 42 | 42 |
| 43 ~GeolocationArbitrator(); | 43 virtual ~GeolocationArbitrator(); |
| 44 | 44 |
| 45 static GeolocationArbitrator* Create(GeolocationObserver* observer); | 45 static GeolocationArbitrator* Create(GeolocationObserver* observer); |
| 46 | 46 |
| 47 // See more details in geolocation_provider. | 47 // See more details in geolocation_provider. |
| 48 void StartProviders(const GeolocationObserverOptions& options); | 48 void StartProviders(const GeolocationObserverOptions& options); |
| 49 void StopProviders(); | 49 void StopProviders(); |
| 50 | 50 |
| 51 // Called everytime permission is granted to a page for using geolocation. | 51 // Called everytime permission is granted to a page for using geolocation. |
| 52 // This may either be through explicit user action (e.g. responding to the | 52 // This may either be through explicit user action (e.g. responding to the |
| 53 // infobar prompt) or inferred from a persisted site permission. | 53 // infobar prompt) or inferred from a persisted site permission. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const LocationProviderBase* position_provider_; | 95 const LocationProviderBase* position_provider_; |
| 96 GURL most_recent_authorized_frame_; | 96 GURL most_recent_authorized_frame_; |
| 97 CancelableRequestConsumer request_consumer_; | 97 CancelableRequestConsumer request_consumer_; |
| 98 // The current best estimate of our position. | 98 // The current best estimate of our position. |
| 99 Geoposition position_; | 99 Geoposition position_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(GeolocationArbitrator); | 101 DISALLOW_COPY_AND_ASSIGN(GeolocationArbitrator); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ | 104 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ |
| OLD | NEW |