| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/manifest/manifest_icon_selector.h" | 5 #include "chrome/browser/manifest/manifest_icon_selector.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <cmath> | 10 #include <cmath> |
| 9 #include <limits> | 11 #include <limits> |
| 10 | 12 |
| 11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 12 #include "components/mime_util/mime_util.h" | 14 #include "components/mime_util/mime_util.h" |
| 13 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 14 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 15 | 17 |
| 16 using content::Manifest; | 18 using content::Manifest; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 std::vector<Manifest::Icon> icons = | 180 std::vector<Manifest::Icon> icons = |
| 179 ManifestIconSelector::FilterIconsByType(unfiltered_icons); | 181 ManifestIconSelector::FilterIconsByType(unfiltered_icons); |
| 180 | 182 |
| 181 ManifestIconSelector selector(ideal_icon_size_in_px, | 183 ManifestIconSelector selector(ideal_icon_size_in_px, |
| 182 minimum_icon_size_in_px); | 184 minimum_icon_size_in_px); |
| 183 int index = selector.FindBestMatchingIcon(icons, device_scale_factor); | 185 int index = selector.FindBestMatchingIcon(icons, device_scale_factor); |
| 184 if (index == -1) | 186 if (index == -1) |
| 185 return GURL(); | 187 return GURL(); |
| 186 return icons[index].src; | 188 return icons[index].src; |
| 187 } | 189 } |
| OLD | NEW |