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

Unified Diff: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm

Issue 2755383002: Add ContentSuggestion for ReadingList (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « no previous file | ios/chrome/browser/ui/content_suggestions/cells/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
index ed03e0942834cd15862878b26d12ddfc38582a5b..d2f6398bc491542467fdaba4b85bcbdd4108c018 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -44,8 +44,12 @@ void BindWrapper(
// Returns the Type for this |category|.
ContentSuggestionType TypeForCategory(ntp_snippets::Category category) {
- // For now, only Article is a relevant type.
- return ContentSuggestionTypeArticle;
+ if (category.IsKnownCategory(ntp_snippets::KnownCategories::ARTICLES))
+ return ContentSuggestionTypeArticle;
+ if (category.IsKnownCategory(ntp_snippets::KnownCategories::READING_LIST))
+ return ContentSuggestionTypeReadingList;
+
+ return ContentSuggestionTypeEmpty;
}
// Returns the section ID for this |category|.
@@ -55,6 +59,8 @@ ContentSuggestionsSectionID SectionIDForCategory(
return ContentSuggestionsSectionBookmarks;
if (category.IsKnownCategory(ntp_snippets::KnownCategories::ARTICLES))
return ContentSuggestionsSectionArticles;
+ if (category.IsKnownCategory(ntp_snippets::KnownCategories::READING_LIST))
+ return ContentSuggestionsSectionReadingList;
return ContentSuggestionsSectionUnknown;
}
« no previous file with comments | « no previous file | ios/chrome/browser/ui/content_suggestions/cells/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698