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

Side by Side Diff: chrome/browser/resources/shared/js/util.js

Issue 8526017: Append parameters to webstore URL to indicate launch source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * The global object. 6 * The global object.
7 * @type {!Object} 7 * @type {!Object}
8 */ 8 */
9 const global = this; 9 const global = this;
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 e.button, 142 e.button,
143 e.altKey, 143 e.altKey,
144 e.ctrlKey, 144 e.ctrlKey,
145 e.metaKey, 145 e.metaKey,
146 e.shiftKey 146 e.shiftKey
147 ]); 147 ]);
148 e.preventDefault(); 148 e.preventDefault();
149 } 149 }
150 } 150 }
151 }); 151 });
152
153 /**
154 * Creates a new URL which is the old URL with a GET param of key=value.
155 * @param {string} url The base URL. There is not sanity checking on the URL so
156 * it must be passed in a proper format.
157 * @param {string} key The key of the param.
158 * @param {string} value The value of the param.
159 * @return {string}
160 */
161 function appendParam(url, key, value) {
162 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
163
164 if (url.indexOf('?') == -1)
165 return url + '?' + param;
166 return url + '&' + param;
167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698