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

Unified Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2421463002: FetchMore functionality backend (Closed)
Patch Set: ID set reference, Optional callback, ... (2466863003 comments). 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_provider.h
diff --git a/components/ntp_snippets/content_suggestions_provider.h b/components/ntp_snippets/content_suggestions_provider.h
index f6741356d66e6cfc0a3773c83c8afe25a6d63d83..0dc7634ef077b50b2a7d4cfd6f1b22ad1ed34acd 100644
--- a/components/ntp_snippets/content_suggestions_provider.h
+++ b/components/ntp_snippets/content_suggestions_provider.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
#define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
+#include <set>
#include <string>
#include <vector>
@@ -31,6 +32,8 @@ class ContentSuggestionsProvider {
using ImageFetchedCallback = base::Callback<void(const gfx::Image&)>;
using DismissedSuggestionsCallback = base::Callback<void(
std::vector<ContentSuggestion> dismissed_suggestions)>;
+ using FetchingCallback =
+ base::Callback<void(std::vector<ContentSuggestion> suggestions)>;
// The observer of a provider is notified when new data is available.
class Observer {
@@ -100,6 +103,14 @@ class ContentSuggestionsProvider {
virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
const ImageFetchedCallback& callback) = 0;
+ // Fetches more suggestions for the given category. The new suggestions
+ // will not include any suggestion of the |known_suggestion_ids| sets.
+ // The given |callback| is called with these suggestions, along with all
+ // existing suggestions.
+ virtual void Fetch(const Category& category,
+ const std::set<std::string>& known_suggestion_ids,
+ FetchingCallback callback) = 0;
+
// Removes history from the specified time range where the URL matches the
// |filter|. The data removed depends on the provider. Note that the
// data outside the time range may be deleted, for example suggestions, which

Powered by Google App Engine
This is Rietveld 408576698