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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2560783002: [NTP::PhysicalWeb] Implement suggestion dismissal. (Closed)
Patch Set: bauerb@ comment. Created 4 years 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 92ef4b46aea07264201b3124a229e25d8fc8cab1..5cd19fd2c70fd03eee9b33759ee80ec3a1c7c29f 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -167,11 +167,10 @@ void ContentSuggestionsService::DismissSuggestion(
providers_by_category_[suggestion_id.category()]->DismissSuggestion(
suggestion_id);
- // Remove the suggestion locally.
- bool removed = RemoveSuggestionByID(suggestion_id);
- DCHECK(removed) << "The dismissed suggestion " << suggestion_id
- << " has already been removed. Providers must not call"
- << " OnNewSuggestions in response to DismissSuggestion.";
+ // Remove the suggestion locally if it is present. A suggestion may be missing
+ // localy e.g. if it was sent to UI through |Fetch| or it has been dismissed
+ // from a different NTP.
+ RemoveSuggestionByID(suggestion_id);
}
void ContentSuggestionsService::DismissCategory(Category category) {

Powered by Google App Engine
This is Rietveld 408576698