| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace ntp_snippets { | 10 namespace ntp_snippets { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // startup, or later on). | 22 // startup, or later on). |
| 23 virtual void OnProviderDeactivated() = 0; | 23 virtual void OnProviderDeactivated() = 0; |
| 24 | 24 |
| 25 // Called whenever the remote suggestions provider clears all suggestions. | 25 // Called whenever the remote suggestions provider clears all suggestions. |
| 26 virtual void OnSuggestionsCleared() = 0; | 26 virtual void OnSuggestionsCleared() = 0; |
| 27 | 27 |
| 28 // Called whenever the remote suggestions provider clears all suggestions | 28 // Called whenever the remote suggestions provider clears all suggestions |
| 29 // because history gets cleared (and we must not show them any more). | 29 // because history gets cleared (and we must not show them any more). |
| 30 virtual void OnHistoryCleared() = 0; | 30 virtual void OnHistoryCleared() = 0; |
| 31 | 31 |
| 32 // Returns true if quota is available for another request. |
| 33 virtual bool AcquireQuotaForInteractiveFetch() = 0; |
| 34 |
| 35 // Called whenever the remote suggestions provider finishes an interactive |
| 36 // fetch (with provided |fetch_status|). |
| 37 virtual void OnInteractiveFetchFinished(Status fetch_status) = 0; |
| 38 |
| 32 // External triggers to consider fetching content suggestions. | 39 // External triggers to consider fetching content suggestions. |
| 33 | 40 |
| 34 // Called whenever chrome is started warm or the user switches to Chrome. | 41 // Called whenever chrome is started warm or the user switches to Chrome. |
| 35 virtual void OnBrowserForegrounded() = 0; | 42 virtual void OnBrowserForegrounded() = 0; |
| 36 | 43 |
| 37 // Called whenever chrome is cold started. | 44 // Called whenever chrome is cold started. |
| 38 // To keep start ups fast, defer any work possible. | 45 // To keep start ups fast, defer any work possible. |
| 39 virtual void OnBrowserColdStart() = 0; | 46 virtual void OnBrowserColdStart() = 0; |
| 40 | 47 |
| 41 // Called whenever a new NTP is opened. This may be called on cold starts. | 48 // Called whenever a new NTP is opened. This may be called on cold starts. |
| 42 // So to keep start ups fast, defer heavy work for cold starts. | 49 // So to keep start ups fast, defer heavy work for cold starts. |
| 43 virtual void OnNTPOpened() = 0; | 50 virtual void OnNTPOpened() = 0; |
| 44 | 51 |
| 45 // Fetch content suggestions. | 52 // Fetch content suggestions. |
| 46 virtual void OnPersistentSchedulerWakeUp() = 0; | 53 virtual void OnPersistentSchedulerWakeUp() = 0; |
| 47 | 54 |
| 48 // Force rescheduling of fetching. | 55 // Force rescheduling of fetching. |
| 49 virtual void RescheduleFetching() = 0; | 56 virtual void RescheduleFetching() = 0; |
| 50 }; | 57 }; |
| 51 | 58 |
| 52 } // namespace ntp_snippets | 59 } // namespace ntp_snippets |
| 53 | 60 |
| 54 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ | 61 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ |
| OLD | NEW |