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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
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 // TODO: Possibly do bitmap selection in FaviconHandler, so that it can score | 198 // TODO: Possibly do bitmap selection in FaviconHandler, so that it can score |
199 // favicons better. | 199 // favicons better. |
200 std::vector<ui::ScaleFactor> scale_factors; | 200 std::vector<ui::ScaleFactor> scale_factors; |
201 #if defined(OS_MACOSX) | |
202 scale_factors = ui::GetSupportedScaleFactors(); | 201 scale_factors = ui::GetSupportedScaleFactors(); |
203 #else | |
204 scale_factors.push_back(ui::SCALE_FACTOR_100P); // TODO: Aura? | |
205 #endif | |
206 gfx::Image favicon( | 202 gfx::Image favicon( |
207 SelectFaviconFrames(bitmaps, scale_factors, requested_size)); | 203 SelectFaviconFrames(bitmaps, scale_factors, requested_size)); |
208 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); | 204 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); |
209 if (touch_icon_handler_.get()) | 205 if (touch_icon_handler_.get()) |
210 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); | 206 touch_icon_handler_->OnDidDownloadFavicon(id, image_url, errored, favicon); |
211 } | 207 } |
OLD | NEW |