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

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

Issue 10909236: Add support for favicon scale factor in WebUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix HandleGetFaviconDominantColor. Created 8 years, 3 months 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) 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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/search_engine_manager_engine_list.js ('k') | chrome/browser/ui/webui/favicon_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698