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

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
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.cc ('k') | chrome/browser/history/select_favicon_frames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.cc
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc
index 9f6f80d9090a3eacc4815a28fc7080bb85766a4f..3f9c6ca2d5056f0fc148b3c6d7d56e86731a133b 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/chrome/browser/history/history_backend.cc
@@ -2240,17 +2240,27 @@ bool HistoryBackend::GetFaviconBitmapResultsForBestMatch(
thumbnail_db_->GetFaviconBitmapIDSizes(candidate_favicon_ids[i],
&bitmap_id_sizes);
- std::vector<FaviconBitmapID> candidate_bitmap_ids;
+ // Build 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);
+ }
}
}
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.cc ('k') | chrome/browser/history/select_favicon_frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698