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

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: Michael's and Marc's comments 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 23d403c44dc5012e025e00df10fac45e96e07e5a..c9ba0bfc5eea3059da174b32ce902cb9a95a86d1 100644
--- a/components/ntp_snippets/content_suggestions_provider.h
+++ b/components/ntp_snippets/content_suggestions_provider.h
@@ -64,6 +64,18 @@ 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.
+ virtual void OnSuggestionInvalidated(ContentSuggestionsProvider* provider,
+ Category category,
+ const std::string& suggestion_id) = 0;
};
virtual ~ContentSuggestionsProvider();

Powered by Google App Engine
This is Rietveld 408576698