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

Unified Diff: chrome/browser/history/history_service.h

Issue 26563004: Find Favicon in priority of icon_type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 years, 2 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/history/history_service.h
diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h
index 6891f38e71498c86140cb025cf5bfcdd1afeb5a2..f1196bc901074ce4b5e52947af84f5e7d852c4d4 100644
--- a/chrome/browser/history/history_service.h
+++ b/chrome/browser/history/history_service.h
@@ -690,19 +690,32 @@ class HistoryService : public CancelableRequestProvider,
const FaviconService::FaviconResultsCallback& callback,
CancelableTaskTracker* tracker);
- // Used by the FaviconService to get favicons mapped to |page_url| for
- // |icon_types| which most closely match |desired_size_in_dip| and
- // |desired_scale_factors|. If |desired_size_in_dip| is 0, the largest favicon
- // bitmap for |icon_types| is returned. The returned FaviconBitmapResults will
+ // Used by the FaviconService to get favicons mapped to |params.page_url| for
+ // icon_types in |params.icon_types| which most closely match
+ // |params.desired_size_in_dip| and |desired_scale_factors|.
+ // If |desired_size_in_dip| is 0, the largest favicon bitmap for
+ // |params.icon_types| is returned. The returned FaviconBitmapResults will
// have at most one result for each of |desired_scale_factors|. If a favicon
// bitmap is determined to be the best candidate for multiple scale factors
- // there will be less results. If |icon_types| has several types, results for
+ // there will be less results.
+ // |params.icon_types| is a list of icon_type composition and defines the
+ // prefered icon types in priority.
+ // If it has only one element, and this element has several types, results for
// only a single type will be returned in the priority of
// TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON.
+ // if it has more than one element, there is only one icon returned by below
+ // rule:
+ // Among all icons found by |params.desired_size_in_dip| and
+ // |desired_scal_factors|, the largest icon of first types given by
+ // |params.icon_types| is returned, if its size is larger than
+ // |params.threshold_for_next_icon_types|; otherwise, find the largest one
+ // in next icon types in |params.icon_types| and so on.
+ // If none icon is larger than |threshold_for_next_icon_types|, the largest
+ // one among all found icon is returned.
+ // This feature is especially useful when some types of icon is perfered as
+ // long as its size is larger than a specific value.
CancelableTaskTracker::TaskId GetFaviconsForURL(
- const GURL& page_url,
- int icon_types,
- int desired_size_in_dip,
+ const FaviconService::FaviconForURLParams& params,
const std::vector<ui::ScaleFactor>& desired_scale_factors,
const FaviconService::FaviconResultsCallback& callback,
CancelableTaskTracker* tracker);

Powered by Google App Engine
This is Rietveld 408576698