Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Unified Diff: content/browser/geolocation/wifi_data_provider_chromeos.cc

Issue 23889009: Initial Geolocation Wifi Scan Checking Fix for CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_chromeos.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/geolocation/wifi_data_provider_chromeos.cc
diff --git a/content/browser/geolocation/wifi_data_provider_chromeos.cc b/content/browser/geolocation/wifi_data_provider_chromeos.cc
index 7f29276ec7b79f87c29c67aed92391f139d52b8b..26e36f5312f57356c7785787a35c52adcfafa903 100644
--- a/content/browser/geolocation/wifi_data_provider_chromeos.cc
+++ b/content/browser/geolocation/wifi_data_provider_chromeos.cc
@@ -70,14 +70,14 @@ void WifiDataProviderChromeOs::DoWifiScanTaskOnUIThread() {
WifiData new_data;
- if (!GetAccessPointData(&new_data.access_point_data)) {
+ if (GetAccessPointData(&new_data.access_point_data)) {
client_loop()->PostTask(
FROM_HERE,
- base::Bind(&WifiDataProviderChromeOs::DidWifiScanTaskNoResults, this));
+ base::Bind(&WifiDataProviderChromeOs::DidWifiScanTask, this, new_data));
} else {
client_loop()->PostTask(
FROM_HERE,
- base::Bind(&WifiDataProviderChromeOs::DidWifiScanTask, this, new_data));
+ base::Bind(&WifiDataProviderChromeOs::DidWifiScanTaskNoResults, this));
}
}
@@ -87,7 +87,6 @@ void WifiDataProviderChromeOs::DidWifiScanTaskNoResults() {
// in between DoWifiScanTaskOnUIThread and this method).
if (started_)
ScheduleNextScan(polling_policy_->NoWifiInterval());
- MaybeRunCallbacks(false);
}
void WifiDataProviderChromeOs::DidWifiScanTask(const WifiData& new_data) {
@@ -100,10 +99,7 @@ void WifiDataProviderChromeOs::DidWifiScanTask(const WifiData& new_data) {
polling_policy_->UpdatePollingInterval(update_available);
ScheduleNextScan(polling_policy_->PollingInterval());
}
- MaybeRunCallbacks(update_available);
-}
-void WifiDataProviderChromeOs::MaybeRunCallbacks(bool update_available) {
if (update_available || !is_first_scan_complete_) {
is_first_scan_complete_ = true;
RunCallbacks();
@@ -140,9 +136,12 @@ void WifiDataProviderChromeOs::ScheduleStart() {
bool WifiDataProviderChromeOs::GetAccessPointData(
WifiData::AccessPointDataSet* result) {
- chromeos::WifiAccessPointVector access_points;
+ // If wifi isn't enabled, we've effectively completed the task.
+ // Return true to indicate an empty access point list.
if (!chromeos::NetworkHandler::Get()->geolocation_handler()->wifi_enabled())
- return false;
+ return true;
+
+ chromeos::WifiAccessPointVector access_points;
int64 age_ms = 0;
if (!chromeos::NetworkHandler::Get()->geolocation_handler()->
GetWifiAccessPoints(&access_points, &age_ms)) {
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698