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

Unified Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2223073002: Add per-section clearing and dismissed suggestions to snippets-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix non-Debug builds Created 4 years, 4 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_provider.h
diff --git a/components/ntp_snippets/content_suggestions_provider.h b/components/ntp_snippets/content_suggestions_provider.h
index 066ea1e1f23d9ae4c9756a598c91f750e38abb49..ed99a396906f1d9a77b59eeaa01db226c8808ced 100644
--- a/components/ntp_snippets/content_suggestions_provider.h
+++ b/components/ntp_snippets/content_suggestions_provider.h
@@ -90,15 +90,23 @@ class ContentSuggestionsProvider {
virtual void FetchSuggestionImage(const std::string& suggestion_id,
const ImageFetchedCallback& callback) = 0;
- // Used only for debugging purposes. Clears all caches so that the next
- // fetch starts from scratch.
- virtual void ClearCachedSuggestionsForDebugging() = 0;
+ // Used only for debugging purposes. Clears all caches for the given category,
+ // so that the next fetch starts from scratch.
+ virtual void ClearCachedSuggestionsForDebugging(Category category) = 0;
+
+ // Used only for debugging purposes. Retrieves suggestions for the given
+ // |category| that have previously been dismissed and are still stored in the
+ // provider. If the provider doesn't store dismissed suggestions for the given
+ // |category|, it always returns an empty vector.
+ virtual std::vector<ContentSuggestion> GetDismissedSuggestionsForDebugging(
+ Category category) = 0;
// Used only for debugging purposes. Clears the cache of dismissed
- // suggestions, if present, so that no suggestions are suppressed. This does
- // not necessarily make previously dismissed suggestions reappear, as they may
- // have been permanently deleted, depending on the provider implementation.
- virtual void ClearDismissedSuggestionsForDebugging() = 0;
+ // suggestions for the given |category|, if present, so that no suggestions
+ // are suppressed. This does not necessarily make previously dismissed
+ // suggestions reappear, as they may have been permanently deleted, depending
+ // on the provider implementation.
+ virtual void ClearDismissedSuggestionsForDebugging(Category category) = 0;
protected:
ContentSuggestionsProvider(Observer* observer,

Powered by Google App Engine
This is Rietveld 408576698