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

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: Created 3 years, 10 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 | ui/events/event_processor.h » ('j') | ui/events/event_processor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index b71391bc5bab8f5977235c55f7e570fe3f791b1c..71932238bd08517bdb16a95e2deaac41fc07ab3c 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -47,6 +47,7 @@
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
+#include "ui/events/event_processor.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
@@ -1149,14 +1150,10 @@ void WindowTreeClient::OnWindowInputEvent(uint32_t event_id,
WindowTreeHostMus* host = GetWindowTreeHostMus(window);
DCHECK(host);
- // The location of the event is relative to |window|. As the event is handed
- // to WindowTreeHost we need it to be relative to WindowTreeHost.
- if (event->IsLocatedEvent()) {
- gfx::Point host_location = event->AsLocatedEvent()->location();
- aura::Window::ConvertPointToTarget(window->GetWindow(), host->window(),
- &host_location);
- event->AsLocatedEvent()->set_location(host_location);
- }
+ // Send the target window that this event should be dispatched to to the event
+ // processor.
+ window->GetWindow()->GetHost()->event_processor()->set_event_target(
+ window->GetWindow());
sadrul 2017/02/07 04:04:54 This is somewhat awkward. Can we set ui::Event::t
sky 2017/02/07 04:19:48 Extremely! What's wrong with trying to find the lo
riajiang 2017/02/07 17:42:40 Done! I didn't know we can set the target for an e
EventAckHandler ack_handler(CreateEventResultCallback(event_id));
// TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or
« no previous file with comments | « no previous file | ui/events/event_processor.h » ('j') | ui/events/event_processor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698