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

Unified Diff: chrome/browser/resources/gaia_auth/util.js

Issue 66403006: Use embedded sign in UI for inline sign in flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add util function for appending param # Created 7 years, 1 month 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/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;
+}
« no previous file with comments | « chrome/browser/resources/gaia_auth/main.js ('k') | chrome/browser/resources/gaia_auth_host/gaia_auth_host.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698