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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider.cc

Issue 2520993002: Remove the "exclude archived snippets" from the snippets fetching code. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « components/ntp_snippets/remote/remote_suggestions_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/remote/remote_suggestions_provider.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider.cc b/components/ntp_snippets/remote/remote_suggestions_provider.cc
index fe0c01a8cea1c56a265ba5ea6c79d5e33e90eee3..d779b419f691551799078e57ce84c3432842dbd7 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider.cc
@@ -330,8 +330,7 @@ void RemoteSuggestionsProvider::FetchSnippetsFromHosts(
}
MarkEmptyCategoriesAsLoading();
- NTPSnippetsFetcher::Params params =
- BuildFetchParams(/*exclude_archived_suggestions=*/true);
+ NTPSnippetsFetcher::Params params = BuildFetchParams();
params.hosts = hosts;
params.interactive_request = interactive_request;
snippets_fetcher_->FetchSnippets(
@@ -349,8 +348,7 @@ void RemoteSuggestionsProvider::Fetch(
"RemoteSuggestionsProvider is not ready!"));
return;
}
- NTPSnippetsFetcher::Params params =
- BuildFetchParams(/*exclude_archived_suggestions=*/false);
+ NTPSnippetsFetcher::Params params = BuildFetchParams();
params.excluded_ids.insert(known_suggestion_ids.begin(),
known_suggestion_ids.end());
params.interactive_request = true;
@@ -365,8 +363,7 @@ void RemoteSuggestionsProvider::Fetch(
}
// Builds default fetcher params.
-NTPSnippetsFetcher::Params RemoteSuggestionsProvider::BuildFetchParams(
- bool exclude_archived_suggestions) const {
+NTPSnippetsFetcher::Params RemoteSuggestionsProvider::BuildFetchParams() const {
NTPSnippetsFetcher::Params result;
result.language_code = application_language_code_;
result.count_to_fetch = kMaxSnippetCount;
@@ -375,11 +372,6 @@ NTPSnippetsFetcher::Params RemoteSuggestionsProvider::BuildFetchParams(
for (const auto& dismissed_snippet : content.dismissed) {
result.excluded_ids.insert(dismissed_snippet->id());
}
- if (exclude_archived_suggestions) {
- for (const auto& archived_snippet : content.archived) {
- result.excluded_ids.insert(archived_snippet->id());
- }
- }
}
return result;
}
« no previous file with comments | « components/ntp_snippets/remote/remote_suggestions_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698