Chromium Code Reviews| Index: components/ntp_snippets/content_suggestions_service.h |
| diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h |
| index be34e7290c43a0f9f3db422e13111c16b0fee6c6..9b1b6664d6da5bd907a6ca7e6a037e8d47bc3dde 100644 |
| --- a/components/ntp_snippets/content_suggestions_service.h |
| +++ b/components/ntp_snippets/content_suggestions_service.h |
| @@ -41,9 +41,12 @@ class ContentSuggestionsService : public KeyedService, |
| public ContentSuggestionsProvider::Observer, |
| public history::HistoryServiceObserver { |
| public: |
| + // TODO(treib): All these should probably be OnceCallback. |
|
Bernhard Bauer
2016/10/28 16:26:00
I didn't know about that. Neat! :)
fhorschig
2016/11/02 05:06:12
Yeah, the logic was that these callbacks are respo
|
| using ImageFetchedCallback = base::Callback<void(const gfx::Image&)>; |
| using DismissedSuggestionsCallback = base::Callback<void( |
| std::vector<ContentSuggestion> dismissed_suggestions)>; |
| + using FetchedMoreCallback = |
| + base::Callback<void(std::vector<ContentSuggestion> suggestions)>; |
| class Observer { |
| public: |
| @@ -135,6 +138,11 @@ class ContentSuggestionsService : public KeyedService, |
| // Returns whether |category| is dismissed. |
| bool IsCategoryDismissed(Category category) const; |
| + // Fetches additional contents for the given |category|. If the fetch was |
| + // completed, the given |callback| is called with the updated content. |
| + // This includes new and old data. |
| + void FetchMore(const Category& category, const FetchedMoreCallback& callback); |
| + |
| // Observer accessors. |
| void AddObserver(Observer* observer); |
| void RemoveObserver(Observer* observer); |