OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/browser/fav_icon_helper.h" | 5 #include "chrome/browser/fav_icon_helper.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
| 9 #include "app/gfx/favicon_size.h" |
9 #include "base/gfx/png_decoder.h" | 10 #include "base/gfx/png_decoder.h" |
10 #include "base/gfx/png_encoder.h" | 11 #include "base/gfx/png_encoder.h" |
11 #include "chrome/browser/renderer_host/render_view_host.h" | 12 #include "chrome/browser/renderer_host/render_view_host.h" |
12 #include "chrome/browser/tab_contents/navigation_controller.h" | 13 #include "chrome/browser/tab_contents/navigation_controller.h" |
13 #include "chrome/browser/tab_contents/navigation_entry.h" | 14 #include "chrome/browser/tab_contents/navigation_entry.h" |
14 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 15 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
15 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
16 #include "chrome/common/gfx/favicon_size.h" | |
17 #include "skia/ext/image_operations.h" | 17 #include "skia/ext/image_operations.h" |
18 | 18 |
19 FavIconHelper::FavIconHelper(TabContents* tab_contents) | 19 FavIconHelper::FavIconHelper(TabContents* tab_contents) |
20 : tab_contents_(tab_contents), | 20 : tab_contents_(tab_contents), |
21 got_fav_icon_url_(false), | 21 got_fav_icon_url_(false), |
22 got_fav_icon_from_history_(false), | 22 got_fav_icon_from_history_(false), |
23 fav_icon_expired_(false) { | 23 fav_icon_expired_(false) { |
24 } | 24 } |
25 | 25 |
26 void FavIconHelper::FetchFavIcon(const GURL& url) { | 26 void FavIconHelper::FetchFavIcon(const GURL& url) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 int width = image.width(); | 253 int width = image.width(); |
254 int height = image.height(); | 254 int height = image.height(); |
255 if (width > 0 && height > 0) { | 255 if (width > 0 && height > 0) { |
256 calc_favicon_target_size(&width, &height); | 256 calc_favicon_target_size(&width, &height); |
257 return skia::ImageOperations::Resize( | 257 return skia::ImageOperations::Resize( |
258 image, skia::ImageOperations::RESIZE_LANCZOS3, | 258 image, skia::ImageOperations::RESIZE_LANCZOS3, |
259 width, height); | 259 width, height); |
260 } | 260 } |
261 return image; | 261 return image; |
262 } | 262 } |
OLD | NEW |