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

Unified Diff: services/ui/public/cpp/window_tree_client.cc

Issue 2424613002: Remove usage of FOR_EACH_OBSERVER macro in services/ (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
« no previous file with comments | « services/ui/public/cpp/window.cc ('k') | services/ui/ws/animation_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/window_tree_client.cc
diff --git a/services/ui/public/cpp/window_tree_client.cc b/services/ui/public/cpp/window_tree_client.cc
index 01bd08277138efa39f463c8ef10d66a8e4f1c95e..759ff228110b789f413779870bb020b923560f9f 100644
--- a/services/ui/public/cpp/window_tree_client.cc
+++ b/services/ui/public/cpp/window_tree_client.cc
@@ -92,8 +92,8 @@ WindowTreeClient::WindowTreeClient(
WindowTreeClient::~WindowTreeClient() {
in_destructor_ = true;
- FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_,
- OnWillDestroyClient(this));
+ for (auto& observer : observers_)
+ observer.OnWillDestroyClient(this);
std::vector<Window*> non_owned;
WindowTracker tracker;
@@ -114,8 +114,8 @@ WindowTreeClient::~WindowTreeClient() {
while (!tracker.windows().empty())
delete tracker.windows().front();
- FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_,
- OnDidDestroyClient(this));
+ for (auto& observer : observers_)
+ observer.OnDidDestroyClient(this);
}
void WindowTreeClient::ConnectViaWindowTreeFactory(
@@ -370,11 +370,11 @@ void WindowTreeClient::LocalSetCapture(Window* window) {
Window* lost_capture = capture_window_;
capture_window_ = window;
if (lost_capture) {
- FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(lost_capture).observers(),
- OnWindowLostCapture(lost_capture));
+ for (auto& observer : *WindowPrivate(lost_capture).observers())
+ observer.OnWindowLostCapture(lost_capture);
}
- FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_,
- OnWindowTreeCaptureChanged(window, lost_capture));
+ for (auto& observer : observers_)
+ observer.OnWindowTreeCaptureChanged(window, lost_capture);
}
void WindowTreeClient::LocalSetFocus(Window* focused) {
@@ -384,15 +384,15 @@ void WindowTreeClient::LocalSetFocus(Window* focused) {
// |WindowTreeClient::GetFocusedWindow()| etc.
focused_window_ = focused;
if (blurred) {
- FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(blurred).observers(),
- OnWindowFocusChanged(focused, blurred));
+ for (auto& observer : *WindowPrivate(blurred).observers())
+ observer.OnWindowFocusChanged(focused, blurred);
}
if (focused) {
- FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(focused).observers(),
- OnWindowFocusChanged(focused, blurred));
+ for (auto& observer : *WindowPrivate(focused).observers())
+ observer.OnWindowFocusChanged(focused, blurred);
}
- FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_,
- OnWindowTreeFocusChanged(focused, blurred));
+ for (auto& observer : observers_)
+ observer.OnWindowTreeFocusChanged(focused, blurred);
}
void WindowTreeClient::AddWindow(Window* window) {
@@ -570,8 +570,8 @@ void WindowTreeClient::OnEmbedImpl(mojom::WindowTree* window_tree,
delegate_->OnEmbed(root);
if (focused_window_) {
- FOR_EACH_OBSERVER(WindowTreeClientObserver, observers_,
- OnWindowTreeFocusChanged(focused_window_, nullptr));
+ for (auto& observer : observers_)
+ observer.OnWindowTreeFocusChanged(focused_window_, nullptr);
}
}
@@ -783,8 +783,8 @@ void WindowTreeClient::OnEmbed(ClientSpecificId client_id,
void WindowTreeClient::OnEmbeddedAppDisconnected(Id window_id) {
Window* window = GetWindowByServerId(window_id);
if (window) {
- FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(),
- OnWindowEmbeddedAppDisconnected(window));
+ for (auto& observer : *WindowPrivate(window).observers())
+ observer.OnWindowEmbeddedAppDisconnected(window);
}
}
@@ -1247,8 +1247,8 @@ void WindowTreeClient::RequestClose(uint32_t window_id) {
if (!window || !IsRoot(window))
return;
- FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(),
- OnRequestClose(window));
+ for (auto& observer : *WindowPrivate(window).observers())
+ observer.OnRequestClose(window);
}
void WindowTreeClient::OnConnect(ClientSpecificId client_id) {
« no previous file with comments | « services/ui/public/cpp/window.cc ('k') | services/ui/ws/animation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698