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

Unified Diff: remoting/webapp/base.js

Issue 450383003: Hangout remote desktop part II - background.html and AppLauncher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address 2nd round feedbacks 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
« no previous file with comments | « remoting/webapp/background/background.js ('k') | remoting/webapp/hangout_session.js » ('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 4771e53714a1ca25bc858485f95159525aaf0d1b..d12db235d23a6b507bb86676a16051b1dfbd7019 100644
--- a/remoting/webapp/base.js
+++ b/remoting/webapp/base.js
@@ -112,6 +112,26 @@ base.values = function(dict) {
});
};
+
+/**
+ * Joins the |url| with optional query parameters defined in |opt_params|
+ * See unit test for usage.
+ * @param {string} url
+ * @param {Object.<string>=} opt_params
+ * @return {string}
+ */
+base.urlJoin = function(url, opt_params) {
+ if (!opt_params) {
+ return url;
+ }
+ var queryParameters = [];
+ for (var key in opt_params) {
+ queryParameters.push(encodeURIComponent(key) + "=" +
+ encodeURIComponent(opt_params[key]));
+ }
+ return url + '?' + queryParameters.join('&');
+};
+
base.Promise = function() {};
/**
« no previous file with comments | « remoting/webapp/background/background.js ('k') | remoting/webapp/hangout_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698