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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2811123003: [Content suggestions] Allow to specify URLs for favicons (Closed)
Patch Set: Marc's comments #3 Created 3 years, 8 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
« no previous file with comments | « components/ntp_snippets/content_suggestion.h ('k') | components/ntp_snippets/remote/remote_suggestion.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 9d4955e1e2872eda23d76479904ebb3e65b90805..177e52e038d6cc64fd65aba470e9b80e64536c39 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -134,13 +134,12 @@ void ContentSuggestionsService::FetchSuggestionImage(
suggestion_id, callback);
}
+// TODO(jkrcal): Split the favicon fetching into a separate class.
void ContentSuggestionsService::FetchSuggestionFavicon(
const ContentSuggestion::ID& suggestion_id,
int minimum_size_in_pixel,
int desired_size_in_pixel,
const ImageFetchedCallback& callback) {
- // TODO(jkrcal): Allow the provider to provide (or possibly override) the URL
- // for looking up the favicon.
std::vector<ContentSuggestion>* suggestions =
&suggestions_by_category_[suggestion_id.category()];
auto position =
@@ -154,16 +153,17 @@ void ContentSuggestionsService::FetchSuggestionFavicon(
return;
}
- const GURL& publisher_url = position->url().GetWithEmptyPath();
+ const GURL& domain_with_favicon =
+ position->url_with_favicon().GetWithEmptyPath();
// TODO(jkrcal): Create a general wrapper function in LargeIconService that
// does handle the get-from-cache-and-fallback-to-google-server functionality
// in one shot (for all clients that do not need to react in between).
large_icon_service_->GetLargeIconImageOrFallbackStyle(
- publisher_url, minimum_size_in_pixel, desired_size_in_pixel,
+ domain_with_favicon, minimum_size_in_pixel, desired_size_in_pixel,
base::Bind(&ContentSuggestionsService::OnGetFaviconFromCacheFinished,
- base::Unretained(this), publisher_url, minimum_size_in_pixel,
- desired_size_in_pixel, callback,
+ base::Unretained(this), domain_with_favicon,
+ minimum_size_in_pixel, desired_size_in_pixel, callback,
/*continue_to_google_server=*/true),
&favicons_task_tracker_);
}
« no previous file with comments | « components/ntp_snippets/content_suggestion.h ('k') | components/ntp_snippets/remote/remote_suggestion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698