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

Unified Diff: ui/webui/resources/cr_elements/network/cr_onc_types.js

Issue 2311473002: MD Settings: Third party VPN support (Closed)
Patch Set: . Created 4 years, 3 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
« no previous file with comments | « ui/webui/resources/cr_elements/network/cr_network_list_item.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/network/cr_onc_types.js
diff --git a/ui/webui/resources/cr_elements/network/cr_onc_types.js b/ui/webui/resources/cr_elements/network/cr_onc_types.js
index 7abb4310712f6a76ede592b87eb412f17263a0ac..08ad9e0c017820ec00229f1553dd93b364821d2e 100644
--- a/ui/webui/resources/cr_elements/network/cr_onc_types.js
+++ b/ui/webui/resources/cr_elements/network/cr_onc_types.js
@@ -314,22 +314,23 @@ CrOnc.getAutoConnect = function(properties) {
/**
* @param {!CrOnc.NetworkProperties|!CrOnc.NetworkStateProperties|undefined}
* properties The ONC network properties or state properties.
+ * @param {!Object} caller The caller, passed as 'this' to i18.
michaelpg 2016/09/06 21:22:08 i18n
michaelpg 2016/09/06 21:22:09 nit: this is normally called "context", as it's th
stevenjb 2016/09/12 23:12:27 Done.
stevenjb 2016/09/12 23:12:27 Done.
* @param {!Object<function(string, ...string):string>} i18n
* @return {string} The name to display for |network|.
*/
-CrOnc.getNetworkName = function(properties, i18n) {
+CrOnc.getNetworkName = function(properties, caller, i18n) {
if (!properties)
return '';
let name = CrOnc.getStateOrActiveString(properties.Name);
let type = CrOnc.getStateOrActiveString(properties.Type);
if (!name)
- return i18n.call('OncType' + type);
+ return i18n.call(caller, 'OncType' + type);
michaelpg 2016/09/06 21:22:08 actually, this function would be simpler if you si
stevenjb 2016/09/12 23:12:27 OK, after a bit of wrangling I was able to define
if (type == 'VPN' && properties.VPN) {
let vpnType = CrOnc.getStateOrActiveString(properties.VPN.Type);
if (vpnType == 'ThirdPartyVPN' && properties.VPN.ThirdPartyVPN) {
let providerName = properties.VPN.ThirdPartyVPN.ProviderName;
if (providerName)
- return i18n.call('vpnNameTemplate', providerName, name);
+ return i18n.call(caller, 'vpnNameTemplate', providerName, name);
}
}
return name;
« no previous file with comments | « ui/webui/resources/cr_elements/network/cr_network_list_item.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698