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

Unified Diff: chrome/browser/favicon/favicon_service.cc

Issue 1010783002: [Icons NTP] Working prototype to fetch, store, and display big icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/favicon/favicon_service.cc
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index 2bbdadb7b24f594affb165d9d1dd4d622ed04285..8ee927baa0d89168c6e5a929895afce5735c8949 100644
--- a/chrome/browser/favicon/favicon_service.cc
+++ b/chrome/browser/favicon/favicon_service.cc
@@ -271,6 +271,30 @@ base::CancelableTaskTracker::TaskId FaviconService::GetLargestRawFaviconForID(
return RunWithEmptyResultAsync(callback_runner, tracker);
}
+base::CancelableTaskTracker::TaskId FaviconService::HackGetBigIcon(
+ const GURL& page_url,
+ int desired_size_in_pixel,
+ const favicon_base::FaviconRawBitmapCallback& callback,
+ base::CancelableTaskTracker* tracker) {
+ favicon_base::FaviconResultsCallback favicon_results_callback =
+ Bind(&FaviconService::RunFaviconRawBitmapCallbackWithBitmapResults,
+ base::Unretained(this),
+ callback,
+ 0);
+ if (history_service_) {
+ int icon_types =
+ favicon_base::TOUCH_ICON | favicon_base::TOUCH_PRECOMPOSED_ICON;
+ std::vector<int> desired_sizes_in_pixel;
+ desired_sizes_in_pixel.push_back(desired_size_in_pixel);
+ return history_service_->GetFaviconsForURL(page_url,
+ icon_types,
+ desired_sizes_in_pixel,
+ favicon_results_callback,
+ tracker);
+ }
+ return RunWithEmptyResultAsync(favicon_results_callback, tracker);
+}
+
void FaviconService::SetFaviconOutOfDateForPage(const GURL& page_url) {
if (history_service_)
history_service_->SetFaviconsOutOfDateForPage(page_url);

Powered by Google App Engine
This is Rietveld 408576698