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

Unified Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc

Issue 2323343002: Update bookmark suggestions in open NTPs when removing their visit dates (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
diff --git a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
index eaea934043a9fc0f63e7163abc1a6f33587c7d2f..7e43abd335f02d5e5bbf5d688fa5b23443eb671c 100644
--- a/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
+++ b/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
@@ -193,6 +193,13 @@ void BookmarkSuggestionsProvider::ClearHistory(
RemoveAllLastVisitDates(bookmark_model_);
ClearDismissedSuggestionsForDebugging(provided_category_);
FetchBookmarks();
+ // Temporarily enter an "explicitly disabled" state, so that any open UIs
+ // will clear the suggestions too.
+ if (category_status_ != CategoryStatus::CATEGORY_EXPLICITLY_DISABLED) {
+ CategoryStatus old_category_status = category_status_;
+ NotifyStatusChanged(CategoryStatus::CATEGORY_EXPLICITLY_DISABLED);
+ NotifyStatusChanged(old_category_status);
+ }
}
void BookmarkSuggestionsProvider::ClearCachedSuggestions(Category category) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698