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

Unified Diff: components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h

Issue 2702223004: [Remote suggestions] Move all decisions to fetch to the scheduler (Closed)
Patch Set: Created 3 years, 10 months 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/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 d0639cbdb97fc33a99b1ea3babd86b20dd5102ae..e9b7d00169e7a473d1632dc198c60ade48a282cf 100644
--- a/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
+++ b/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h
@@ -68,6 +68,10 @@ class SchedulingRemoteSuggestionsProvider final
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
// RemoteSuggestionsScheduler implementation.
+ void OnProviderActivated() override;
+ void OnProviderInactivated() override;
+ void OnSuggestionsCleared() override;
+ void OnHistoryCleared() override;
void RescheduleFetching() override;
void OnPersistentSchedulerWakeUp() override;
void OnBrowserForegrounded() override;
@@ -75,8 +79,8 @@ class SchedulingRemoteSuggestionsProvider final
void OnNTPOpened() override;
// RemoteSuggestionsProvider implementation.
- void SetProviderStatusCallback(
- std::unique_ptr<ProviderStatusCallback> callback) override;
+ void SetRemoteSuggestionsScheduler(
+ RemoteSuggestionsScheduler* scheduler) override;
void RefetchInTheBackground(
std::unique_ptr<FetchStatusCallback> callback) override;
const RemoteSuggestionsFetcher* suggestions_fetcher_for_debugging()
@@ -119,10 +123,6 @@ class SchedulingRemoteSuggestionsProvider final
enum class TriggerType;
- // Callback that is notified whenever the status of |provider_| changes.
- void OnProviderStatusChanged(
- RemoteSuggestionsProvider::ProviderStatus status);
-
// After the call, updates will be scheduled in the future. Idempotent, can be
// run any time later without impacting the current schedule.
// If you want to enforce rescheduling, call Unschedule() and then Schedule().
@@ -188,6 +188,8 @@ class SchedulingRemoteSuggestionsProvider final
std::unique_ptr<base::Clock> clock_;
std::set<SchedulingRemoteSuggestionsProvider::TriggerType> enabled_triggers_;
+ base::Time background_fetches_allowed_after_;
+
DISALLOW_COPY_AND_ASSIGN(SchedulingRemoteSuggestionsProvider);
};

Powered by Google App Engine
This is Rietveld 408576698