Chromium Code Reviews| 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 { |
| 11 | 11 |
| 12 // Interface for informing the scheduler. | 12 // Interface for informing the scheduler. |
| 13 class RemoteSuggestionsScheduler { | 13 class RemoteSuggestionsScheduler { |
| 14 public: | 14 public: |
| 15 // External triggers to consider fetching content suggestions. | 15 // External triggers to consider fetching content suggestions. |
| 16 virtual void OnBrowserStartup() = 0; | 16 // Called whenever chrome is started warm or the user switches to Chrome. |
| 17 virtual void OnBrowserForegrounded() = 0; | |
| 18 // Called whenever chrome is cold started. | |
|
Bernhard Bauer
2017/01/05 16:32:54
Could you add empty lines before comments please?
fhorschig
2017/01/05 17:11:13
Done.
| |
| 19 // To keep start ups fast, defer any work possible. | |
| 20 virtual void OnBrowserColdStart() = 0; | |
| 21 // Called whenever a new NTP is opened. This may be called on cold starts. | |
| 22 // So to keep start ups fast, defer heavy work for cold starts. | |
| 17 virtual void OnNTPOpened() = 0; | 23 virtual void OnNTPOpened() = 0; |
| 18 | 24 |
| 19 // Fetch content suggestions. | 25 // Fetch content suggestions. |
| 20 virtual void OnPersistentSchedulerWakeUp() = 0; | 26 virtual void OnPersistentSchedulerWakeUp() = 0; |
| 21 | 27 |
| 22 // Force rescheduling of fetching. | 28 // Force rescheduling of fetching. |
| 23 virtual void RescheduleFetching() = 0; | 29 virtual void RescheduleFetching() = 0; |
| 24 }; | 30 }; |
| 25 | 31 |
| 26 } // namespace ntp_snippets | 32 } // namespace ntp_snippets |
| 27 | 33 |
| 28 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ | 34 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ |
| OLD | NEW |