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

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, 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 | « remoting/webapp/background/message_window.js ('k') | remoting/webapp/message_window.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base.js
diff --git a/remoting/webapp/base.js b/remoting/webapp/base.js
index 17cfc2971f612f3fdb8a5b0f56090bb6e19b20f6..ee909bede327c38f7cac29fcca6f379d5c7ea42e 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.
« no previous file with comments | « remoting/webapp/background/message_window.js ('k') | remoting/webapp/message_window.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698