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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/shared/js/util.js
diff --git a/chrome/browser/resources/shared/js/util.js b/chrome/browser/resources/shared/js/util.js
index 1a927d1a6ee7f768a79cbc80b166090f9afeb2b3..2d75ea2e6184a437d5afdcc19d09bfc9ac63eb36 100644
--- a/chrome/browser/resources/shared/js/util.js
+++ b/chrome/browser/resources/shared/js/util.js
@@ -226,3 +226,15 @@ function appendParam(url, key, value) {
return url + '?' + param;
return url + '&' + param;
}
+
+/**
+ * Creates a new URL for a favicon request.
+ * @param {string} url The url for the favicon.
+ * @param {number=} opt_size Optional preferred size of the favicon.
+ * @return {string} Updated URL for the favicon.
+ */
+function getFaviconURL(url, opt_size) {
+ var size = opt_size || 16;
+ return 'chrome://favicon/size/' + size + '@' +
+ window.devicePixelRatio + 'x/' + url;
+}
« 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