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

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 10802066: Adds support for saving favicon size into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested by Sky and stevenjb 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/webui/chrome_web_ui_controller_factory.cc
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 48e63b0693fec2e0d952e1e43a717cf4a3db0c20..73a6215a16fdf830a29adde8539451ff4edc8ea1 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -462,13 +462,18 @@ void ChromeWebUIControllerFactory::GetFaviconForURL(
url.host() != extension_misc::kBookmarkManagerId) {
ExtensionWebUI::GetFaviconForURL(profile, request, url);
} else {
- history::FaviconData favicon;
- favicon.image_data = scoped_refptr<base::RefCountedMemory>(
- GetFaviconResourceBytes(url));
- favicon.known_icon = favicon.image_data.get() != NULL &&
- favicon.image_data->size() > 0;
- favicon.icon_type = history::FAVICON;
- request->ForwardResultAsync(request->handle(), favicon);
+ scoped_refptr<base::RefCountedMemory> bitmap(GetFaviconResourceBytes(url));
+ bool bitmap_valid = bitmap.get() != NULL && bitmap->size() > 0;
+ history::FaviconData favicon_data;
+ favicon_data.known_icon = bitmap_valid;
+ favicon_data.icon_type = history::FAVICON;
+ if (bitmap_valid) {
+ history::FaviconDataElement element;
+ element.bitmap_data = bitmap;
+ element.pixel_size = gfx::Size();
+ favicon_data.elements.push_back(element);
+ }
+ request->ForwardResultAsync(request->handle(), favicon_data);
}
}

Powered by Google App Engine
This is Rietveld 408576698