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

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

Issue 2570673004: Remove host restrictions from snippets (Closed)
Patch Set: Remove host restrictions from snippets 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/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 4ff354f6b697750382057030828db4b3d856afab..ed647a00d97c3c14f9b6240b9b16275925a079de 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_provider.cc
@@ -307,30 +307,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,

Powered by Google App Engine
This is Rietveld 408576698