| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/favicon/favicon_tab_helper.h" | 5 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/favicon/favicon_handler.h" | 7 #include "chrome/browser/favicon/favicon_handler.h" |
| 8 #include "chrome/browser/favicon/favicon_util.h" | 8 #include "chrome/browser/favicon/favicon_util.h" |
| 9 #include "chrome/browser/favicon/select_favicon_frames.h" | 9 #include "chrome/browser/favicon/select_favicon_frames.h" |
| 10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void FaviconTabHelper::OnDidDownloadFavicon( | 192 void FaviconTabHelper::OnDidDownloadFavicon( |
| 193 int id, | 193 int id, |
| 194 const GURL& image_url, | 194 const GURL& image_url, |
| 195 bool errored, | 195 bool errored, |
| 196 int requested_size, | 196 int requested_size, |
| 197 const std::vector<SkBitmap>& bitmaps) { | 197 const std::vector<SkBitmap>& bitmaps) { |
| 198 float score = 0; | 198 float score = 0; |
| 199 // TODO: Possibly do bitmap selection in FaviconHandler, so that it can score | 199 // TODO: Possibly do bitmap selection in FaviconHandler, so that it can score |
| 200 // favicons better. | 200 // favicons better. |
| 201 std::vector<ui::ScaleFactor> scale_factors; | 201 std::vector<ui::ScaleFactor> scale_factors; |
| 202 #if defined(OS_MACOSX) | |
| 203 scale_factors = ui::GetSupportedScaleFactors(); | 202 scale_factors = ui::GetSupportedScaleFactors(); |
| 204 #else | |
| 205 scale_factors.push_back(ui::SCALE_FACTOR_100P); // TODO: Aura? | |
| 206 #endif | |
| 207 gfx::Image favicon(SelectFaviconFrames( | 203 gfx::Image favicon(SelectFaviconFrames( |
| 208 bitmaps, scale_factors, requested_size, &score)); | 204 bitmaps, scale_factors, requested_size, &score)); |
| 209 favicon_handler_->OnDidDownloadFavicon( | 205 favicon_handler_->OnDidDownloadFavicon( |
| 210 id, image_url, errored, favicon, score); | 206 id, image_url, errored, favicon, score); |
| 211 if (touch_icon_handler_.get()) { | 207 if (touch_icon_handler_.get()) { |
| 212 touch_icon_handler_->OnDidDownloadFavicon( | 208 touch_icon_handler_->OnDidDownloadFavicon( |
| 213 id, image_url, errored, favicon, score); | 209 id, image_url, errored, favicon, score); |
| 214 } | 210 } |
| 215 } | 211 } |
| OLD | NEW |