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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: comments 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..5a7ff550b828d5917312e889b62fbc19b570b6d3 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 is the same 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,
sky 2017/06/02 21:17:51 Update -> Set i.e. SetMousePointerLocation.
riajiang 2017/06/02 22:56:17 Done.
+ const int64_t new_mouse_display_id);
sky 2017/06/02 21:17:51 Generally we don't use const for primitive types.
riajiang 2017/06/02 22:56:17 I see, removed.
+
void ProcessKeyEvent(const ui::KeyEvent& event,
AcceleratorMatchPhase match_phase);
@@ -169,7 +184,29 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// when no buttons on the mouse are down.
// 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);
+ // |pointer_target_found| is the PointerTarget for |event| based on the
+ // |deepest_window|, the deepest visible window for the root_location
+ // of the |event|. |location_in_display| and |display_id| are updated values
+ // for root_location and |event_display_id_| (e.g. during drag-n-drop).
+ void ProcessPointerEventOnFoundTarget(
+ const ui::PointerEvent& event,
+ const PointerTarget& pointer_target_found,
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ const int64_t display_id);
+
+ void UpdateNonClientAreaForCurrentWindowOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ const int64_t display_id);
+ void UpdateCursorProviderByLastKnownLocationOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ const int64_t display_id);
+ void UpdateCursorProviderByLastKnownLocationWithWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ const int64_t display_id);
// Adds |pointer_target| to |pointer_targets_|.
void StartTrackingPointer(int32_t pointer_id,
@@ -182,7 +219,8 @@ 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);
// 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