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

Unified Diff: components/ntp_snippets/remote/remote_suggestion.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_suggestions_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/remote_suggestion.cc
diff --git a/components/ntp_snippets/remote/remote_suggestion.cc b/components/ntp_snippets/remote/remote_suggestion.cc
index 988d61a99945dcbdf2d0e273a6908db080d74403..d11594337400067ba808afa4eb50f5b6ec146cea 100644
--- a/components/ntp_snippets/remote/remote_suggestion.cc
+++ b/components/ntp_snippets/remote/remote_suggestion.cc
@@ -389,11 +389,17 @@ SnippetProto RemoteSuggestion::ToProto() const {
ContentSuggestion RemoteSuggestion::ToContentSuggestion(
Category category) const {
GURL url = url_;
- if (base::FeatureList::IsEnabled(kPreferAmpUrlsFeature) &&
- !amp_url_.is_empty()) {
+ bool use_amp = base::FeatureList::IsEnabled(kPreferAmpUrlsFeature) &&
+ !amp_url_.is_empty();
+ if (use_amp) {
url = amp_url_;
}
ContentSuggestion suggestion(category, id(), url);
+ // Set url for fetching favicons if it differs from the main url (domains of
+ // AMP URLs sometimes failed to provide favicons).
+ if (use_amp) {
+ suggestion.set_url_with_favicon(url_);
+ }
suggestion.set_title(base::UTF8ToUTF16(title_));
suggestion.set_snippet_text(base::UTF8ToUTF16(snippet_));
suggestion.set_publish_date(publish_date_);
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698