| Index: components/ntp_snippets/remote/remote_suggestions_provider.h
|
| diff --git a/components/ntp_snippets/remote/remote_suggestions_provider.h b/components/ntp_snippets/remote/remote_suggestions_provider.h
|
| index a8081b7ee9ffdadb3b853164edd1d175b786d2c6..ca68856cfde2bf77d9f30e8cc6aa4367dab730fe 100644
|
| --- a/components/ntp_snippets/remote/remote_suggestions_provider.h
|
| +++ b/components/ntp_snippets/remote/remote_suggestions_provider.h
|
| @@ -151,6 +151,11 @@ class RemoteSuggestionsProvider final
|
| return category_contents_.find(category)->second.dismissed;
|
| }
|
|
|
| + // Overrides internal clock for testing purposes.
|
| + void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
|
| + tick_clock_ = std::move(tick_clock);
|
| + }
|
| +
|
| private:
|
| friend class RemoteSuggestionsProviderTest;
|
|
|
| @@ -261,11 +266,14 @@ class RemoteSuggestionsProvider final
|
| // Callback for fetch-more requests with the NTPSnippetsFetcher.
|
| void OnFetchMoreFinished(
|
| const FetchDoneCallback& fetching_callback,
|
| - NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories);
|
| + NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories,
|
| + NTPSnippetsFetcher::FetchResult fetch_result);
|
|
|
| // Callback for regular fetch requests with the NTPSnippetsFetcher.
|
| void OnFetchFinished(
|
| - NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories);
|
| + bool interactive_request,
|
| + NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories,
|
| + NTPSnippetsFetcher::FetchResult fetch_status);
|
|
|
| // Moves all snippets from |to_archive| into the archive of the |content|.
|
| // Clears |to_archive|. As the archive is a FIFO buffer of limited size, this
|
| @@ -407,6 +415,9 @@ class RemoteSuggestionsProvider final
|
| // Request throttler for limiting requests to thumbnail images.
|
| RequestThrottler thumbnail_requests_throttler_;
|
|
|
| + // A clock for getting the time. This allows to inject a tick clock in tests.
|
| + std::unique_ptr<base::TickClock> tick_clock_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProvider);
|
| };
|
|
|
|
|