Chromium Code Reviews| Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| index f6a6b5aad01e071a646229d1779f31953cc7388a..7ccdc8c228bdd6e1685873baf61ddfde768809ec 100644 |
| --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| @@ -147,6 +147,34 @@ void NTPSnippetsBridge::OnNewSuggestions() { |
| std::vector<int64_t> timestamps; |
| std::vector<std::string> publishers; |
| std::vector<float> scores; |
| + |
| + // Show all other sections before ARTICLES, at most 5 suggestions per section. |
|
Marc Treib
2016/07/26 14:00:00
The "at most 5" part isn't applicable anymore.
Philipp Keck
2016/07/26 15:47:20
Done.
|
| + // TODO(pke): This is only for debugging new sections and will be replaced |
| + // with proper multi-section UI support. |
| + for (ContentSuggestionsCategory category : |
| + content_suggestions_service_->GetCategories()) { |
| + if (category == ContentSuggestionsCategory::ARTICLES) { |
| + continue; |
| + } |
| + if (content_suggestions_service_->GetCategoryStatus(category) != |
| + ContentSuggestionsCategoryStatus::AVAILABLE) { |
| + continue; |
| + } |
| + |
| + for (const ntp_snippets::ContentSuggestion& suggestion : |
| + content_suggestions_service_->GetSuggestionsForCategory(category)) { |
| + ids.push_back(suggestion.id()); |
| + titles.push_back(suggestion.title()); |
| + urls.push_back(suggestion.url().spec()); |
| + amp_urls.push_back(suggestion.amp_url().spec()); |
| + snippets.push_back(suggestion.snippet_text()); |
| + timestamps.push_back(suggestion.publish_date().ToJavaTime()); |
| + publishers.push_back(suggestion.publisher_name()); |
| + scores.push_back(suggestion.score()); |
| + } |
| + } |
| + |
| + // All article suggestions. |
| for (const ntp_snippets::ContentSuggestion& suggestion : |
| content_suggestions_service_->GetSuggestionsForCategory( |
| ContentSuggestionsCategory::ARTICLES)) { |