Chromium Code Reviews| 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); |
| } |
| } |