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

Unified Diff: chrome/browser/resources/options/chromeos/internet_detail.js

Issue 1006553002: Add third-party VPN support to network details dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_460428_add_ash_ui
Patch Set: Prepare for removal of GetManagedPropertiesResult() by tracking VPN providers and networks separate… Created 5 years, 9 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
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'));
}

Powered by Google App Engine
This is Rietveld 408576698