| 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 #include "content/browser/geolocation/network_location_provider.h" | 5 #include "content/browser/geolocation/network_location_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/public/browser/access_token_store.h" | 10 #include "content/public/browser/access_token_store.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 void NetworkLocationProvider::OnPermissionGranted() { | 149 void NetworkLocationProvider::OnPermissionGranted() { |
| 150 const bool was_permission_granted = is_permission_granted_; | 150 const bool was_permission_granted = is_permission_granted_; |
| 151 is_permission_granted_ = true; | 151 is_permission_granted_ = true; |
| 152 if (!was_permission_granted && IsStarted()) { | 152 if (!was_permission_granted && IsStarted()) { |
| 153 RequestRefresh(); | 153 RequestRefresh(); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 void NetworkLocationProvider::OnWifiDataUpdate( | 157 void NetworkLocationProvider::OnWifiDataUpdate() { |
| 158 WifiDataProviderManager* manager) { | 158 DCHECK(wifi_data_provider_manager_); |
| 159 DCHECK(manager == wifi_data_provider_manager_); | |
| 160 is_wifi_data_complete_ = wifi_data_provider_manager_->GetData(&wifi_data_); | 159 is_wifi_data_complete_ = wifi_data_provider_manager_->GetData(&wifi_data_); |
| 161 OnWifiDataUpdated(); | 160 OnWifiDataUpdated(); |
| 162 } | 161 } |
| 163 | 162 |
| 164 void NetworkLocationProvider::OnLocationResponse( | 163 void NetworkLocationProvider::OnLocationResponse( |
| 165 const Geoposition& position, | 164 const Geoposition& position, |
| 166 bool server_error, | 165 bool server_error, |
| 167 const base::string16& access_token, | 166 const base::string16& access_token, |
| 168 const WifiData& wifi_data) { | 167 const WifiData& wifi_data) { |
| 169 DCHECK(CalledOnValidThread()); | 168 DCHECK(CalledOnValidThread()); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 267 } |
| 269 request_->MakeRequest(access_token_, wifi_data_, | 268 request_->MakeRequest(access_token_, wifi_data_, |
| 270 wifi_data_updated_timestamp_); | 269 wifi_data_updated_timestamp_); |
| 271 } | 270 } |
| 272 | 271 |
| 273 bool NetworkLocationProvider::IsStarted() const { | 272 bool NetworkLocationProvider::IsStarted() const { |
| 274 return wifi_data_provider_manager_ != NULL; | 273 return wifi_data_provider_manager_ != NULL; |
| 275 } | 274 } |
| 276 | 275 |
| 277 } // namespace content | 276 } // namespace content |
| OLD | NEW |