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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2421463002: FetchMore functionality backend (Closed)
Patch Set: NTBR. Rebasing a lot. Created 4 years, 1 month 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..3c3e74f3cff025ab64ca44b3c0e479b439213206 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -44,6 +44,8 @@ class ContentSuggestionsService : public KeyedService,
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 +137,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.
vitaliii 2016/11/01 23:29:57 s/completed/successful?
fhorschig 2016/11/02 05:05:27 It's also called if the call was not successful (e
+ // 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