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

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..e2b2d08140c74f42755d5195db260764fcf72c95 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
- // 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
+ // Used by the FaviconService to get favicons mapped to |params|.page_url for
+ // icon_types in |params|.icon_types_in_priority which most closely match
sky 2013/10/10 20:35:12 |params.icon_types| (|s around the whole thing).
michaelbai 2013/10/10 22:39:58 Done.
+ // |params|.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 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.
+ // |params|.icon_types_in_priority 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_in_priority 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_in_priority 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