Index: services/ui/ws/window_tree.h |
diff --git a/services/ui/ws/window_tree.h b/services/ui/ws/window_tree.h |
index ff71bda9353ed8db5d10e749f9c1e815f6484f06..e55385dde855aced3bf6fea769d70cb537ca9742 100644 |
--- a/services/ui/ws/window_tree.h |
+++ b/services/ui/ws/window_tree.h |
@@ -337,6 +337,9 @@ class WindowTree : public mojom::WindowTree, |
void DispatchInputEventImpl(ServerWindow* target, const ui::Event& event); |
+ // Returns true if the client has a pointer watcher and this event matches. |
+ bool EventMatchesPointerWatcher(const ui::Event& event); |
+ |
// Calls OnChangeCompleted() on the client. |
void NotifyChangeCompleted(uint32_t change_id, |
mojom::WindowManagerErrorCode error_code); |
@@ -371,6 +374,9 @@ class WindowTree : public mojom::WindowTree, |
void ReleaseCapture(uint32_t change_id, Id window_id) override; |
void SetEventObserver(mojom::EventMatcherPtr matcher, |
uint32_t observer_id) override; |
+ void StartPointerWatcher(bool want_moves, |
+ uint32_t pointer_watcher_id) override; |
+ void StopPointerWatcher() override; |
void SetWindowBounds(uint32_t change_id, |
Id window_id, |
const gfx::Rect& bounds) override; |
@@ -484,12 +490,15 @@ class WindowTree : public mojom::WindowTree, |
// reasonable timeframe. |
bool janky_ = false; |
- // Set when the client is using SetEventObserver() to observe events, |
- // otherwise null. |
- std::unique_ptr<EventMatcher> event_observer_matcher_; |
+ // Whether the client is observing pointer events. |
+ bool has_pointer_watcher_ = false; |
+ |
+ // For performance reasons, only send move events if the client explicitly |
+ // requests them. |
+ bool pointer_watcher_want_moves_ = false; |
- // The ID supplied by the client for the current event observer. |
- uint32_t event_observer_id_ = 0; |
+ // The ID supplied by the client for the current pointer watcher. |
+ uint32_t pointer_watcher_id_ = 0; |
// WindowManager the current event came from. |
WindowManagerState* event_source_wms_ = nullptr; |