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

Unified Diff: components/mus/ws/window_manager_state.cc

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
index 5a9e15c883eaed4c3037b5ed7ba480292142a3ad..7fc9bd2556f0b80562c7b4eb5b9c1fa5fef1e4a4 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -329,9 +329,16 @@ void WindowManagerState::DispatchInputEventToWindowImpl(
event_awaiting_input_ack_ = ui::Event::Clone(event);
post_target_accelerator_ = accelerator;
}
+
+ // Ignore |tree| because it will receive the event via normal dispatch.
+ window_server()->SendToEventObservers(event, user_id_, tree);
+
tree->DispatchInputEvent(target, event);
}
+////////////////////////////////////////////////////////////////////////////////
+// EventDispatcherDelegate:
+
void WindowManagerState::OnAccelerator(uint32_t accelerator_id,
const ui::Event& event) {
DCHECK(IsActive());
@@ -383,5 +390,10 @@ void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target,
weak_accelerator);
}
+void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) {
+ window_server()->SendToEventObservers(event, user_id_,
+ nullptr /* ignore_tree */);
+}
+
} // namespace ws
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698