| Index: services/ui/public/cpp/lib/window_tree_client.cc
|
| diff --git a/services/ui/public/cpp/lib/window_tree_client.cc b/services/ui/public/cpp/lib/window_tree_client.cc
|
| index b37771cc3fa49eb7e1a354429d7ac31ef27ba9fe..57da6014bb066989d7344c9fd8da07b1ce9b2d2d 100644
|
| --- a/services/ui/public/cpp/lib/window_tree_client.cc
|
| +++ b/services/ui/public/cpp/lib/window_tree_client.cc
|
| @@ -626,15 +626,15 @@ gfx::Point WindowTreeClient::GetCursorScreenPoint() {
|
| static_cast<int16_t>(location & 0xFFFF));
|
| }
|
|
|
| -void WindowTreeClient::SetEventObserver(mojom::EventMatcherPtr matcher) {
|
| - if (matcher.is_null()) {
|
| - has_event_observer_ = false;
|
| - tree_->SetEventObserver(nullptr, 0u);
|
| - } else {
|
| - has_event_observer_ = true;
|
| - event_observer_id_++;
|
| - tree_->SetEventObserver(std::move(matcher), event_observer_id_);
|
| - }
|
| +void WindowTreeClient::StartPointerWatcher(bool want_moves) {
|
| + has_pointer_watcher_ = true;
|
| + pointer_watcher_id_++;
|
| + tree_->StartPointerWatcher(want_moves, pointer_watcher_id_);
|
| +}
|
| +
|
| +void WindowTreeClient::StopPointerWatcher() {
|
| + tree_->StopPointerWatcher();
|
| + has_pointer_watcher_ = false;
|
| }
|
|
|
| void WindowTreeClient::PerformWindowMove(
|
| @@ -972,14 +972,14 @@ void WindowTreeClient::OnWindowSharedPropertyChanged(
|
| void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
|
| Id window_id,
|
| std::unique_ptr<ui::Event> event,
|
| - uint32_t event_observer_id) {
|
| + uint32_t pointer_watcher_id) {
|
| DCHECK(event);
|
| Window* window = GetWindowByServerId(window_id); // May be null.
|
|
|
| - // Non-zero event_observer_id means it matched an event observer on the
|
| + // Non-zero pointer_watcher_id means it matched an event observer on the
|
| // server.
|
| - if (event_observer_id != 0 && has_event_observer_ &&
|
| - event_observer_id == event_observer_id_)
|
| + if (pointer_watcher_id_ != 0 && has_pointer_watcher_ &&
|
| + pointer_watcher_id == pointer_watcher_id_)
|
| delegate_->OnEventObserved(*event.get(), window);
|
|
|
| if (!window || !window->input_event_handler_) {
|
| @@ -1012,9 +1012,9 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
|
| }
|
|
|
| void WindowTreeClient::OnEventObserved(std::unique_ptr<ui::Event> event,
|
| - uint32_t event_observer_id) {
|
| + uint32_t pointer_watcher_id) {
|
| DCHECK(event);
|
| - if (has_event_observer_ && event_observer_id == event_observer_id_)
|
| + if (has_pointer_watcher_ && pointer_watcher_id == pointer_watcher_id_)
|
| delegate_->OnEventObserved(*event.get(), nullptr /* target */);
|
| }
|
|
|
|
|