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

Unified Diff: ui/gfx/favicon_size.h

Issue 6672065: Support touch icon in FaviconHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reset candidates when FaviconURL is updated Created 9 years, 9 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
« chrome/browser/favicon_helper.cc ('K') | « content/renderer/render_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/favicon_size.h
diff --git a/ui/gfx/favicon_size.h b/ui/gfx/favicon_size.h
index 9d4cdbc07db90759b74e0552e3338342b0873de3..7bd978b4c110a73eff5a75f7e43c5c386c5f9d53 100644
--- a/ui/gfx/favicon_size.h
+++ b/ui/gfx/favicon_size.h
@@ -14,18 +14,20 @@ const int kFaviconSize = 16;
// If the width or height is bigger than the favicon size, a new width/height
// is calculated and returned in width/height that maintains the aspect
// ratio of the supplied values.
-static void calc_favicon_target_size(int* width, int* height) ALLOW_UNUSED;
+static void calc_favicon_target_size(int target_size,
sky 2011/03/23 22:49:31 Do we really need these changes? Aren't you still
michaelbai 2011/03/23 23:26:49 I thought it might useful for touch_icon in the fu
+ int* width,
+ int* height) ALLOW_UNUSED;
// static
-void calc_favicon_target_size(int* width, int* height) {
- if (*width > kFaviconSize || *height > kFaviconSize) {
+void calc_favicon_target_size(int target_size, int* width, int* height) {
+ if (*width > target_size || *height > target_size) {
// Too big, resize it maintaining the aspect ratio.
float aspect_ratio = static_cast<float>(*width) /
static_cast<float>(*height);
- *height = kFaviconSize;
+ *height = target_size;
*width = static_cast<int>(aspect_ratio * *height);
- if (*width > kFaviconSize) {
- *width = kFaviconSize;
+ if (*width > target_size) {
+ *width = target_size;
*height = static_cast<int>(*width / aspect_ratio);
}
}
« chrome/browser/favicon_helper.cc ('K') | « content/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698