| Index: components/mus/ws/window_tree.cc
|
| diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
|
| index 863a3a13e61a2095581b0f08fac3b089e39daa76..e1d719037db896469856d3e18147ade9db36694a 100644
|
| --- a/components/mus/ws/window_tree.cc
|
| +++ b/components/mus/ws/window_tree.cc
|
| @@ -13,6 +13,7 @@
|
| #include "components/mus/ws/default_access_policy.h"
|
| #include "components/mus/ws/display.h"
|
| #include "components/mus/ws/display_manager.h"
|
| +#include "components/mus/ws/event_matcher.h"
|
| #include "components/mus/ws/focus_controller.h"
|
| #include "components/mus/ws/operation.h"
|
| #include "components/mus/ws/platform_display.h"
|
| @@ -951,9 +952,16 @@ void WindowTree::DispatchInputEventImpl(ServerWindow* target,
|
| event_source_wms_ = GetWindowManagerState(target);
|
| // Should only get events from windows attached to a host.
|
| DCHECK(event_source_wms_);
|
| + bool matched_observer =
|
| + event_observer_matcher_ && event_observer_matcher_->MatchesEvent(event);
|
| client()->OnWindowInputEvent(event_ack_id_,
|
| ClientWindowIdForWindow(target).id,
|
| - mojom::Event::From(event));
|
| + mojom::Event::From(event), matched_observer);
|
| +}
|
| +
|
| +void WindowTree::SendToEventObserver(const ui::Event& event) {
|
| + if (event_observer_matcher_ && event_observer_matcher_->MatchesEvent(event))
|
| + client()->OnEventObserved(mojom::Event::From(event));
|
| }
|
|
|
| void WindowTree::NewWindow(
|
| @@ -1109,6 +1117,13 @@ void WindowTree::ReleaseCapture(uint32_t change_id, Id window_id) {
|
| client()->OnChangeCompleted(change_id, success);
|
| }
|
|
|
| +void WindowTree::SetEventObserver(mojom::EventMatcherPtr matcher) {
|
| + if (!matcher.is_null())
|
| + event_observer_matcher_.reset(new EventMatcher(*matcher));
|
| + else
|
| + event_observer_matcher_.reset();
|
| +}
|
| +
|
| void WindowTree::SetWindowBounds(uint32_t change_id,
|
| Id window_id,
|
| mojo::RectPtr bounds) {
|
|
|