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

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

Issue 2570673004: Remove host restrictions from snippets (Closed)
Patch Set: rebase 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
« 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 a33d4d9a3144c9acbdda695d636799a4b0d8f193..8201c0f97c5b8b6ad6b7698c7176de9a919b3ad9 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider.cc
@@ -308,30 +308,16 @@ void RemoteSuggestionsProvider::FetchSnippetsForAllCategories() {
FetchSnippets(/*interactive_request=*/true);
}
-void RemoteSuggestionsProvider::FetchSnippets(bool interactive_request) {
- // TODO(markusheintz): Merge the FetchSnippets into the
- // FetchSnippetsInTheBackground method.
- if (ready()) {
- FetchSnippetsFromHosts(std::set<std::string>(), interactive_request);
- } else {
- fetch_when_ready_ = true;
- }
-}
-
-void RemoteSuggestionsProvider::FetchSnippetsFromHosts(
- const std::set<std::string>& hosts,
+void RemoteSuggestionsProvider::FetchSnippets(
bool interactive_request) {
- // TODO(tschumann): FetchSnippets() and FetchSnippetsFromHost() implement the
- // fetch logic when called by the background fetcher or interactive "reload"
- // requests. Fetch() is right now only called for the fetch-more use case.
- // The names are confusing and we need to clean them up.
if (!ready()) {
+ fetch_when_ready_ = true;
return;
}
+
MarkEmptyCategoriesAsLoading();
NTPSnippetsFetcher::Params params = BuildFetchParams();
- params.hosts = hosts;
params.interactive_request = interactive_request;
snippets_fetcher_->FetchSnippets(
params, base::BindOnce(&RemoteSuggestionsProvider::OnFetchFinished,
« 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