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_handler.h" | 5 #include "chrome/browser/favicon/favicon_handler.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 base_size = gfx::kFaviconSize; | 60 base_size = gfx::kFaviconSize; |
61 break; | 61 break; |
62 case chrome::TOUCH_ICON: | 62 case chrome::TOUCH_ICON: |
63 case chrome::TOUCH_PRECOMPOSED_ICON: | 63 case chrome::TOUCH_PRECOMPOSED_ICON: |
64 base_size = kTouchIconSize; | 64 base_size = kTouchIconSize; |
65 break; | 65 break; |
66 case chrome::INVALID_ICON: | 66 case chrome::INVALID_ICON: |
67 base_size = 0; | 67 base_size = 0; |
68 break; | 68 break; |
69 } | 69 } |
70 return ui::GetScaleFactorScale(ui::GetMaxScaleFactor()) * base_size; | 70 return gfx::ImageSkia::GetMaxSupportedScale() * base_size; |
71 } | 71 } |
72 | 72 |
73 bool DoUrlAndIconMatch(const FaviconURL& favicon_url, | 73 bool DoUrlAndIconMatch(const FaviconURL& favicon_url, |
74 const GURL& url, | 74 const GURL& url, |
75 chrome::IconType icon_type) { | 75 chrome::IconType icon_type) { |
76 return favicon_url.icon_url == url && | 76 return favicon_url.icon_url == url && |
77 favicon_url.icon_type == static_cast<FaviconURL::IconType>(icon_type); | 77 favicon_url.icon_type == static_cast<FaviconURL::IconType>(icon_type); |
78 } | 78 } |
79 | 79 |
80 // Returns true if all of the icon URLs and icon types in |bitmap_results| are | 80 // Returns true if all of the icon URLs and icon types in |bitmap_results| are |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 const int download_id = DownloadFavicon(image_url, image_size, icon_type); | 622 const int download_id = DownloadFavicon(image_url, image_size, icon_type); |
623 if (download_id) { | 623 if (download_id) { |
624 // Download ids should be unique. | 624 // Download ids should be unique. |
625 DCHECK(download_requests_.find(download_id) == download_requests_.end()); | 625 DCHECK(download_requests_.find(download_id) == download_requests_.end()); |
626 download_requests_[download_id] = | 626 download_requests_[download_id] = |
627 DownloadRequest(url, image_url, icon_type); | 627 DownloadRequest(url, image_url, icon_type); |
628 } | 628 } |
629 | 629 |
630 return download_id; | 630 return download_id; |
631 } | 631 } |
OLD | NEW |