Commit 21de58ba authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Internet detail page fixes for secondary users

Bug: 987923
Change-Id: Iff95482d23ae0f9851b55a69d15679da17387297
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1721018
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681453}
parent 5196891c
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
(function() { (function() {
'use strict'; 'use strict';
const mojom = chromeos.networkConfig.mojom;
Polymer({ Polymer({
is: 'settings-internet-detail-page', is: 'settings-internet-detail-page',
...@@ -515,10 +517,25 @@ Polymer({ ...@@ -515,10 +517,25 @@ Polymer({
} }
const type = /** @type {CrOnc.Type} */ ( const type = /** @type {CrOnc.Type} */ (
OncMojo.getNetworkTypeString(networkState.type)); OncMojo.getNetworkTypeString(networkState.type));
const connectionState = /** @type {CrOnc.ConnectionState} */ (
OncMojo.getConnectionStateTypeString(networkState.connectionState)); let connectionState;
switch (networkState.connectionState) {
case mojom.ConnectionStateType.kOnline:
case mojom.ConnectionStateType.kConnected:
case mojom.ConnectionStateType.kPortal:
connectionState = CrOnc.ConnectionState.CONNECTED;
break;
case mojom.ConnectionStateType.kConnecting:
connectionState = CrOnc.ConnectionState.CONNECTING;
break;
case mojom.ConnectionStateType.kNotConnected:
connectionState = CrOnc.ConnectionState.NOT_CONNECTED;
break;
}
this.networkProperties_ = { this.networkProperties_ = {
GUID: networkState.guid, GUID: networkState.guid,
Name: {Active: networkState.name},
Type: type, Type: type,
Connectable: networkState.connectable, Connectable: networkState.connectable,
ConnectionState: connectionState, ConnectionState: connectionState,
...@@ -936,8 +953,8 @@ Polymer({ ...@@ -936,8 +953,8 @@ Polymer({
// Only mark VPN networks as enforced. This fake pref also controls the // Only mark VPN networks as enforced. This fake pref also controls the
// policy indicator on the connect/disconnect buttons, so it shouldn't be // policy indicator on the connect/disconnect buttons, so it shouldn't be
// shown on non-VPN networks. // shown on non-VPN networks.
if (this.isVpn_(this.networkProperties_) && this.prefs.vpn_config_allowed && if (this.isVpn_(this.networkProperties_) && this.prefs &&
!this.prefs.vpn_config_allowed.value) { this.prefs.vpn_config_allowed && !this.prefs.vpn_config_allowed.value) {
fakeAlwaysOnVpnEnforcementPref.enforcement = fakeAlwaysOnVpnEnforcementPref.enforcement =
chrome.settingsPrivate.Enforcement.ENFORCED; chrome.settingsPrivate.Enforcement.ENFORCED;
fakeAlwaysOnVpnEnforcementPref.controlledBy = fakeAlwaysOnVpnEnforcementPref.controlledBy =
......
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