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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2400783003: Ntp: show AllDismissedItem when all sections have been dismissed. (Closed)
Patch Set: Created 4 years, 2 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_service.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index 987a9fb4accd0cf0d623b1b970cb0195a24be638..19e87fa27dd6ff663a87c155e8d2839e2d1d9643 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -125,6 +125,10 @@ class ContentSuggestionsService : public KeyedService,
// This will not trigger an update through the observers.
void DismissCategory(Category category);
+ // Restores all dismissed categories.
+ // This will not trigger an update through the observers.
+ void RestoreDismissedCategories();
+
// Observer accessors.
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -242,6 +246,11 @@ class ContentSuggestionsService : public KeyedService,
// |providers_by_category_|.
std::vector<Category> categories_;
+ // All dismissed categories and their providers. These may be restored by
+ // RestoreDismissedCategories().
+ std::map<Category, ContentSuggestionsProvider*, Category::CompareByID>
+ dismissed_providers_by_category_;
Marc Treib 2016/10/07 11:40:13 What's the status of persisting dismissals? Seems
Michael van Ouwerkerk 2016/10/10 16:19:32 Nicolas is working on persisting section dismissal
+
// All current suggestions grouped by category. This contains an entry for
// every category in |categories_| whose status is an available status. It may
// contain an empty vector if the category is available but empty (or still

Powered by Google App Engine
This is Rietveld 408576698