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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_service.cc

Issue 2378323002: 📰 Show the Sign In promo as a separate card from the section (Closed)
Patch Set: fix compilation 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/remote/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/remote/ntp_snippets_service.cc b/components/ntp_snippets/remote/ntp_snippets_service.cc
index dbf472b85711d75608c76e90a75b0a7723d72373..64eb84f7ad6f0f60080ad4e35302c5c8ae904df7 100644
--- a/components/ntp_snippets/remote/ntp_snippets_service.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_service.cc
@@ -782,21 +782,11 @@ void NTPSnippetsService::NukeAllSnippets() {
ClearCachedSuggestions(category);
ClearDismissedSuggestionsForDebugging(category);
- if (category == articles_category_) {
- // Temporarily enter an "explicitly disabled" state, so that any open UIs
- // will clear the suggestions too.
- CategoryContent& content = categories_[category];
- if (content.status != CategoryStatus::CATEGORY_EXPLICITLY_DISABLED) {
- CategoryStatus old_category_status = content.status;
- UpdateCategoryStatus(category,
- CategoryStatus::CATEGORY_EXPLICITLY_DISABLED);
- UpdateCategoryStatus(category, old_category_status);
- }
- } else {
- // Remove other categories entirely; they may or may not reappear.
- UpdateCategoryStatus(category, CategoryStatus::NOT_PROVIDED);
+ UpdateCategoryStatus(category, CategoryStatus::NOT_PROVIDED);
+
+ // Remove the category entirely; it may or may not reappear.
+ if (category != articles_category_)
categories_to_erase.push_back(category);
- }
}
for (Category category : categories_to_erase) {

Powered by Google App Engine
This is Rietveld 408576698