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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 2416763002: Replace FOR_EACH_OBSERVER in c/b/chromeos with range-based for (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
Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index bd20ea8eb219a4f87d052aad36b07ae6d3343dd1..fb5e5f45dcfbb284a597162f5e6d29b29086ce9a 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -1043,8 +1043,8 @@ void InputMethodManagerImpl::ChangeInputMethodInternal(
}
// Update input method indicators (e.g. "US", "DV") in Chrome windows.
- FOR_EACH_OBSERVER(InputMethodManager::Observer, observers_,
- InputMethodChanged(this, profile, show_message));
+ for (auto& observer : observers_)
+ observer.InputMethodChanged(this, profile, show_message);
// Update the current input method in IME menu.
NotifyImeMenuListChanged();
}
@@ -1166,15 +1166,13 @@ void InputMethodManagerImpl::CandidateClicked(int index) {
}
void InputMethodManagerImpl::CandidateWindowOpened() {
- FOR_EACH_OBSERVER(InputMethodManager::CandidateWindowObserver,
- candidate_window_observers_,
- CandidateWindowOpened(this));
+ for (auto& observer : candidate_window_observers_)
+ observer.CandidateWindowOpened(this);
}
void InputMethodManagerImpl::CandidateWindowClosed() {
- FOR_EACH_OBSERVER(InputMethodManager::CandidateWindowObserver,
- candidate_window_observers_,
- CandidateWindowClosed(this));
+ for (auto& observer : candidate_window_observers_)
+ observer.CandidateWindowClosed(this);
}
void InputMethodManagerImpl::ImeMenuActivationChanged(bool is_active) {
@@ -1185,8 +1183,8 @@ void InputMethodManagerImpl::ImeMenuActivationChanged(bool is_active) {
}
void InputMethodManagerImpl::NotifyImeMenuListChanged() {
- FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_,
- ImeMenuListChanged());
+ for (auto& observer : ime_menu_observers_)
+ observer.ImeMenuListChanged();
}
void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() {
@@ -1201,8 +1199,8 @@ void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() {
void InputMethodManagerImpl::NotifyImeMenuItemsChanged(
const std::string& engine_id,
const std::vector<InputMethodManager::MenuItem>& items) {
- FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_,
- ImeMenuItemsChanged(engine_id, items));
+ for (auto& observer : ime_menu_observers_)
+ observer.ImeMenuItemsChanged(engine_id, items);
}
void InputMethodManagerImpl::MaybeNotifyImeMenuActivationChanged() {
@@ -1210,8 +1208,8 @@ void InputMethodManagerImpl::MaybeNotifyImeMenuActivationChanged() {
return;
is_ime_menu_activated_ = state_->menu_activated;
- FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_,
- ImeMenuActivationChanged(is_ime_menu_activated_));
+ for (auto& observer : ime_menu_observers_)
+ observer.ImeMenuActivationChanged(is_ime_menu_activated_);
UMA_HISTOGRAM_BOOLEAN("InputMethod.ImeMenu.ActivationChanged",
is_ime_menu_activated_);
}

Powered by Google App Engine
This is Rietveld 408576698