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

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

Issue 2905333002: Separate out event-targeting logic in EventDispatcher to EventTargeter. (Closed)
Patch Set: rebase 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 | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/event_dispatcher.cc » ('j') | no next file with comments »
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 a99846e85eaf25884bc33862f21d738c0c567d88..193786bd6ee5d119c42684623986a3ce9c612e94 100644
--- a/services/ui/ws/event_dispatcher.h
+++ b/services/ui/ws/event_dispatcher.h
@@ -16,6 +16,7 @@
#include "services/ui/public/interfaces/cursor/cursor.mojom.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "services/ui/ws/drag_cursor_updater.h"
+#include "services/ui/ws/event_targeter.h"
#include "services/ui/ws/modal_window_controller.h"
#include "services/ui/ws/server_window_observer.h"
#include "ui/gfx/geometry/rect_f.h"
@@ -29,7 +30,6 @@ class PointerEvent;
namespace ws {
class Accelerator;
-struct DeepestWindow;
class DragController;
class DragSource;
class DragTargetConnection;
@@ -151,27 +151,6 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
private:
friend class test::EventDispatcherTestApi;
- // Keeps track of state associated with an active pointer.
- struct PointerTarget {
- PointerTarget()
- : window(nullptr),
- is_mouse_event(false),
- in_nonclient_area(false),
- is_pointer_down(false) {}
-
- // The target window, which may be null. null is used in two situations:
- // when there is no valid window target, or there was a target but the
- // window is destroyed before a corresponding release/cancel.
- ServerWindow* window;
-
- bool is_mouse_event;
-
- // Did the pointer event start in the non-client area.
- bool in_nonclient_area;
-
- bool is_pointer_down;
- };
-
void SetMouseCursorSourceWindow(ServerWindow* window);
void ProcessKeyEvent(const ui::KeyEvent& event,
@@ -205,11 +184,6 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
void UpdateTargetForPointer(int32_t pointer_id,
const ui::LocatedEvent& event);
- // Returns a PointerTarget for the supplied event. If there is no valid
- // event target for the specified location |window| in the returned value is
- // null.
- PointerTarget PointerTargetForEvent(const ui::LocatedEvent& event);
-
// Returns true if any pointers are in the pressed/down state.
bool AreAnyPointersDown() const;
@@ -238,9 +212,6 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
Accelerator* FindAccelerator(const ui::KeyEvent& event,
const ui::mojom::AcceleratorPhase phase);
- DeepestWindow FindDeepestVisibleWindowForEvents(gfx::Point* location,
- int64_t* display_id);
-
// Clears the implicit captures in |pointer_targets_|, with the exception of
// |window|. |window| may be null. |client_id| is the target client of
// |window|.
@@ -266,6 +237,8 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
ModalWindowController modal_window_controller_;
+ std::unique_ptr<EventTargeter> event_targeter_;
+
bool mouse_button_down_;
ServerWindow* mouse_cursor_source_window_;
bool mouse_cursor_in_non_client_area_;
« no previous file with comments | « services/ui/ws/BUILD.gn ('k') | services/ui/ws/event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698