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

Unified Diff: components/translate/content/browser/content_translate_driver.cc

Issue 2425603004: Remove usage of FOR_EACH_OBSERVER macro in components/translate (Closed)
Patch Set: rebase 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 | « components/bubble/bubble_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/content/browser/content_translate_driver.cc
diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc
index 9860c307388dcf0d6b191cccef217af143e12bed..54a862d50326738eb215d07460a05097fdaf6a0e 100644
--- a/components/translate/content/browser/content_translate_driver.cc
+++ b/components/translate/content/browser/content_translate_driver.cc
@@ -94,14 +94,14 @@ bool ContentTranslateDriver::IsLinkNavigation() {
void ContentTranslateDriver::OnTranslateEnabledChanged() {
content::WebContents* web_contents = navigation_controller_->GetWebContents();
- FOR_EACH_OBSERVER(
- Observer, observer_list_, OnTranslateEnabledChanged(web_contents));
+ for (auto& observer : observer_list_)
+ observer.OnTranslateEnabledChanged(web_contents);
}
void ContentTranslateDriver::OnIsPageTranslatedChanged() {
content::WebContents* web_contents = navigation_controller_->GetWebContents();
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnIsPageTranslatedChanged(web_contents));
+ for (auto& observer : observer_list_)
+ observer.OnIsPageTranslatedChanged(web_contents);
}
void ContentTranslateDriver::TranslatePage(int page_seq_no,
@@ -238,7 +238,8 @@ void ContentTranslateDriver::RegisterPage(
if (web_contents())
translate_manager_->InitiateTranslation(details.adopted_language);
- FOR_EACH_OBSERVER(Observer, observer_list_, OnLanguageDetermined(details));
+ for (auto& observer : observer_list_)
+ observer.OnLanguageDetermined(details);
}
void ContentTranslateDriver::OnPageTranslated(
@@ -251,10 +252,8 @@ void ContentTranslateDriver::OnPageTranslated(
translate_manager_->PageTranslated(
original_lang, translated_lang, error_type);
- FOR_EACH_OBSERVER(
- Observer,
- observer_list_,
- OnPageTranslated(original_lang, translated_lang, error_type));
+ for (auto& observer : observer_list_)
+ observer.OnPageTranslated(original_lang, translated_lang, error_type);
}
} // namespace translate
« no previous file with comments | « components/bubble/bubble_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698