Chromium Code Reviews| Index: components/ntp_snippets/remote/remote_suggestions_provider_impl.h |
| diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl.h b/components/ntp_snippets/remote/remote_suggestions_provider_impl.h |
| index 5fca11d2103be28dcaa92a55e2ba43b01bc7fcbf..710231b132701e0d1821baebc71f900460da011c 100644 |
| --- a/components/ntp_snippets/remote/remote_suggestions_provider_impl.h |
| +++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl.h |
| @@ -117,6 +117,7 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider { |
| PrefService* pref_service, |
| const std::string& application_language_code, |
| CategoryRanker* category_ranker, |
| + RemoteSuggestionsScheduler* scheduler, |
|
Marc Treib
2017/03/27 11:31:00
Can the scheduler be null? If so, please add a com
jkrcal
2017/03/27 14:09:31
It cannot be null. Removed the ifs.
|
| std::unique_ptr<RemoteSuggestionsFetcher> suggestions_fetcher, |
| std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher, |
| std::unique_ptr<RemoteSuggestionsDatabase> database, |
| @@ -135,12 +136,6 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider { |
| // false, some calls may trigger DCHECKs. |
| bool initialized() const { return ready() || state_ == State::DISABLED; } |
| - // Set the scheduler to be notified whenever the provider becomes active / |
| - // in-active and whenever history is deleted. The initial change is also |
| - // notified (switching from an initial undecided status). If the scheduler is |
| - // set after the first change, it is called back immediately. |
| - void SetRemoteSuggestionsScheduler(RemoteSuggestionsScheduler* scheduler); |
| - |
| // RemoteSuggestionsProvider implementation. |
| void RefetchInTheBackground( |
| std::unique_ptr<FetchStatusCallback> callback) override; |
| @@ -430,6 +425,9 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider { |
| // Ranker that orders the categories. Not owned. |
| CategoryRanker* category_ranker_; |
| + // Scheduler to inform about scheduling-related events. Not owned. |
| + RemoteSuggestionsScheduler* remote_suggestions_scheduler_; |
| + |
| // The suggestions fetcher. |
| std::unique_ptr<RemoteSuggestionsFetcher> suggestions_fetcher_; |
| @@ -452,8 +450,6 @@ class RemoteSuggestionsProviderImpl final : public RemoteSuggestionsProvider { |
| bool fetch_when_ready_interactive_; |
| std::unique_ptr<FetchStatusCallback> fetch_when_ready_callback_; |
| - RemoteSuggestionsScheduler* remote_suggestions_scheduler_; |
| - |
| // Set to true if ClearHistoryDependentState is called while the service isn't |
| // ready. The nuke will be executed once the service finishes initialization |
| // or enters the READY state. |