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

Unified Diff: chromeos/network/network_connect.cc

Issue 2913103002: Add Tether to Mobile NetworkTypePattern. (Closed)
Patch Set: Add Tether to Mobile NetworkTypePattern. Created 3 years, 6 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 | « chrome/browser/chromeos/status/network_menu.cc ('k') | chromeos/network/network_type_pattern.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_connect.cc
diff --git a/chromeos/network/network_connect.cc b/chromeos/network/network_connect.cc
index 5778905536ca09761448958fcee5e89a87382603..c3553e2b6b9982492b398bc6f8d26ebea583a424 100644
--- a/chromeos/network/network_connect.cc
+++ b/chromeos/network/network_connect.cc
@@ -435,31 +435,27 @@ void NetworkConnectImpl::SetTechnologyEnabled(
network_handler::ErrorCallback());
return;
}
- // If we're dealing with a mobile network, then handle SIM lock here.
- // SIM locking only applies to cellular, so the code below won't execute
- // if |technology| has been explicitly set to WiMAX.
- if (technology.MatchesPattern(NetworkTypePattern::Mobile())) {
+ // If we're dealing with a cellular network, then handle SIM lock here.
+ // SIM locking only applies to cellular.
+ if (technology.MatchesPattern(NetworkTypePattern::Cellular())) {
const DeviceState* mobile = handler->GetDeviceStateByType(technology);
if (!mobile) {
NET_LOG_ERROR("SetTechnologyEnabled with no device", log_string);
return;
}
- // The following only applies to cellular.
- if (mobile->type() == shill::kTypeCellular) {
- if (mobile->IsSimAbsent()) {
- // If this is true, then we have a cellular device with no SIM
- // inserted. TODO(armansito): Chrome should display a notification here,
- // prompting the user to insert a SIM card and restart the device to
- // enable cellular. See crbug.com/125171.
- NET_LOG_USER("Cannot enable cellular device without SIM.", log_string);
- return;
- }
- if (!mobile->sim_lock_type().empty()) {
- // A SIM has been inserted, but it is locked. Let the user unlock it
- // via the dialog.
- delegate_->ShowMobileSimDialog();
- return;
- }
+ if (mobile->IsSimAbsent()) {
+ // If this is true, then we have a cellular device with no SIM
+ // inserted. TODO(armansito): Chrome should display a notification here,
+ // prompting the user to insert a SIM card and restart the device to
+ // enable cellular. See crbug.com/125171.
+ NET_LOG_USER("Cannot enable cellular device without SIM.", log_string);
+ return;
+ }
+ if (!mobile->sim_lock_type().empty()) {
+ // A SIM has been inserted, but it is locked. Let the user unlock it
+ // via the dialog.
+ delegate_->ShowMobileSimDialog();
+ return;
}
}
handler->SetTechnologyEnabled(technology, true,
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chromeos/network/network_type_pattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698