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

Unified Diff: chrome/browser/sync/glue/bookmark_change_processor.cc

Issue 10910212: Enable hidpi favicons for favicons history does not know about (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/sync/glue/bookmark_change_processor.cc
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index cca79d0e78f6518392be7366d87205b8a98030a8..672be5e836506a191f49cfb415ed5209426a469e 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -25,6 +25,7 @@
#include "sync/internal_api/public/write_node.h"
#include "sync/internal_api/public/write_transaction.h"
#include "sync/syncable/entry.h" // TODO(tim): Investigating bug 121587.
+#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image_util.h"
using content::BrowserThread;
@@ -642,10 +643,18 @@ void BookmarkChangeProcessor::ApplyBookmarkFavicon(
history->AddPageNoVisitForBookmark(bookmark_node->url(),
bookmark_node->GetTitle());
- favicon_service->SetFavicon(bookmark_node->url(),
- fake_icon_url,
- icon_bytes_vector,
- history::FAVICON);
+ // The client may have cached the favicon at 2x. Use MergeFavicon() as not to
+ // overwrite the cached 2x favicon bitmap. Sync favicons are always
+ // gfx::kFaviconSize in width and height. Store the favicon into history
+ // as such.
+ scoped_refptr<base::RefCountedMemory> bitmap_data(
+ new base::RefCountedBytes(icon_bytes_vector));
+ gfx::Size pixel_size(gfx::kFaviconSize, gfx::kFaviconSize);
+ favicon_service->MergeFavicon(bookmark_node->url(),
+ fake_icon_url,
+ history::FAVICON,
+ bitmap_data,
+ pixel_size);
}
// static
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698