Chromium Code Reviews| Index: components/ntp_snippets/ntp_snippets_service.cc |
| diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc |
| index 736eb4933f9bc285284c17d78067728ba0b39da9..54091d5834f4c9005c963fef12cf6ecc513db970 100644 |
| --- a/components/ntp_snippets/ntp_snippets_service.cc |
| +++ b/components/ntp_snippets/ntp_snippets_service.cc |
| @@ -247,19 +247,20 @@ void NTPSnippetsService::Shutdown() { |
| EnterState(State::SHUT_DOWN, ContentSuggestionsCategoryStatus::NOT_PROVIDED); |
| } |
| -void NTPSnippetsService::FetchSnippets() { |
| +void NTPSnippetsService::FetchSnippets(bool force_request) { |
| if (ready()) |
| - FetchSnippetsFromHosts(GetSuggestionsHosts()); |
| + FetchSnippetsFromHosts(GetSuggestionsHosts(), force_request); |
| else |
| fetch_after_load_ = true; |
| } |
| void NTPSnippetsService::FetchSnippetsFromHosts( |
| - const std::set<std::string>& hosts) { |
| + const std::set<std::string>& hosts, |
| + bool force_request) { |
| if (!ready()) |
| return; |
| snippets_fetcher_->FetchSnippetsFromHosts(hosts, application_language_code_, |
| - kMaxSnippetCount); |
| + kMaxSnippetCount, force_request); |
| } |
| void NTPSnippetsService::RescheduleFetching() { |
| @@ -439,7 +440,7 @@ void NTPSnippetsService::OnSuggestionsChanged( |
| NotifyNewSuggestions(); |
| - FetchSnippetsFromHosts(hosts); |
| + FetchSnippetsFromHosts(hosts, false); |
|
Marc Treib
2016/07/22 13:52:52
/* force_request */ ?
jkrcal
2016/07/25 10:05:38
Done.
|
| } |
| void NTPSnippetsService::OnFetchFinished( |
| @@ -652,7 +653,7 @@ void NTPSnippetsService::FetchSnippetImageFromNetwork( |
| void NTPSnippetsService::EnterStateEnabled(bool fetch_snippets) { |
| if (fetch_snippets) |
| - FetchSnippets(); |
| + FetchSnippets(false); |
|
Marc Treib
2016/07/22 13:52:52
here too
jkrcal
2016/07/25 10:05:38
Done.
|
| // If host restrictions are enabled, register for host list updates. |
| // |suggestions_service_| can be null in tests. |