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

Unified Diff: chrome/browser/bookmarks/bookmark_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/bookmarks/bookmark_model.cc
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index fcdea2f65e387aeb4bf137203522da8a59306093..30d361bd8aba4b0f69552dc42089f603ddc06be7 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -29,6 +29,7 @@
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_collator.h"
+#include "ui/gfx/favicon_size.h"
#include "ui/gfx/image/image_util.h"
using base::Time;
@@ -777,21 +778,16 @@ BookmarkPermanentNode* BookmarkModel::CreatePermanentNode(
void BookmarkModel::OnFaviconDataAvailable(
FaviconService::Handle handle,
- history::FaviconData favicon) {
+ const history::FaviconImageResult& image_result) {
BookmarkNode* node =
load_consumer_.GetClientData(
FaviconServiceFactory::GetForProfile(
profile_, Profile::EXPLICIT_ACCESS), handle);
DCHECK(node);
node->set_favicon_load_handle(0);
- if (favicon.is_valid()) {
- scoped_ptr<gfx::Image> favicon_image(
- gfx::ImageFromPNGEncodedData(favicon.image_data->front(),
- favicon.image_data->size()));
- if (favicon_image.get()) {
- node->set_favicon(*favicon_image.get());
- FaviconLoaded(node);
- }
+ if (!image_result.image.IsEmpty()) {
+ node->set_favicon(image_result.image);
+ FaviconLoaded(node);
}
}
@@ -804,8 +800,9 @@ void BookmarkModel::LoadFavicon(BookmarkNode* node) {
profile_, Profile::EXPLICIT_ACCESS);
if (!favicon_service)
return;
- FaviconService::Handle handle = favicon_service->GetFaviconForURL(
- profile_, node->url(), history::FAVICON, &load_consumer_,
+ FaviconService::Handle handle = favicon_service->GetFaviconImageForURL(
+ profile_, node->url(), history::FAVICON, gfx::kFaviconSize,
+ &load_consumer_,
base::Bind(&BookmarkModel::OnFaviconDataAvailable,
base::Unretained(this)));
load_consumer_.SetClientData(favicon_service, handle, node);

Powered by Google App Engine
This is Rietveld 408576698