| 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 CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 virtual bool StartProvider(bool high_accuracy) OVERRIDE; | 75 virtual bool StartProvider(bool high_accuracy) OVERRIDE; |
| 76 virtual void StopProvider() OVERRIDE; | 76 virtual void StopProvider() OVERRIDE; |
| 77 virtual void GetPosition(Geoposition *position) OVERRIDE; | 77 virtual void GetPosition(Geoposition *position) OVERRIDE; |
| 78 virtual void RequestRefresh() OVERRIDE; | 78 virtual void RequestRefresh() OVERRIDE; |
| 79 virtual void OnPermissionGranted() OVERRIDE; | 79 virtual void OnPermissionGranted() OVERRIDE; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // Satisfies a position request from cache or network. | 82 // Satisfies a position request from cache or network. |
| 83 void RequestPosition(); | 83 void RequestPosition(); |
| 84 | 84 |
| 85 // Called from a callback when new wifi data is available. | 85 // Gets called when new wifi data is available. |
| 86 void WifiDataUpdateAvailable(WifiDataProvider* provider); | 86 void OnWifiDataUpdate(WifiDataProvider* provider); |
| 87 | 87 |
| 88 // Internal helper used by WifiDataUpdateAvailable. | 88 // Internal helper used by OnWifiDataUpdate. |
| 89 void OnWifiDataUpdated(); | 89 void OnWifiDataUpdated(); |
| 90 | 90 |
| 91 bool IsStarted() const; | 91 bool IsStarted() const; |
| 92 | 92 |
| 93 void LocationResponseAvailable(const Geoposition& position, | 93 void OnLocationResponse(const Geoposition& position, |
| 94 bool server_error, | 94 bool server_error, |
| 95 const base::string16& access_token, | 95 const base::string16& access_token, |
| 96 const WifiData& wifi_data); | 96 const WifiData& wifi_data); |
| 97 | 97 |
| 98 scoped_refptr<AccessTokenStore> access_token_store_; | 98 scoped_refptr<AccessTokenStore> access_token_store_; |
| 99 | 99 |
| 100 // The wifi data provider, acquired via global factories. | 100 // The wifi data provider, acquired via global factories. |
| 101 WifiDataProvider* wifi_data_provider_; | 101 WifiDataProvider* wifi_data_provider_; |
| 102 | 102 |
| 103 WifiDataProvider::WifiDataUpdateCallback wifi_data_update_callback_; | 103 WifiDataProvider::WifiDataUpdateCallback wifi_data_update_callback_; |
| 104 | 104 |
| 105 // The wifi data and a flag to indicate if the data set is complete. | 105 // The wifi data and a flag to indicate if the data set is complete. |
| 106 WifiData wifi_data_; | 106 WifiData wifi_data_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 136 // over the platform-dependent implementations. | 136 // over the platform-dependent implementations. |
| 137 CONTENT_EXPORT LocationProviderBase* NewNetworkLocationProvider( | 137 CONTENT_EXPORT LocationProviderBase* NewNetworkLocationProvider( |
| 138 AccessTokenStore* access_token_store, | 138 AccessTokenStore* access_token_store, |
| 139 net::URLRequestContextGetter* context, | 139 net::URLRequestContextGetter* context, |
| 140 const GURL& url, | 140 const GURL& url, |
| 141 const base::string16& access_token); | 141 const base::string16& access_token); |
| 142 | 142 |
| 143 } // namespace content | 143 } // namespace content |
| 144 | 144 |
| 145 #endif // CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ | 145 #endif // CONTENT_BROWSER_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ |
| OLD | NEW |