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

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..a4990888722e0e1366dcdd520e21f0d47b68ed2d 100644
--- a/chrome/browser/installable/installable_manager.cc
+++ b/chrome/browser/installable/installable_manager.cc
@@ -4,8 +4,6 @@
#include "chrome/browser/installable/installable_manager.h"
-#include <algorithm>
-
#include "base/bind.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
@@ -439,16 +437,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;
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc ('k') | chrome/browser/manifest/manifest_icon_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698