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

Unified Diff: ui/base/ime/mock_input_method.cc

Issue 2422073002: Reduce FOR_EACH_OBSERVER usage in ui/ (Closed)
Patch Set: remove space 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 | « ui/base/ime/input_method_base.cc ('k') | ui/base/user_activity/user_activity_detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/mock_input_method.cc
diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc
index fbd8bcf8b3fafbe2cead5c132740f3ab4ddad0a3..d097005b5f93aec3211d35cf2dfad55995f13555 100644
--- a/ui/base/ime/mock_input_method.cc
+++ b/ui/base/ime/mock_input_method.cc
@@ -14,8 +14,8 @@ MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate)
}
MockInputMethod::~MockInputMethod() {
- FOR_EACH_OBSERVER(InputMethodObserver, observer_list_,
- OnInputMethodDestroyed(this));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnInputMethodDestroyed(this);
}
void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) {
@@ -45,11 +45,13 @@ void MockInputMethod::DispatchKeyEvent(ui::KeyEvent* event) {
}
void MockInputMethod::OnFocus() {
- FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnFocus());
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnFocus();
}
void MockInputMethod::OnBlur() {
- FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnBlur());
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnBlur();
}
bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event,
@@ -60,18 +62,15 @@ bool MockInputMethod::OnUntranslatedIMEMessage(const base::NativeEvent& event,
}
void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {
- FOR_EACH_OBSERVER(InputMethodObserver,
- observer_list_,
- OnTextInputTypeChanged(client));
- FOR_EACH_OBSERVER(InputMethodObserver,
- observer_list_,
- OnTextInputStateChanged(client));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnTextInputTypeChanged(client);
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnTextInputStateChanged(client);
}
void MockInputMethod::OnCaretBoundsChanged(const TextInputClient* client) {
- FOR_EACH_OBSERVER(InputMethodObserver,
- observer_list_,
- OnCaretBoundsChanged(client));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnCaretBoundsChanged(client);
}
void MockInputMethod::CancelComposition(const TextInputClient* client) {
@@ -105,7 +104,8 @@ bool MockInputMethod::IsCandidatePopupOpen() const {
}
void MockInputMethod::ShowImeIfNeeded() {
- FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnShowImeIfNeeded());
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnShowImeIfNeeded();
}
void MockInputMethod::AddObserver(InputMethodObserver* observer) {
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/user_activity/user_activity_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698