Index: chrome/browser/favicon/favicon_handler.cc |
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc |
index 41d388c6c8417b5554ef712635583daf6d25cbd0..ff751a9ae96dea517baafa7c3fdf49781214438d 100644 |
--- a/chrome/browser/favicon/favicon_handler.cc |
+++ b/chrome/browser/favicon/favicon_handler.cc |
@@ -166,7 +166,8 @@ bool FaviconHandler::UpdateFaviconCandidate(const GURL& url, |
bool update_candidate = false; |
SkBitmap bitmap = *(image.ToSkBitmap()); |
int bitmap_size = std::max(bitmap.width(), bitmap.height()); |
- bool exact_match = (bitmap_size == preferred_icon_size()); |
+fprintf(stderr, "size: %d %d\n", bitmap_size, preferred_icon_size()); |
+ bool exact_match = (bitmap_size == preferred_icon_size() || bitmap_size / 2 == preferred_icon_size()); // XXX |
if (preferred_icon_size() == 0) { |
// No preferred size, use this icon. |
update_candidate = true; |
@@ -199,7 +200,7 @@ void FaviconHandler::SetFavicon( |
const GURL& image_url, |
const gfx::Image& image, |
history::IconType icon_type) { |
- SkBitmap bitmap = *(image.ToSkBitmap()); |
+ SkBitmap bitmap = *(image.ToSkBitmap()); // XXX |
const gfx::Image& sized_image = (preferred_icon_size() == 0 || |
(preferred_icon_size() == bitmap.width() && |
preferred_icon_size() == bitmap.height())) ? |
@@ -215,7 +216,8 @@ void FaviconHandler::SetFavicon( |
NavigationEntry* entry = GetEntry(); |
if (entry) { |
entry->GetFavicon().url = image_url; |
- UpdateFavicon(entry, &sized_image); |
+ //UpdateFavicon(entry, &sized_image); |
+ UpdateFavicon(entry, &image); |
} |
} |
} |
@@ -235,7 +237,8 @@ void FaviconHandler::UpdateFavicon(NavigationEntry* entry, |
if (!image) |
return; |
- entry->GetFavicon().bitmap = *image->ToSkBitmap(); |
+ entry->GetFavicon().bitmap = *image->ToSkBitmap(); // XXX |
+ entry->GetFavicon().image = *image; |
delegate_->NotifyFaviconUpdated(); |
} |
@@ -341,7 +344,7 @@ NavigationEntry* FaviconHandler::GetEntry() { |
return NULL; |
} |
-int FaviconHandler::DownloadFavicon(const GURL& image_url, int image_size) { |
+int FaviconHandler::DownloadFavicon(const GURL& image_url, const std::vector<int>& image_size) { |
if (!image_url.is_valid()) { |
NOTREACHED(); |
return 0; |
@@ -443,6 +446,7 @@ void FaviconHandler::OnFaviconDataForInitialURL( |
// renderer to download the icon. |
} |
+// XXX |
void FaviconHandler::DownloadFaviconOrAskHistory( |
const GURL& page_url, |
const GURL& icon_url, |
@@ -514,7 +518,10 @@ int FaviconHandler::ScheduleDownload( |
int image_size, |
history::IconType icon_type, |
const FaviconTabHelper::ImageDownloadCallback& callback) { |
- const int download_id = DownloadFavicon(image_url, image_size); |
+ std::vector<int> sizes; |
+ sizes.push_back(image_size); |
+ sizes.push_back(2 * image_size); // XXX mac-specific |
pkotwicz
2012/08/02 23:47:08
Can you use ui::GetSupportedScaleFactors here inst
|
+ const int download_id = DownloadFavicon(image_url, sizes); |
if (download_id) { |
// Download ids should be unique. |
DCHECK(download_requests_.find(download_id) == download_requests_.end()); |