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

Unified Diff: chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js

Issue 1920253002: Refactors parse_html_subset() into i18n_behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/md_user_manager/supervised_user_create_confirm.js
diff --git a/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js b/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
index 52a91cf66e8de585612ffed59c370cd6f89d85a1..e70b99f8a60e1b3b509fbc7ecb931f7fc3c958b6 100644
--- a/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
+++ b/chrome/browser/resources/md_user_manager/supervised_user_create_confirm.js
@@ -94,18 +94,7 @@ Polymer({
*/
titleText_: function(profileInfo) {
return this.i18n('supervisedUserCreatedTitle',
- this.elideProfileName_(profileInfo));
- },
-
- /**
- * Sanitizes HTML so that insecure HTML/Javascript won't be set as innerHTML.
- * @param {string} html
- * @return {string}
- * @private
- */
- sanitizeHtml_: function(html) {
- return parseHtmlSubset('<div>' + html + '<div>', ['A', 'DIV'])
- .firstChild.innerHTML;
+ [this.elideProfileName_(profileInfo)]);
},
/**
@@ -116,9 +105,8 @@ Polymer({
* @private
*/
htmlMessage1_: function(profileInfo) {
- return this.sanitizeHtml_(
- this.i18n('supervisedUserCreatedTextPart1',
- HTMLEscape(this.elideProfileName_(profileInfo))));
+ return this.i18n('supervisedUserCreatedTextPart1',
+ [HTMLEscape(this.elideProfileName_(profileInfo))]);
},
/**
@@ -129,10 +117,9 @@ Polymer({
* @private
*/
htmlMessage2_: function(profileInfo) {
- return this.sanitizeHtml_(
- this.i18n('supervisedUserCreatedTextPart2',
- this.elideProfileName_(profileInfo),
- this.elideCustodianUsername_(profileInfo)));
+ return this.i18n('supervisedUserCreatedTextPart2',
+ [this.elideProfileName_(profileInfo),
+ this.elideCustodianUsername_(profileInfo)]);
},
/**
@@ -143,7 +130,7 @@ Polymer({
*/
switchUserText_: function(profileInfo) {
return this.i18n('supervisedUserCreatedSwitch',
- this.elideProfileName_(profileInfo));
+ [this.elideProfileName_(profileInfo)]);
},
/**

Powered by Google App Engine
This is Rietveld 408576698