| Index: components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
|
| diff --git a/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h b/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
|
| index 71dd4f8c487c1db86a7047cb25e4d82576a603d7..2667e2cf2da83c1270381b69029f3d57a49fb75b 100644
|
| --- a/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
|
| +++ b/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
|
| @@ -114,20 +114,27 @@ class SchedulingRemoteSuggestionsProvider final
|
| // schedule.
|
| void StopScheduling();
|
|
|
| + // Checks whether it is time to perform a soft background fetch, according to
|
| + // |schedule|.
|
| + bool ShouldRefetchInTheBackgroundNow();
|
| +
|
| // Callback after Fetch is completed.
|
| void FetchFinished(const FetchDoneCallback& callback,
|
| - Status status_code,
|
| + Status fetch_status,
|
| std::vector<ContentSuggestion> suggestions);
|
|
|
| + // Callback after RefetchInTheBackground is completed.
|
| + void RefetchInTheBackgroundFinished(
|
| + std::unique_ptr<FetchStatusCallback> callback,
|
| + Status fetch_status);
|
| +
|
| FetchingSchedule GetDesiredFetchingSchedule() const;
|
| FetchingSchedule GetLastFetchingSchedule() const;
|
| void StoreLastFetchingSchedule(const FetchingSchedule& schedule);
|
|
|
| - // Common function to call after each fetch.
|
| - void OnFetchCompleted(Status status);
|
| -
|
| // Applies the provided |schedule|.
|
| - void ApplyFetchingSchedule(const FetchingSchedule& schedule);
|
| + void ApplyFetchingSchedule(const FetchingSchedule& schedule,
|
| + bool also_apply_persistent_schedule);
|
|
|
| // Interface for doing all the actual work (apart from scheduling).
|
| std::unique_ptr<RemoteSuggestionsProvider> provider_;
|
| @@ -136,6 +143,8 @@ class SchedulingRemoteSuggestionsProvider final
|
| // null.
|
| PersistentScheduler* persistent_scheduler_;
|
|
|
| + bool background_fetch_in_progress_;
|
| +
|
| // Used to adapt the schedule based on usage activity of the user. Not owned.
|
| const UserClassifier* user_classifier_;
|
|
|
|
|