Commit 3afd9afd authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Use chromeos.network_config.mojom in network_select_login.js

This removes the last remaining use of networkingPrivate in Chrome OS
WebUI!

Bug: 1001598
Change-Id: I984ae41a3dc6949862ffb8e4556a95cef646d251
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825873Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700046}
parent 9cc4e8de
...@@ -347,19 +347,32 @@ ...@@ -347,19 +347,32 @@
return; return;
} }
chrome.networkingPrivate.startConnect(guid, () => { const networkConfig =
const lastError = chrome.runtime.lastError; network_config.MojoInterfaceProviderImpl.getInstance()
if (!lastError) .getMojoServiceRemote();
return;
const message = lastError.message; networkConfig.startConnect(guid).then(response => {
if (message == 'connecting' || message == 'connect-canceled' || switch (response.result) {
message == 'connected' || message == 'Error.InvalidNetworkGuid') { case mojom.StartConnectResult.kSuccess:
return; return;
case mojom.StartConnectResult.kInvalidGuid:
case mojom.StartConnectResult.kInvalidState:
case mojom.StartConnectResult.kCanceled:
// TODO(stevenjb/khorimoto): Consider handling these cases.
return;
case mojom.StartConnectResult.kNotConfigured:
if (!OncMojo.networkTypeIsMobile(networkState.type)) {
chrome.send('showNetworkConfig', [guid]);
} else {
console.error('Cellular network is not configured: ' + guid);
}
return;
case mojom.StartConnectResult.kBlocked:
case mojom.StartConnectResult.kUnknown:
console.error(
'startConnect failed for: ' + guid + ': ' + response.message);
return;
} }
console.error(
'networkingPrivate.startConnect error: ' + message +
' For: ' + guid);
chrome.send('showNetworkConfig', [guid]);
}); });
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment