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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2167063003: Rename discard to dismiss for NTP snippets and content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bridgeumbiegen
Patch Set: Fix unit test Created 4 years, 5 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/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index aaf2e80b5cf8cdc5a535313d2636003cfc5e0ff1..778bb9eed2e5164cb34abb3885edb37186865443 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -77,25 +77,25 @@ void ContentSuggestionsService::ClearCachedSuggestionsForDebugging() {
FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions());
}
-void ContentSuggestionsService::ClearDiscardedSuggestionsForDebugging() {
+void ContentSuggestionsService::ClearDismissedSuggestionsForDebugging() {
for (auto& category_provider_pair : providers_) {
- category_provider_pair.second->ClearDiscardedSuggestionsForDebugging();
+ category_provider_pair.second->ClearDismissedSuggestionsForDebugging();
}
}
-void ContentSuggestionsService::DiscardSuggestion(
+void ContentSuggestionsService::DismissSuggestion(
const std::string& suggestion_id) {
if (!id_category_map_.count(suggestion_id)) {
- LOG(WARNING) << "Discarded unknown suggestion " << suggestion_id;
+ LOG(WARNING) << "Dismissed unknown suggestion " << suggestion_id;
return;
}
ContentSuggestionsCategory category = id_category_map_[suggestion_id];
if (!providers_.count(category)) {
- LOG(WARNING) << "Discarded suggestion " << suggestion_id
+ LOG(WARNING) << "Dismissed suggestion " << suggestion_id
<< " for unavailable category " << static_cast<int>(category);
return;
}
- providers_[category]->DiscardSuggestion(suggestion_id);
+ providers_[category]->DismissSuggestion(suggestion_id);
// Remove the suggestion locally.
id_category_map_.erase(suggestion_id);
@@ -107,9 +107,9 @@ void ContentSuggestionsService::DiscardSuggestion(
return suggestion_id == suggestion.id();
});
DCHECK(position != suggestions->end())
- << "The discarded suggestion " << suggestion_id
+ << "The dismissed suggestion " << suggestion_id
<< " has already been removed. Providers must not call OnNewSuggestions"
- " in response to DiscardSuggestion.";
+ " in response to DismissSuggestion.";
suggestions->erase(position);
}
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.h ('k') | components/ntp_snippets/content_suggestions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698