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

Unified Diff: remoting/webapp/base.js

Issue 503063004: Hangouts Remote Desktop Part VI - Show confirm dialog before retrieving access code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: remoting/webapp/base.js
diff --git a/remoting/webapp/base.js b/remoting/webapp/base.js
index c2bf1a2b54b28a67c9f7422f10887a5dae5bd2e9..87f59473a1e40d598b9abda80df13678fa8e0e1d 100644
--- a/remoting/webapp/base.js
+++ b/remoting/webapp/base.js
@@ -150,6 +150,18 @@ base.urlJoin = function(url, opt_params) {
};
/**
+ * Convert special characters (e.g. &, < and >) to HTML entities.
+ *
+ * @param {string} str
+ * @return {string}
+ */
+base.escapeHTML = function(str) {
+ var div = document.createElement('div');
+ div.appendChild(document.createTextNode(str));
+ return div.innerHTML;
+};
+
+/**
* Promise is a great tool for writing asynchronous code. However, the construct
* var p = new promise(function init(resolve, reject) {
* ... // code that fulfills the Promise.

Powered by Google App Engine
This is Rietveld 408576698