Rename discard to dismiss for NTP snippets and content suggestions

We agreed to use the term 'dismiss' instead of 'discard' for the action
performed by the user to remove content suggestions from the NTP.
These changes are only for the non-Android part. The renaming for the
Android part will follow after or during the ongoing refactoring there.

BUG=None
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2167063003
Cr-Commit-Position: refs/heads/master@{#407456}
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index aaf2e80..778bb9e 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -77,25 +77,25 @@
   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 @@
                      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);
 }