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

Unified Diff: chrome/browser/history/history_backend.cc

Issue 10911149: Cleanup FaviconHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 6e29984aa42d0d88eeeff59cf691bf31535bc51f..a5d8a5187b9e5b7b81e3fa82dfe5eab60e3145e6 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -2167,17 +2167,27 @@ bool HistoryBackend::GetFaviconBitmapResultsForBestMatch(
thumbnail_db_->GetFaviconBitmapIDSizes(candidate_favicon_ids[i],
&bitmap_id_sizes);
- std::vector<FaviconBitmapID> candidate_bitmap_ids;
+ // Get vector of gfx::Size from |bitmap_id_sizes|.
+ std::vector<gfx::Size> sizes;
+ for (size_t j = 0; j < bitmap_id_sizes.size(); ++j)
+ sizes.push_back(bitmap_id_sizes[j].pixel_size);
+
+ std::vector<size_t> candidate_bitmap_indices;
float score = 0;
- SelectFaviconBitmapIDs(bitmap_id_sizes,
- desired_scale_factors,
- desired_size_in_dip,
- &candidate_bitmap_ids,
- &score);
+ SelectFaviconFrameIndices(sizes,
+ desired_scale_factors,
+ desired_size_in_dip,
+ &candidate_bitmap_indices,
+ &score);
if (score > highest_score) {
- best_favicon_id = candidate_favicon_ids[i],
- best_bitmap_ids.swap(candidate_bitmap_ids);
highest_score = score;
+ best_favicon_id = candidate_favicon_ids[i],
+ best_bitmap_ids.clear();
+ for (size_t j = 0; j < candidate_bitmap_indices.size(); ++j) {
+ size_t candidate_index = candidate_bitmap_indices[j];
+ best_bitmap_ids.push_back(
+ bitmap_id_sizes[candidate_index].bitmap_id);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698