| 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 5d39f48383fccc79f83a78e3147e8094a295a787..43ee91ef2542ea02ef3d1af0723761ffe8b84ee5 100644
|
| --- a/components/ntp_snippets/content_suggestions_service.cc
|
| +++ b/components/ntp_snippets/content_suggestions_service.cc
|
| @@ -79,42 +79,19 @@
|
| callback);
|
| }
|
|
|
| -void ContentSuggestionsService::ClearAllCachedSuggestionsForDebugging() {
|
| +void ContentSuggestionsService::ClearCachedSuggestionsForDebugging() {
|
| suggestions_by_category_.clear();
|
| id_category_map_.clear();
|
| - for (const auto& category_provider_pair : providers_by_category_) {
|
| - category_provider_pair.second->ClearCachedSuggestionsForDebugging(
|
| - category_provider_pair.first);
|
| + for (auto& category_provider_pair : providers_by_category_) {
|
| + category_provider_pair.second->ClearCachedSuggestionsForDebugging();
|
| }
|
| FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions());
|
| }
|
|
|
| -void ContentSuggestionsService::ClearCachedSuggestionsForDebugging(
|
| - Category category) {
|
| - for (const ContentSuggestion& suggestion :
|
| - suggestions_by_category_[category]) {
|
| - id_category_map_.erase(suggestion.id());
|
| - }
|
| - suggestions_by_category_[category].clear();
|
| - auto iterator = providers_by_category_.find(category);
|
| - if (iterator != providers_by_category_.end())
|
| - iterator->second->ClearCachedSuggestionsForDebugging(category);
|
| -}
|
| -
|
| -std::vector<ContentSuggestion>
|
| -ContentSuggestionsService::GetDismissedSuggestionsForDebugging(
|
| - Category category) {
|
| - auto iterator = providers_by_category_.find(category);
|
| - if (iterator == providers_by_category_.end())
|
| - return std::vector<ContentSuggestion>();
|
| - return iterator->second->GetDismissedSuggestionsForDebugging(category);
|
| -}
|
| -
|
| -void ContentSuggestionsService::ClearDismissedSuggestionsForDebugging(
|
| - Category category) {
|
| - auto iterator = providers_by_category_.find(category);
|
| - if (iterator != providers_by_category_.end())
|
| - iterator->second->ClearDismissedSuggestionsForDebugging(category);
|
| +void ContentSuggestionsService::ClearDismissedSuggestionsForDebugging() {
|
| + for (auto& category_provider_pair : providers_by_category_) {
|
| + category_provider_pair.second->ClearDismissedSuggestionsForDebugging();
|
| + }
|
| }
|
|
|
| void ContentSuggestionsService::DismissSuggestion(
|
|
|