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

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

Issue 2811123003: [Content suggestions] Allow to specify URLs for favicons (Closed)
Patch Set: Marc's comment 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_suggestion.cc
diff --git a/components/ntp_snippets/remote/remote_suggestion.cc b/components/ntp_snippets/remote/remote_suggestion.cc
index 988d61a99945dcbdf2d0e273a6908db080d74403..2a478f56f41a161a952f4df2de00cea9ce9e6f46 100644
--- a/components/ntp_snippets/remote/remote_suggestion.cc
+++ b/components/ntp_snippets/remote/remote_suggestion.cc
@@ -394,6 +394,11 @@ ContentSuggestion RemoteSuggestion::ToContentSuggestion(
url = amp_url_;
}
ContentSuggestion suggestion(category, id(), url);
+ // If AMP URL is provided as the main URL, we set the non-AMP URL for favicon.
Marc Treib 2017/04/12 11:48:00 Please describe the "why" rather than the "what".
jkrcal 2017/04/12 12:44:19 Done.
+ if (base::FeatureList::IsEnabled(kPreferAmpUrlsFeature) &&
+ !amp_url_.is_empty()) {
+ 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_);

Powered by Google App Engine
This is Rietveld 408576698