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

Unified Diff: chrome/browser/favicon/favicon_handler.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
« no previous file with comments | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/favicon/favicon_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_handler.cc
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc
index 2cc8c25d964f2945522e6335f65571756d94ff0a..a0e98a563f6e6316f3158dd4e85448d7b299d521 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -249,11 +249,8 @@ void FaviconHandler::SetFavicon(
const GURL& icon_url,
const gfx::Image& image,
history::IconType icon_type) {
- if (GetFaviconService() && ShouldSaveFavicon(url)) {
- std::vector<unsigned char> image_data;
- if (gfx::PNGEncodedDataFromImage(image, &image_data))
- SetHistoryFavicon(url, icon_url, image_data, icon_type);
- }
+ if (GetFaviconService() && ShouldSaveFavicon(url))
+ SetHistoryFavicons(url, icon_url, icon_type, image);
if (UrlMatches(url, url_) && icon_type == history::FAVICON) {
NavigationEntry* entry = GetEntry();
@@ -424,8 +421,13 @@ void FaviconHandler::UpdateFaviconMappingAndFetch(
history::IconType icon_type,
CancelableRequestConsumerBase* consumer,
const FaviconService::FaviconResultsCallback& callback) {
- GetFaviconService()->UpdateFaviconMappingAndFetch(page_url, icon_url,
- icon_type, consumer, callback);
+ // TODO(pkotwicz): pass in all of |image_urls_| to
+ // UpdateFaviconMappingsAndFetch().
+ std::vector<GURL> icon_urls;
+ icon_urls.push_back(icon_url);
+ GetFaviconService()->UpdateFaviconMappingsAndFetch(page_url, icon_urls,
+ icon_type, preferred_icon_size(), ui::GetSupportedScaleFactors(),
+ consumer, callback);
}
void FaviconHandler::GetFavicon(
@@ -448,12 +450,11 @@ void FaviconHandler::GetFaviconForURL(
ui::GetSupportedScaleFactors(), callback);
}
-void FaviconHandler::SetHistoryFavicon(
- const GURL& page_url,
- const GURL& icon_url,
- const std::vector<unsigned char>& image_data,
- history::IconType icon_type) {
- GetFaviconService()->SetFavicon(page_url, icon_url, image_data, icon_type);
+void FaviconHandler::SetHistoryFavicons(const GURL& page_url,
+ const GURL& icon_url,
+ history::IconType icon_type,
+ const gfx::Image& image) {
+ GetFaviconService()->SetFavicons(page_url, icon_url, icon_type, image);
}
bool FaviconHandler::ShouldSaveFavicon(const GURL& url) {
« no previous file with comments | « chrome/browser/favicon/favicon_handler.h ('k') | chrome/browser/favicon/favicon_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698