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

Unified Diff: ui/base/win/osk_display_manager.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/win/osk_display_manager.cc
diff --git a/ui/base/win/osk_display_manager.cc b/ui/base/win/osk_display_manager.cc
index c3abb9fc567eee070fbef9e5a39168bd1e56b875..dcc0fd60b2786e1d151a5f5e7e0c3b73938bb5cc 100644
--- a/ui/base/win/osk_display_manager.cc
+++ b/ui/base/win/osk_display_manager.cc
@@ -219,8 +219,8 @@ void OnScreenKeyboardDetector::HandleKeyboardVisible() {
DCHECK(!osk_visible_notification_received_);
osk_visible_notification_received_ = true;
- FOR_EACH_OBSERVER(OnScreenKeyboardObserver, observers_,
- OnKeyboardVisible(osk_rect_pixels_));
+ for (auto& observer : observers_)
+ observer.OnKeyboardVisible(osk_rect_pixels_);
// Now that the keyboard is visible, run the task to detect if it was hidden.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
@@ -231,8 +231,8 @@ void OnScreenKeyboardDetector::HandleKeyboardVisible() {
void OnScreenKeyboardDetector::HandleKeyboardHidden() {
osk_visible_notification_received_ = false;
- FOR_EACH_OBSERVER(OnScreenKeyboardObserver, observers_,
- OnKeyboardHidden(osk_rect_pixels_));
+ for (auto& observer : observers_)
+ observer.OnKeyboardHidden(osk_rect_pixels_);
ClearObservers();
}

Powered by Google App Engine
This is Rietveld 408576698