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

Unified Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2244793002: Remove deleted offline page suggestions from opened NTPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust MockContentSuggestionsProvider 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
« no previous file with comments | « components/ntp_snippets/category_factory.h ('k') | components/ntp_snippets/content_suggestions_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23d403c44dc5012e025e00df10fac45e96e07e5a..836fd41996ddd1d2589959e73426e70f72194709 100644
--- a/components/ntp_snippets/content_suggestions_provider.h
+++ b/components/ntp_snippets/content_suggestions_provider.h
@@ -64,6 +64,19 @@ class ContentSuggestionsProvider {
virtual void OnCategoryStatusChanged(ContentSuggestionsProvider* provider,
Category category,
CategoryStatus new_status) = 0;
+
+ // Called when a suggestion has been invalidated. It will not be provided
+ // through |OnNewSuggestions| anymore, is not supported by
+ // |FetchSuggestionImage| or |DismissSuggestion| anymore, and should
+ // immediately be cleared from the UI and caches. This happens, for example,
+ // when the content that the suggestion refers to is gone.
+ // Note that this event may be fired even if the corresponding |category| is
+ // not currently AVAILABLE, because open UIs may still be showing the
+ // suggestion that is to be removed. This event may also be fired for
+ // |suggestion_id|s that never existed and should be ignored in that case.
+ virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider,
+ Category category,
+ const std::string& suggestion_id) = 0;
};
virtual ~ContentSuggestionsProvider();
« no previous file with comments | « components/ntp_snippets/category_factory.h ('k') | components/ntp_snippets/content_suggestions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698