Chromium Code Reviews| Index: chrome/browser/favicon/favicon_service.h |
| diff --git a/chrome/browser/favicon/favicon_service.h b/chrome/browser/favicon/favicon_service.h |
| index 9cb4f583e24eeb7a36feeefa05b8167052c585ac..750874c475c945b35481b4dafc9d0075c3c4046e 100644 |
| --- a/chrome/browser/favicon/favicon_service.h |
| +++ b/chrome/browser/favicon/favicon_service.h |
| @@ -31,6 +31,45 @@ class FaviconService : public CancelableRequestProvider, |
| virtual ~FaviconService(); |
| + // Auxiliary argument structure for requesting favicons. |
|
James Hawkins
2012/09/05 22:02:58
Why is this necessary?
Leandro Graciá Gil
2012/09/05 22:04:28
I could remove this case and leave only the URL on
James Hawkins
2012/09/05 22:11:49
Yes, please remove. The FaviconForURLParams is a
|
| + struct FaviconParams { |
| + FaviconParams(const GURL& icon_url, |
| + history::IconType icon_type, |
| + int desired_size_in_dip, |
| + CancelableRequestConsumerBase* consumer) |
| + : icon_url(icon_url), |
| + icon_type(icon_type), |
| + desired_size_in_dip(desired_size_in_dip), |
| + consumer(consumer) { |
| + } |
| + |
| + GURL icon_url; |
| + history::IconType icon_type; |
| + int desired_size_in_dip; |
| + CancelableRequestConsumerBase* consumer; |
| + }; |
| + |
| + // Auxiliary argument structure for requesting favicons for URLs. |
| + struct FaviconForURLParams { |
| + FaviconForURLParams(Profile* profile, |
| + const GURL& page_url, |
| + int icon_types, |
| + int desired_size_in_dip, |
| + CancelableRequestConsumerBase* consumer) |
| + : profile(profile), |
| + page_url(page_url), |
| + icon_types(icon_types), |
| + desired_size_in_dip(desired_size_in_dip), |
| + consumer(consumer) { |
| + } |
| + |
| + Profile* profile; |
| + GURL page_url; |
| + int icon_types; |
| + int desired_size_in_dip; |
| + CancelableRequestConsumerBase* consumer; |
| + }; |
| + |
| // Callback for GetFaviconImage() and GetFaviconImageForURL(). |
| // |FaviconImageResult::image| is constructed from the bitmaps for the |
| // passed in URL and icon types which most which closely match the passed in |
| @@ -85,24 +124,15 @@ class FaviconService : public CancelableRequestProvider, |
| // Each of the three methods below differs in the format of the callback and |
| // the requested scale factors. All of the scale factors supported by the |
| // current platform (eg MacOS) are requested for GetFaviconImage(). |
| - Handle GetFaviconImage(const GURL& icon_url, |
| - history::IconType icon_type, |
| - int desired_size_in_dip, |
| - CancelableRequestConsumerBase* consumer, |
| + Handle GetFaviconImage(const FaviconParams& params, |
| const FaviconImageCallback& callback); |
| - Handle GetRawFavicon(const GURL& icon_url, |
| - history::IconType icon_type, |
| - int desired_size_in_dip, |
| + Handle GetRawFavicon(const FaviconParams& params, |
| ui::ScaleFactor desired_scale_factor, |
| - CancelableRequestConsumerBase* consumer, |
| const FaviconRawCallback& callback); |
| - Handle GetFavicon(const GURL& icon_url, |
| - history::IconType icon_type, |
| - int desired_size_in_dip, |
| + Handle GetFavicon(const FaviconParams& params, |
| const std::vector<ui::ScaleFactor>& desired_scale_factors, |
| - CancelableRequestConsumerBase* consumer, |
| const FaviconResultsCallback& callback); |
| // Fetches the |icon_type| of favicon at |icon_url|, sending the results to |
| @@ -125,28 +155,16 @@ class FaviconService : public CancelableRequestProvider, |
| // callback and the requested scale factors. All of the scale factors |
| // supported by the current platform (eg MacOS) are requested for |
| // GetFaviconImageForURL(). |
| - Handle GetFaviconImageForURL(Profile* profile, |
| - const GURL& page_url, |
| - int icon_types, |
| - int desired_size_in_dip, |
| - CancelableRequestConsumerBase* consumer, |
| + Handle GetFaviconImageForURL(const FaviconForURLParams& params, |
| const FaviconImageCallback& callback); |
| - Handle GetRawFaviconForURL(Profile* profile, |
| - const GURL& page_url, |
| - int icon_types, |
| - int desired_size_in_dip, |
| + Handle GetRawFaviconForURL(const FaviconForURLParams& params, |
| ui::ScaleFactor desired_scale_factor, |
| - CancelableRequestConsumerBase* consumer, |
| const FaviconRawCallback& callback); |
| Handle GetFaviconForURL( |
| - Profile* profile, |
| - const GURL& page_url, |
| - int icon_types, |
| - int desired_size_in_dip, |
| + const FaviconForURLParams& params, |
| const std::vector<ui::ScaleFactor>& desired_scale_factors, |
| - CancelableRequestConsumerBase* consumer, |
| const FaviconResultsCallback& callback); |
| // Requests the favicon for |favicon_id| which most closely matches |
| @@ -189,12 +207,8 @@ class FaviconService : public CancelableRequestProvider, |
| // Helper function for GetFaviconImageForURL(), GetRawFaviconForURL() and |
| // GetFaviconForURL(). |
| Handle GetFaviconForURLImpl( |
| - Profile* profile, |
| - const GURL& page_url, |
| - int icon_types, |
| - int desired_size_in_dip, |
| + const FaviconForURLParams& params, |
| const std::vector<ui::ScaleFactor>& desired_scale_factors, |
| - CancelableRequestConsumerBase* consumer, |
| GetFaviconRequest* request); |
| // Intermediate callback for GetFaviconImage() and GetFaviconImageForURL() |