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 #ifndef DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 5 #ifndef DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
6 #define DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 6 #define DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 NetworkLocationProvider( | 66 NetworkLocationProvider( |
67 const scoped_refptr<AccessTokenStore>& access_token_store, | 67 const scoped_refptr<AccessTokenStore>& access_token_store, |
68 const scoped_refptr<net::URLRequestContextGetter>& context, | 68 const scoped_refptr<net::URLRequestContextGetter>& context, |
69 const GURL& url, | 69 const GURL& url, |
70 const base::string16& access_token); | 70 const base::string16& access_token); |
71 ~NetworkLocationProvider() override; | 71 ~NetworkLocationProvider() override; |
72 | 72 |
73 // LocationProvider implementation | 73 // LocationProvider implementation |
74 bool StartProvider(bool high_accuracy) override; | 74 bool StartProvider(bool high_accuracy) override; |
75 void StopProvider() override; | 75 void StopProvider() override; |
76 void GetPosition(Geoposition* position) override; | 76 const Geoposition& GetPosition() override; |
77 void RequestRefresh() override; | |
78 void OnPermissionGranted() override; | 77 void OnPermissionGranted() override; |
79 | 78 |
80 private: | 79 private: |
| 80 // Provides a hint to the provider that new location data is needed as soon |
| 81 // as possible. |
| 82 void RequestRefresh(); |
| 83 |
81 // Satisfies a position request from cache or network. | 84 // Satisfies a position request from cache or network. |
82 void RequestPosition(); | 85 void RequestPosition(); |
83 | 86 |
84 // Gets called when new wifi data is available. | 87 // Gets called when new wifi data is available. |
85 void OnWifiDataUpdate(); | 88 void OnWifiDataUpdate(); |
86 | 89 |
87 // Internal helper used by OnWifiDataUpdate. | 90 // Internal helper used by OnWifiDataUpdate. |
88 void OnWifiDataUpdated(); | 91 void OnWifiDataUpdated(); |
89 | 92 |
90 bool IsStarted() const; | 93 bool IsStarted() const; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // over the platform-dependent implementations. | 138 // over the platform-dependent implementations. |
136 DEVICE_GEOLOCATION_EXPORT LocationProviderBase* NewNetworkLocationProvider( | 139 DEVICE_GEOLOCATION_EXPORT LocationProviderBase* NewNetworkLocationProvider( |
137 const scoped_refptr<AccessTokenStore>& access_token_store, | 140 const scoped_refptr<AccessTokenStore>& access_token_store, |
138 const scoped_refptr<net::URLRequestContextGetter>& context, | 141 const scoped_refptr<net::URLRequestContextGetter>& context, |
139 const GURL& url, | 142 const GURL& url, |
140 const base::string16& access_token); | 143 const base::string16& access_token); |
141 | 144 |
142 } // namespace device | 145 } // namespace device |
143 | 146 |
144 #endif // DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 147 #endif // DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
OLD | NEW |