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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2444753002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (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
« no previous file with comments | « no previous file | components/ntp_snippets/offline_pages/offline_page_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index eabac44ac042988c458d991c782a934f512a00c3..9d037fa862f137b09324f4c42ed50214a959ea87 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -46,7 +46,8 @@ void ContentSuggestionsService::Shutdown() {
categories_.clear();
providers_.clear();
state_ = State::DISABLED;
- FOR_EACH_OBSERVER(Observer, observers_, ContentSuggestionsServiceShutdown());
+ for (Observer& observer : observers_)
+ observer.ContentSuggestionsServiceShutdown();
}
// static
@@ -112,8 +113,8 @@ void ContentSuggestionsService::ClearAllCachedSuggestions() {
for (const auto& category_provider_pair : providers_by_category_) {
category_provider_pair.second->ClearCachedSuggestions(
category_provider_pair.first);
- FOR_EACH_OBSERVER(Observer, observers_,
- OnNewSuggestions(category_provider_pair.first));
+ for (Observer& observer : observers_)
+ observer.OnNewSuggestions(category_provider_pair.first);
}
}
@@ -228,7 +229,8 @@ void ContentSuggestionsService::OnNewSuggestions(
suggestions_by_category_[category] = std::move(suggestions);
- FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions(category));
+ for (Observer& observer : observers_)
+ observer.OnNewSuggestions(category);
}
void ContentSuggestionsService::OnCategoryStatusChanged(
@@ -252,8 +254,8 @@ void ContentSuggestionsService::OnSuggestionInvalidated(
ContentSuggestionsProvider* provider,
const ContentSuggestion::ID& suggestion_id) {
RemoveSuggestionByID(suggestion_id);
- FOR_EACH_OBSERVER(Observer, observers_,
- OnSuggestionInvalidated(suggestion_id));
+ for (Observer& observer : observers_)
+ observer.OnSuggestionInvalidated(suggestion_id);
}
// history::HistoryServiceObserver implementation.
@@ -376,9 +378,8 @@ bool ContentSuggestionsService::RemoveSuggestionByID(
}
void ContentSuggestionsService::NotifyCategoryStatusChanged(Category category) {
- FOR_EACH_OBSERVER(
- Observer, observers_,
- OnCategoryStatusChanged(category, GetCategoryStatus(category)));
+ for (Observer& observer : observers_)
+ observer.OnCategoryStatusChanged(category, GetCategoryStatus(category));
}
void ContentSuggestionsService::SortCategories() {
« no previous file with comments | « no previous file | components/ntp_snippets/offline_pages/offline_page_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698