Index: chrome/browser/resources/gaia_auth/util.js |
diff --git a/chrome/browser/resources/gaia_auth/util.js b/chrome/browser/resources/gaia_auth/util.js |
index 33d344c2890cf833ecb67862e07eb6e9d4ec8255..3735ae7c9cf957ea7175affd9b9393f867672f01 100644 |
--- a/chrome/browser/resources/gaia_auth/util.js |
+++ b/chrome/browser/resources/gaia_auth/util.js |
@@ -25,3 +25,20 @@ function getUrlSearchParams(search) { |
return params; |
} |
+ |
+/** |
+ * Creates a new URL which is the old URL with a GET param of key=value. |
+ * Copied from ui/webui/resources/js/util.js. |
+ * @param {string} url The base URL. There is not sanity checking on the URL so |
+ * it must be passed in a proper format. |
+ * @param {string} key The key of the param. |
+ * @param {string} value The value of the param. |
+ * @return {string} The new URL. |
+ */ |
+function appendParam(url, key, value) { |
+ var param = encodeURIComponent(key) + '=' + encodeURIComponent(value); |
+ |
+ if (url.indexOf('?') == -1) |
+ return url + '?' + param; |
+ return url + '&' + param; |
+} |