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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2446163005: [NTP Snippets] FetchMore backend (Closed)
Patch Set: Address comments from https://codereview.chromium.org/2421463002/ Created 4 years, 2 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/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);

Powered by Google App Engine
This is Rietveld 408576698