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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Returns true if this arbitrator has received at least one call to | 60 // Returns true if this arbitrator has received at least one call to |
61 // OnPermissionGranted(). | 61 // OnPermissionGranted(). |
62 bool HasPermissionBeenGranted() const; | 62 bool HasPermissionBeenGranted() const; |
63 | 63 |
64 // Call this function every time you need to create an specially parameterised | 64 // Call this function every time you need to create an specially parameterised |
65 // arbitrator. | 65 // arbitrator. |
66 static void SetDependencyFactoryForTest( | 66 static void SetDependencyFactoryForTest( |
67 GeolocationArbitratorDependencyFactory* factory); | 67 GeolocationArbitratorDependencyFactory* factory); |
68 | 68 |
69 // ListenerInterface | 69 // ListenerInterface |
70 virtual void LocationUpdateAvailable(LocationProviderBase* provider); | 70 virtual void LocationUpdateAvailable(LocationProviderBase* provider) OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
73 GeolocationArbitrator( | 73 GeolocationArbitrator( |
74 GeolocationArbitratorDependencyFactory* dependency_factory, | 74 GeolocationArbitratorDependencyFactory* dependency_factory, |
75 GeolocationObserver* observer); | 75 GeolocationObserver* observer); |
76 // Takes ownership of |provider| on entry; it will either be added to | 76 // Takes ownership of |provider| on entry; it will either be added to |
77 // |providers_| or deleted on error (e.g. it fails to start). | 77 // |providers_| or deleted on error (e.g. it fails to start). |
78 void RegisterProvider(LocationProviderBase* provider); | 78 void RegisterProvider(LocationProviderBase* provider); |
79 void OnAccessTokenStoresLoaded( | 79 void OnAccessTokenStoresLoaded( |
80 AccessTokenStore::AccessTokenSet access_token_store, | 80 AccessTokenStore::AccessTokenSet access_token_store, |
(...skipping 16 matching lines...) Expand all Loading... |
97 const LocationProviderBase* position_provider_; | 97 const LocationProviderBase* position_provider_; |
98 GURL most_recent_authorized_frame_; | 98 GURL most_recent_authorized_frame_; |
99 CancelableRequestConsumer request_consumer_; | 99 CancelableRequestConsumer request_consumer_; |
100 // The current best estimate of our position. | 100 // The current best estimate of our position. |
101 Geoposition position_; | 101 Geoposition position_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(GeolocationArbitrator); | 103 DISALLOW_COPY_AND_ASSIGN(GeolocationArbitrator); |
104 }; | 104 }; |
105 | 105 |
106 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ | 106 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ |
OLD | NEW |