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

Unified Diff: ui/aura/env.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/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 058d94a05eef060058198e95c95a5f4d34ea1b5c..46fedd3bae805d8ad058e277262247f367cfcd32 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -36,7 +36,8 @@ bool RunningInsideMus() {
// Env, public:
Env::~Env() {
- FOR_EACH_OBSERVER(EnvObserver, observers_, OnWillDestroyEnv());
+ for (auto& observer : observers_)
+ observer.OnWillDestroyEnv();
DCHECK_EQ(this, lazy_tls_ptr.Pointer()->Get());
lazy_tls_ptr.Pointer()->Set(NULL);
}
@@ -101,15 +102,18 @@ void Env::Init() {
}
void Env::NotifyWindowInitialized(Window* window) {
- FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window));
+ for (auto& observer : observers_)
+ observer.OnWindowInitialized(window);
}
void Env::NotifyHostInitialized(WindowTreeHost* host) {
- FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostInitialized(host));
+ for (auto& observer : observers_)
+ observer.OnHostInitialized(host);
}
void Env::NotifyHostActivated(WindowTreeHost* host) {
- FOR_EACH_OBSERVER(EnvObserver, observers_, OnHostActivated(host));
+ for (auto& observer : observers_)
+ observer.OnHostActivated(host);
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698