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

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: compile fixes 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
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 e.button, 180 e.button,
181 e.altKey, 181 e.altKey,
182 e.ctrlKey, 182 e.ctrlKey,
183 e.metaKey, 183 e.metaKey,
184 e.shiftKey 184 e.shiftKey
185 ]); 185 ]);
186 e.preventDefault(); 186 e.preventDefault();
187 } 187 }
188 } 188 }
189 }); 189 });
190
191 /**
192 * Creates a new URL which is the old URL with a GET param of key=value.
193 * @param {string} url The base URL. There is not sanity checking on the URL so
194 * it must be passed in a proper format.
195 * @param {string} key The key of the param.
196 * @param {string} value The value of the param.
197 * @return {string}
198 */
199 function appendParam(url, key, value) {
200 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
201
202 if (url.indexOf('?') == -1)
203 return url + '?' + param;
204 return url + '&' + param;
205 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698