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

Unified Diff: services/ui/ws/event_dispatcher.h

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: cache; by value Created 3 years, 7 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 | « no previous file | services/ui/ws/event_dispatcher.cc » ('j') | services/ui/ws/event_dispatcher.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/event_dispatcher.h
diff --git a/services/ui/ws/event_dispatcher.h b/services/ui/ws/event_dispatcher.h
index 193786bd6ee5d119c42684623986a3ce9c612e94..5bcbbbae661fcd9b398eb0637c9a2ccb6e6c20f0 100644
--- a/services/ui/ws/event_dispatcher.h
+++ b/services/ui/ws/event_dispatcher.h
@@ -59,6 +59,8 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// any events to the delegate.
void Reset();
+ const EventTargeter* event_targeter() const { return event_targeter_.get(); }
+
void SetMousePointerDisplayLocation(const gfx::Point& display_location,
const int64_t display_id);
const gfx::Point& mouse_pointer_last_location() const {
@@ -144,6 +146,8 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// ANY and there is a matching accelerator with PRE_TARGET found, than only
// OnAccelerator() is called. The expectation is after the PRE_TARGET has been
// handled this is again called with an AcceleratorMatchPhase of POST_ONLY.
+ // This may be asynchronous if we need to find the target window for |event|
+ // asynchronously.
void ProcessEvent(const ui::Event& event,
const int64_t display_id,
AcceleratorMatchPhase match_phase);
@@ -153,6 +157,17 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
void SetMouseCursorSourceWindow(ServerWindow* window);
+ // Called after we found the target for the current mouse cursor to see if
+ // |mouse_pointer_last_location_| and |mouse_pointer_display_id_| need to be
+ // updated based on the new target we found. No need to call delegate's
+ // OnMouseCursorLocationChanged since mouse location would still be the same
sky 2017/05/31 23:36:34 'would still be' -> is
riajiang 2017/06/01 18:22:12 Done.
+ // in screen-coord.
+ // TODO(riajiang): No need to update mouse location after ozone drm can tell
+ // us the right display the cursor is on for drag-n-drop events.
+ // crbug.com/726470
+ void UpdateMousePointerLocation(const gfx::Point& new_mouse_location,
+ const int64_t new_mouse_display_id);
+
void ProcessKeyEvent(const ui::KeyEvent& event,
AcceleratorMatchPhase match_phase);
@@ -170,6 +185,12 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// This also generates exit events as appropriate. For example, if the mouse
// moves between one window to another an exit is generated on the first.
void ProcessPointerEvent(const ui::PointerEvent& event);
+ void ProcessPointerEventOnFoundTarget(
+ const ui::PointerEvent& event,
+ const PointerTarget& pointer_target_found,
+ const DeepestWindow& deepest_window,
+ const gfx::Point& new_location,
sky 2017/05/31 23:36:34 Please document what the args are. optional: renam
riajiang 2017/06/01 18:22:12 Done. And renamed.
+ const int64_t new_display_id);
// Adds |pointer_target| to |pointer_targets_|.
void StartTrackingPointer(int32_t pointer_id,
@@ -182,7 +203,21 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// pointer sends the appropriate event to the delegate and updates the
// currently tracked PointerTarget appropriately.
void UpdateTargetForPointer(int32_t pointer_id,
- const ui::LocatedEvent& event);
+ const ui::PointerEvent& event,
+ const PointerTarget& pointer_target_found);
+
+ void UpdateNonClientAreaForCurrentWindowOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& new_location,
+ const int64_t new_display_id);
+ void UpdateCursorProviderByLastKnownLocationOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& new_location,
+ const int64_t new_display_id);
+ void UpdateCursorProviderByLastKnownLocationWithWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& new_location,
+ const int64_t new_display_id);
// Returns true if any pointers are in the pressed/down state.
bool AreAnyPointersDown() const;
« no previous file with comments | « no previous file | services/ui/ws/event_dispatcher.cc » ('j') | services/ui/ws/event_dispatcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698