Chromium Code Reviews| Index: chrome/browser/resources/settings/internet_page/internet_detail_page.js |
| diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js |
| index e37ad1ad976255edabafed5fc6b5f45d6eec160f..e7d3a1469caff52453dfd7e4529fa5d27dc70c18 100644 |
| --- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js |
| +++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js |
| @@ -37,6 +37,25 @@ Polymer({ |
| notify: true, |
| }, |
| + /** Whether the user is a secondary user. */ |
|
michaelpg
2016/12/13 23:49:54
nit: @private
stevenjb
2016/12/14 00:11:20
Done.
|
| + isSecondaryUser_: { |
| + type: Boolean, |
| + value: function() { |
| + return loadTimeData.getBoolean('isSecondaryUser'); |
| + }, |
| + readOnly: true, |
| + }, |
| + |
| + /** Email address for the primary user when user is a secondary user. */ |
| + primaryUserEmail_: { |
| + type: String, |
| + value: function() { |
| + return loadTimeData.getBoolean('isSecondaryUser') ? |
| + loadTimeData.getString('primaryUserEmail') : ''; |
| + }, |
| + readOnly: true, |
| + }, |
| + |
| /** |
| * Highest priority connected network or null. |
| * @type {?CrOnc.NetworkStateProperties} |
| @@ -207,8 +226,13 @@ Polymer({ |
| */ |
| getNetworkDetails_: function() { |
| assert(!!this.guid); |
| - this.networkingPrivate.getManagedProperties( |
| - this.guid, this.getPropertiesCallback_.bind(this)); |
| + if (this.isSecondaryUser_) { |
| + this.networkingPrivate.getState( |
| + this.guid, this.getStateCallback_.bind(this)); |
| + } else { |
| + this.networkingPrivate.getManagedProperties( |
| + this.guid, this.getPropertiesCallback_.bind(this)); |
| + } |
| }, |
| /** |
| @@ -219,11 +243,30 @@ Polymer({ |
| getPropertiesCallback_: function(properties) { |
| this.networkProperties = properties; |
| if (!properties) { |
| - // If |properties| becomes null (i.e. the network is no longer visible), |
| - // close the page. |
| + // If |properties| is null, the network is no longer visible, close this. |
| + console.error('Network no longer exists: ' + this.guid); |
| + this.close_(); |
| + } |
| + }, |
| + |
| + /** |
| + * networkingPrivate.getState callback. |
| + * @param {CrOnc.NetworkStateProperties} state The network state properties. |
| + * @private |
| + */ |
| + getStateCallback_: function(state) { |
| + if (!state) { |
| + // If |state| is null, the network is no longer visible, close this. |
| console.error('Network no longer exists: ' + this.guid); |
| + this.networkProperties = undefined; |
| this.close_(); |
| } |
| + this.networkProperties = { |
| + GUID: state.GUID, |
| + Type: state.Type, |
| + Connectable: state.Connectable, |
| + ConnectionState: state.ConnectionState, |
| + }; |
| }, |
| /** |