Index: components/ntp_snippets/content_suggestions_service.cc |
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc |
index 3311d45624a4372568a304e857f205ae9f105b79..7b23609c6a01f0babb79428bd55cb676c26393ac 100644 |
--- a/components/ntp_snippets/content_suggestions_service.cc |
+++ b/components/ntp_snippets/content_suggestions_service.cc |
@@ -183,18 +183,19 @@ void ContentSuggestionsService::OnNewSuggestions( |
ContentSuggestionsProvider* provider, |
Category category, |
std::vector<ContentSuggestion> new_suggestions) { |
- if (RegisterCategoryIfRequired(provider, category)) { |
+ if (RegisterCategoryIfRequired(provider, category)) |
NotifyCategoryStatusChanged(category); |
- } |
+ |
+ if (!IsCategoryStatusAvailable(provider->GetCategoryStatus(category))) |
+ return; |
for (const ContentSuggestion& suggestion : |
suggestions_by_category_[category]) { |
id_category_map_.erase(suggestion.id()); |
} |
- for (const ContentSuggestion& suggestion : new_suggestions) { |
+ for (const ContentSuggestion& suggestion : new_suggestions) |
id_category_map_.insert(std::make_pair(suggestion.id(), category)); |
- } |
suggestions_by_category_[category] = std::move(new_suggestions); |