Index: chrome/browser/history/history_service.cc |
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc |
index aee38c899a9c99b5635cd81d1526576acad38e1e..9d86d30b06a25102289e39153304877a6b2b04df 100644 |
--- a/chrome/browser/history/history_service.cc |
+++ b/chrome/browser/history/history_service.cc |
@@ -84,6 +84,14 @@ void RunWithFaviconResults( |
callback.Run(*bitmap_results); |
} |
+void RunWithFaviconResult( |
+ const FaviconService::FaviconResultsCallback& callback, |
+ chrome::FaviconBitmapResult* bitmap_result) { |
+ std::vector<chrome::FaviconBitmapResult> results; |
sky
2013/10/18 01:21:59
Again, why the vector here too?
michaelbai
2013/10/18 04:37:02
Done.
|
+ results.push_back(*bitmap_result); |
+ callback.Run(results); |
+} |
+ |
// Extract history::URLRows into GURLs for VisitedLinkMaster. |
class URLIteratorFromURLRows |
: public visitedlink::VisitedLinkMaster::URLIterator { |
@@ -644,6 +652,28 @@ CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL( |
base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); |
} |
+CancelableTaskTracker::TaskId HistoryService::GetLargestFaviconForURL( |
+ const GURL& page_url, |
+ const std::vector<int>& icon_types, |
+ int minimum_size_in_pixels, |
+ const FaviconService::FaviconResultsCallback& callback, |
+ CancelableTaskTracker* tracker) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ LoadBackendIfNecessary(); |
+ |
+ chrome::FaviconBitmapResult* result = new chrome::FaviconBitmapResult(); |
+ return tracker->PostTaskAndReply( |
+ thread_->message_loop_proxy().get(), |
+ FROM_HERE, |
+ base::Bind(&HistoryBackend::GetLargestFaviconForURL, |
+ history_backend_.get(), |
+ page_url, |
+ icon_types, |
+ minimum_size_in_pixels, |
+ result), |
+ base::Bind(&RunWithFaviconResult, callback, base::Owned(result))); |
+} |
+ |
CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( |
chrome::FaviconID favicon_id, |
int desired_size_in_dip, |