Chromium Code Reviews| Index: chrome/browser/resources/md_user_manager/create_profile.js |
| diff --git a/chrome/browser/resources/md_user_manager/create_profile.js b/chrome/browser/resources/md_user_manager/create_profile.js |
| index 8f12f20550132ecc66275d85cc7c36e873afcade..a9f19dc14be4fe6b9285d0368ebfa85048da3cc4 100644 |
| --- a/chrome/browser/resources/md_user_manager/create_profile.js |
| +++ b/chrome/browser/resources/md_user_manager/create_profile.js |
| @@ -282,10 +282,28 @@ Polymer({ |
| } |
| } |
| + var opts = { |
| + 'substitutions': |
| + [HTMLEscape(elide(this.profileName_, /* maxLength */ 50))], |
| + 'attrs': { |
| + 'id': function(node, value) { |
| + return node.tagName == 'A' && value != ''; |
| + }, |
| + 'is': function(node, value) { |
| + return node.tagName == 'A' && value == 'action-link'; |
| + }, |
| + 'role': function(node, value) { |
| + return node.tagName == 'A' && value == 'link'; |
| + }, |
| + 'tabindex': function(node, value) { |
| + return node.tagName == 'A'; |
| + } |
| + } |
| + }; |
| + |
| this.handleMessage_(allOnCurrentDevice ? |
| this.i18n('managedProfilesExistingLocalSupervisedUser') : |
| - this.i18n('manageProfilesExistingSupervisedUser', |
| - HTMLEscape(elide(this.profileName_, /* maxLength */ 50)))); |
| + this.i18nAdvanced('manageProfilesExistingSupervisedUser', opts)); |
| return; |
| } |
| // No existing supervised user's name matches the entered profile name. |
| @@ -383,6 +401,24 @@ Polymer({ |
| }, |
| /** |
| + * Returns a translated message that contains link elements with 'id' |
| + * attribute. |
| + * @param {string} id The ID of the string to translate. |
| + * @private |
| + */ |
| + i18nAllowIDAttr_: function(id) { |
| + var opts = { |
| + 'attrs': { |
| + 'id' : function(node, value) { |
| + return node.tagName == 'A' && value != ''; |
|
Dan Beam
2016/05/05 16:43:36
i suppose checking for tagName == 'A' isn't bad, b
Moe
2016/05/06 14:24:59
It's not needed. removed.
|
| + } |
| + } |
| + }; |
| + |
| + return this.i18nAdvanced(id, opts); |
|
Dan Beam
2016/05/05 16:43:36
this would be so much prettier
return this.i18n
Moe
2016/05/06 14:24:59
I agree. When can we start using ES6 in chromium?
|
| + }, |
| + |
| + /** |
| * Computed binding determining which profile icon button is toggled on. |
| * @param {string} iconUrl icon URL of a given icon button. |
| * @param {string} profileIconUrl Currently selected icon URL. |