OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @const | 8 * @const |
9 */ | 9 */ |
10 var global = this; | 10 var global = this; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 * @param {string} value The value of the param. | 219 * @param {string} value The value of the param. |
220 * @return {string} The new URL. | 220 * @return {string} The new URL. |
221 */ | 221 */ |
222 function appendParam(url, key, value) { | 222 function appendParam(url, key, value) { |
223 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value); | 223 var param = encodeURIComponent(key) + '=' + encodeURIComponent(value); |
224 | 224 |
225 if (url.indexOf('?') == -1) | 225 if (url.indexOf('?') == -1) |
226 return url + '?' + param; | 226 return url + '?' + param; |
227 return url + '&' + param; | 227 return url + '&' + param; |
228 } | 228 } |
229 | |
230 /** | |
231 * Creates a new URL for a favicon request. | |
232 * @param {string} url The url for the favicon. | |
233 * @param {number=} opt_size Optional preferred size of the favicon. | |
234 * @return {string} Updated URL for the favicon. | |
235 */ | |
236 function getFaviconUrl(url, opt_size) { | |
237 var size = opt_size || 16; | |
238 return 'chrome://favicon/size/' + size + '@' + | |
239 window.devicePixelRatio + 'x/' + url; | |
240 } | |
OLD | NEW |