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

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

Issue 2422073002: Reduce FOR_EACH_OBSERVER usage in ui/ (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: 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..922a331fec2de03cc7bcdc337618959217379653 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 (auto& 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 (auto& 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 (auto& observer : observer_list_)
+ observer.OnTextInputStateChanged(client);
}
void InputMethodBase::NotifyTextInputCaretBoundsChanged(
const TextInputClient* client) {
- FOR_EACH_OBSERVER(
- InputMethodObserver, observer_list_, OnCaretBoundsChanged(client));
+ for (auto& observer : observer_list_)
+ observer.OnCaretBoundsChanged(client);
}
void InputMethodBase::SetFocusedTextInputClientInternal(

Powered by Google App Engine
This is Rietveld 408576698