summaryrefslogtreecommitdiff
path: root/chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc')
-rw-r--r--chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc b/chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc
index 0e42aa0b048..4985c3d23b2 100644
--- a/chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc
+++ b/chromium/components/ntp_snippets/contextual/contextual_suggestions_fetch.cc
@@ -47,12 +47,19 @@ std::string Unescape(const std::string& encoded_text) {
ContextualSuggestion ItemToSuggestion(const PivotItem& item) {
PivotDocument document = item.document();
+ std::string favicon_url;
+ if (document.favicon_image().source_data().has_raster()) {
+ favicon_url =
+ document.favicon_image().source_data().raster().url().raw_url();
+ }
+
return SuggestionBuilder(GURL(document.url().raw_url()))
.Title(Unescape(document.title()))
.Snippet(Unescape(document.summary()))
.PublisherName(Unescape(document.site_name()))
.ImageId(document.image().id().encrypted_docid())
.FaviconImageId(document.favicon_image().id().encrypted_docid())
+ .FaviconImageUrl(favicon_url)
.Build();
}
@@ -279,4 +286,4 @@ void ContextualSuggestionsFetch::ReportFetchMetrics(
std::move(metrics_callback).Run(event);
}
-} // namespace contextual_suggestions \ No newline at end of file
+} // namespace contextual_suggestions