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

Unified Diff: ui/aura/window_tree_host.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/aura/window_tree_host.cc
diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc
index afa08aa984ee79bb848ff46546305472dfeec3c5..35c04037771164f4f9ea8f67cf593d0f2219dda9 100644
--- a/ui/aura/window_tree_host.cc
+++ b/ui/aura/window_tree_host.cc
@@ -270,8 +270,8 @@ void WindowTreeHost::OnHostMoved(const gfx::Point& new_location) {
TRACE_EVENT1("ui", "WindowTreeHost::OnHostMoved",
"origin", new_location.ToString());
- FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_,
- OnHostMoved(this, new_location));
+ for (auto& observer : observers_)
+ observer.OnHostMoved(this, new_location);
}
void WindowTreeHost::OnHostResized(const gfx::Size& new_size) {
@@ -287,17 +287,18 @@ void WindowTreeHost::OnHostResized(const gfx::Size& new_size) {
// The layer, and the observers should be notified of the
// transformed size of the root window.
UpdateRootWindowSize(layer_size);
- FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_, OnHostResized(this));
+ for (auto& observer : observers_)
+ observer.OnHostResized(this);
}
void WindowTreeHost::OnHostWorkspaceChanged() {
- FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_,
- OnHostWorkspaceChanged(this));
+ for (auto& observer : observers_)
+ observer.OnHostWorkspaceChanged(this);
}
void WindowTreeHost::OnHostCloseRequested() {
- FOR_EACH_OBSERVER(WindowTreeHostObserver, observers_,
- OnHostCloseRequested(this));
+ for (auto& observer : observers_)
+ observer.OnHostCloseRequested(this);
}
void WindowTreeHost::OnHostActivated() {

Powered by Google App Engine
This is Rietveld 408576698