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

Unified Diff: chrome/browser/ui/toolbar/back_forward_menu_model.cc

Issue 10870022: Change FaviconData to be able to return data for multiple bitmaps for same icon URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/ui/toolbar/back_forward_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
index 955a9e7bc380cefe82869b348e4ff24b0d696dfa..cffdeeabdeeceddc6cda1ee86cdc785b08fccfd0 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc
@@ -253,8 +253,9 @@ void BackForwardMenuModel::FetchFavicon(NavigationEntry* entry) {
void BackForwardMenuModel::OnFavIconDataAvailable(
FaviconService::Handle handle,
- history::FaviconData favicon) {
- if (favicon.is_valid()) {
+ history::FaviconData favicon_data,
+ std::vector<GURL> icon_urls_in_db) {
+ if (favicon_data.has_valid_bitmaps()) {
int unique_id = load_consumer_.GetClientDataForCurrentRequest();
// Find the current model_index for the unique_id.
NavigationEntry* entry = NULL;
@@ -277,10 +278,12 @@ void BackForwardMenuModel::OnFavIconDataAvailable(
// Now that we have a valid NavigationEntry, decode the favicon and assign
// it to the NavigationEntry.
- gfx::Image icon(favicon.image_data->front(), favicon.image_data->size());
+ scoped_refptr<base::RefCountedMemory> bitmap_data(
+ favicon_data.first_bitmap());
+ gfx::Image icon(bitmap_data->front(), bitmap_data->size());
if (!icon.IsEmpty()) {
entry->GetFavicon().valid = true;
- entry->GetFavicon().url = favicon.icon_url;
+ entry->GetFavicon().url = favicon_data.icon_url;
// TODO: Once the history service returns more representations,
// use them all instead of having just the lodpi favicon.
entry->GetFavicon().image = icon;

Powered by Google App Engine
This is Rietveld 408576698