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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 1980033002: [NTP Snippets] Clear the snippets when the user signs out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 02524508ceca77bf9620436e54bc6604c47ab25e..555e101213efd53b78add33ac071a137b1e92755 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -331,6 +331,11 @@ void NTPSnippetsService::OnSuggestionsChanged(
StoreSnippetsToPrefs();
StoreSnippetHostsToPrefs(hosts);
+ if (hosts.empty()) {
+ FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_,
+ NTPSnippetsServiceCleared());
+ }
+
FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_,
NTPSnippetsServiceLoaded());

Powered by Google App Engine
This is Rietveld 408576698