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

Unified Diff: ui/base/ime/input_method_base.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/chromeos/ime_keyboard.cc ('k') | ui/base/ime/mock_input_method.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_base.cc
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc
index 37c4d90a1ba5ea34189453db6b58fe611254b5f0..9d43d8523a85811d2a7569d0a9463abc95c59f48 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -22,9 +22,8 @@ InputMethodBase::InputMethodBase()
text_input_client_(nullptr) {}
InputMethodBase::~InputMethodBase() {
- FOR_EACH_OBSERVER(InputMethodObserver,
- observer_list_,
- OnInputMethodDestroyed(this));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnInputMethodDestroyed(this);
if (ui::IMEBridge::Get() &&
ui::IMEBridge::Get()->GetInputContextHandler() == this)
ui::IMEBridge::Get()->SetInputContextHandler(nullptr);
@@ -93,7 +92,8 @@ bool InputMethodBase::CanComposeInline() const {
}
void InputMethodBase::ShowImeIfNeeded() {
- FOR_EACH_OBSERVER(InputMethodObserver, observer_list_, OnShowImeIfNeeded());
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnShowImeIfNeeded();
}
void InputMethodBase::AddObserver(InputMethodObserver* observer) {
@@ -128,15 +128,14 @@ ui::EventDispatchDetails InputMethodBase::DispatchKeyEventPostIME(
void InputMethodBase::NotifyTextInputStateChanged(
const TextInputClient* client) {
- FOR_EACH_OBSERVER(InputMethodObserver,
- observer_list_,
- OnTextInputStateChanged(client));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnTextInputStateChanged(client);
}
void InputMethodBase::NotifyTextInputCaretBoundsChanged(
const TextInputClient* client) {
- FOR_EACH_OBSERVER(
- InputMethodObserver, observer_list_, OnCaretBoundsChanged(client));
+ for (InputMethodObserver& observer : observer_list_)
+ observer.OnCaretBoundsChanged(client);
}
void InputMethodBase::SetFocusedTextInputClientInternal(
« no previous file with comments | « ui/base/ime/chromeos/ime_keyboard.cc ('k') | ui/base/ime/mock_input_method.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698