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

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: Addressed comments Created 4 years, 7 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..608187669118a2e85ae6e312f0e2609fa2bfb83c 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
@@ -98,17 +98,6 @@ Polymer({
},
/**
- * 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;
- },
-
- /**
* Computed binding returning the part 1 of the confirmation message. Returns
* sanitized HTML that is safe to set as innerHTML.
* @param {?ProfileInfo} 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));
},
/**

Powered by Google App Engine
This is Rietveld 408576698