| Index: chrome/browser/favicon/favicon_tab_helper.cc
|
| diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
|
| index a0e833a3357e28b7b9a1b4c9689039343d6a0e00..649527224d2320742a7ed224d7447cb3d0478778 100644
|
| --- a/chrome/browser/favicon/favicon_tab_helper.cc
|
| +++ b/chrome/browser/favicon/favicon_tab_helper.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "chrome/browser/favicon/favicon_handler.h"
|
| #include "chrome/browser/favicon/favicon_util.h"
|
| +#include "chrome/browser/favicon/select_favicon_frames.h"
|
| #include "chrome/browser/history/history.h"
|
| #include "chrome/browser/history/history_service_factory.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -24,6 +25,8 @@
|
| #include "content/public/browser/web_ui.h"
|
| #include "ui/gfx/codec/png_codec.h"
|
| #include "ui/gfx/image/image.h"
|
| +#include "ui/gfx/image/image_skia.h"
|
| +#include "ui/gfx/image/image_skia_rep.h"
|
|
|
| using content::FaviconStatus;
|
| using content::NavigationController;
|
| @@ -186,11 +189,22 @@ bool FaviconTabHelper::OnMessageReceived(const IPC::Message& message) {
|
| return message_handled;
|
| }
|
|
|
| -void FaviconTabHelper::OnDidDownloadFavicon(int id,
|
| - const GURL& image_url,
|
| - bool errored,
|
| - const SkBitmap& image) {
|
| - gfx::Image favicon(image);
|
| +void FaviconTabHelper::OnDidDownloadFavicon(
|
| + int id,
|
| + const GURL& image_url,
|
| + bool errored,
|
| + int requested_size,
|
| + const std::vector<SkBitmap>& bitmaps) {
|
| + // TODO: Possibly do bitmap selection in FaviconHandler, so that it can score
|
| + // favicons better.
|
| + std::vector<ui::ScaleFactor> scale_factors;
|
| +#if defined(OS_MACOSX)
|
| + scale_factors = ui::GetSupportedScaleFactors();
|
| +#else
|
| + scale_factors.push_back(ui::SCALE_FACTOR_100P); // TODO: Aura?
|
| +#endif
|
| + gfx::Image favicon(
|
| + SelectFaviconFrames(bitmaps, scale_factors, requested_size));
|
| favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon);
|
| if (touch_icon_handler_.get())
|
| touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon);
|
|
|