Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: chrome/browser/installable/installable_manager.cc

Issue 2662103002: Refactor ManifestIconSelector and update it for Manifest.icon.purpose (Closed)
Patch Set: Addressing comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/installable/installable_manager.cc
diff --git a/chrome/browser/installable/installable_manager.cc b/chrome/browser/installable/installable_manager.cc
index a9d95f4b3cae5451cab2dae041556d4abf138106..9bca520f609693fe803534334440a5d8dc2d6a2f 100644
--- a/chrome/browser/installable/installable_manager.cc
+++ b/chrome/browser/installable/installable_manager.cc
@@ -439,16 +439,9 @@ void InstallableManager::CheckAndFetchBestIcon(const IconParams& params) {
IconProperty& icon = icons_[params];
icon.fetched = true;
- // Filter by icon purpose.
- std::vector<content::Manifest::Icon> filtered_icons;
- std::copy_if(manifest().icons.begin(), manifest().icons.end(),
- std::back_inserter(filtered_icons),
- [icon_purpose](const content::Manifest::Icon& icon) {
- return base::ContainsValue(icon.purpose, icon_purpose);
- });
-
GURL icon_url = ManifestIconSelector::FindBestMatchingIcon(
- filtered_icons, ideal_icon_size_in_px, minimum_icon_size_in_px);
+ manifest().icons, ideal_icon_size_in_px, minimum_icon_size_in_px,
+ icon_purpose);
if (icon_url.is_empty()) {
icon.error = NO_ACCEPTABLE_ICON;

Powered by Google App Engine
This is Rietveld 408576698