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

Unified Diff: chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc

Issue 2851863003: Handle no cellular device more gracefully in choose-mobile-network UI. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
index 8ed5a8c360d09efdaa5fa3210f398f00cd357bac..7196f2cb69129a64f0dd82ab2d4304b7c29276a3 100644
--- a/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.cc
@@ -136,6 +136,9 @@ ChooseMobileNetworkHandler::ChooseMobileNetworkHandler()
NET_LOG_ERROR(
"A cellular device is not available.",
"Cannot initiate a cellular network scan without a cellular device.");
+ // If there is no cellular device, we set |has_pending_results_| to true so
+ // that HandlePageReady() will show "No networks found." on the web UI.
+ has_pending_results_ = true;
return;
}
handler->AddObserver(this, FROM_HERE);
@@ -221,6 +224,9 @@ void ChooseMobileNetworkHandler::HandleCancel(const base::ListValue* args) {
return;
}
+ if (device_path_.empty())
+ return;
+
// Switch to automatic mode.
GetNetworkDeviceHandler()->RegisterCellularNetwork(
device_path_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698