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 we open or return to an Activity. |
tschumann
2017/01/03 15:24:00
can we be more specific? e.g.
// Called whenever
Michael van Ouwerkerk
2017/01/03 16:51:08
You can ask the activity whether it had a warm sta
fhorschig
2017/01/04 10:17:04
Only a little more specific. This comment has to a
tschumann
2017/01/04 10:51:53
I'm leaning towards not doing anything on cold sta
jkrcal
2017/01/04 12:21:12
Tim, do you mean
- having just the warm-start si
tschumann
2017/01/04 12:26:30
i'm leaning towards just the warm-start as I can't
fhorschig
2017/01/04 12:56:10
I added both signals as this makes it easier to dr
| |
17 // To keep start ups fast, defer heavy work. | |
18 virtual void OnBrowserResumed() = 0; | |
19 // Called whenever a new NTP is opened. This may be called on cold starts. | |
20 // So to keep start ups fast, defer heavy work for cold starts. | |
17 virtual void OnNTPOpened() = 0; | 21 virtual void OnNTPOpened() = 0; |
18 | 22 |
19 // Fetch content suggestions. | 23 // Fetch content suggestions. |
20 virtual void OnPersistentSchedulerWakeUp() = 0; | 24 virtual void OnPersistentSchedulerWakeUp() = 0; |
21 | 25 |
22 // Force rescheduling of fetching. | 26 // Force rescheduling of fetching. |
23 virtual void RescheduleFetching() = 0; | 27 virtual void RescheduleFetching() = 0; |
24 }; | 28 }; |
25 | 29 |
26 } // namespace ntp_snippets | 30 } // namespace ntp_snippets |
27 | 31 |
28 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ | 32 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_SCHEDULER_H_ |
OLD | NEW |