Chromium Code Reviews| Index: chrome/browser/resources/options/chromeos/internet_detail.js |
| diff --git a/chrome/browser/resources/options/chromeos/internet_detail.js b/chrome/browser/resources/options/chromeos/internet_detail.js |
| index d3fd21b62a316a6527e639b2dccb2da2cda5d188..77ee931002904f798eff11cf30830406e1bef64c 100644 |
| --- a/chrome/browser/resources/options/chromeos/internet_detail.js |
| +++ b/chrome/browser/resources/options/chromeos/internet_detail.js |
| @@ -757,7 +757,9 @@ cr.define('options.internet', function() { |
| populateHeader_: function() { |
| var onc = this.onc_; |
| - $('network-details-title').textContent = onc.getTranslatedValue('Name'); |
| + $('network-details-title').textContent = |
| + this.networkTitle_ || onc.getTranslatedValue('Name'); |
| + |
| var connectionState = onc.getActiveValue('ConnectionState'); |
| var connectionStateString = onc.getTranslatedValue('ConnectionState'); |
| $('network-details-subtitle-status').textContent = connectionStateString; |
| @@ -1311,6 +1313,16 @@ cr.define('options.internet', function() { |
| sendShowDetailsMetrics(type, onc.getActiveValue('ConnectionState')); |
| + if (type == 'VPN') { |
| + // Cache the dialog title, which will contain the provider name in the |
| + // case of a third-party VPN provider. This caching is important as the |
| + // provider may go away while the details dialog is being shown, causing |
| + // subsequent updates to be unable to determine the correct title. |
| + detailsPage.networkTitle_ = options.VPNProviders.formatNetworkName( |
| + oncData.VPNProviderID, |
|
stevenjb
2015/03/15 17:00:08
Don't use oncData directly, use onc.getActiveValue
bartfab (slow)
2015/03/16 10:04:51
I had based this on existing code. It seemed to me
|
| + onc.getTranslatedValue('Name')); |
| + } |
|
stevenjb
2015/03/15 17:00:08
else detailsPage.networkTitle = undefined;
bartfab (slow)
2015/03/16 10:04:51
Done.
|
| + |
| detailsPage.populateHeader_(); |
| detailsPage.updateConnectionButtonVisibilty_(); |
| detailsPage.updateDetails_(); |
| @@ -1639,6 +1651,11 @@ cr.define('options.internet', function() { |
| $('auto-connect-network-cellular').disabled = false; |
| } else if (type == 'VPN') { |
| OptionsPage.showTab($('vpn-nav-tab')); |
| + var providers = options.VPNProviders; |
| + var providerID = oncData.VPNProviderID; |
|
stevenjb
2015/03/15 17:00:08
Use onc.getActiveValue
bartfab (slow)
2015/03/16 10:04:51
Done.
|
| + $('vpn-tab').classList.toggle('third-party-vpn-provider', |
| + providers.isThirdPartyProvider(providerID)); |
| + |
| $('inet-service-name').textContent = networkName; |
| $('inet-provider-type').textContent = |
| onc.getTranslatedValue('VPN.Type'); |
| @@ -1666,6 +1683,8 @@ cr.define('options.internet', function() { |
| $('auto-connect-network-vpn').checked = |
| onc.getActiveValue('VPN.AutoConnect'); |
| $('auto-connect-network-vpn').disabled = false; |
| + $('inet-provider-name').textContent = |
| + providers.getProviders()[providerID]; |
| } else { |
| OptionsPage.showTab($('internet-nav-tab')); |
| } |