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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc

Issue 2846503002: [Remote suggestions] Get favicon URLs from archive (Closed)
Patch Set: 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
Index: components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
index 2763aa4762c4d3848eb37f327fb0474fdd7576d5..09cfd14e80973590cfa600747710f01877292479 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
@@ -339,6 +339,20 @@ RemoteSuggestionsProviderImpl::suggestions_fetcher_for_debugging() const {
return suggestions_fetcher_.get();
}
+GURL RemoteSuggestionsProviderImpl::GetUrlWithFavicon(
+ const ContentSuggestion::ID& suggestion_id) const {
+ DCHECK(base::ContainsKey(category_contents_, suggestion_id.category()));
+
+ const CategoryContent& content =
+ category_contents_.at(suggestion_id.category());
+ const RemoteSuggestion* suggestion =
+ content.FindSuggestion(suggestion_id.id_within_category());
+ if (!suggestion) {
+ return GURL();
+ }
+ return ContentSuggestion::GetFaviconDomain(suggestion->url());
+}
+
void RemoteSuggestionsProviderImpl::FetchSuggestions(
bool interactive_request,
const FetchStatusCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698