Chromium Code Reviews| Index: content/browser/renderer_host/input/synthetic_gesture_target_aura.cc |
| diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc |
| index 95382879e80814d9abf298874db380485e8eb9b0..a165c57b8a951374f6ba93a26802451f82914e78 100644 |
| --- a/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc |
| +++ b/content/browser/renderer_host/input/synthetic_gesture_target_aura.cc |
| @@ -12,6 +12,7 @@ |
| #include "content/browser/renderer_host/render_widget_host_impl.h" |
| #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| #include "content/browser/renderer_host/ui_events_helper.h" |
| +#include "ui/aura/event_injector.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/window_tree_host.h" |
| #include "ui/events/event_sink.h" |
| @@ -46,9 +47,10 @@ void SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform( |
| aura::Window* window = GetWindow(); |
| aura::WindowTreeHost* host = window->GetHost(); |
| + aura::EventInjector injektor; |
|
sky
2017/05/12 12:11:51
Is there a reason you went for injektor with a 'k'
sadrul
2017/05/12 21:26:08
Whoops, sorry, no. Forgot to rename the variables
|
| + |
| for (const auto& event : events) { |
| event->ConvertLocationToTarget(window, host->window()); |
| - |
| // Apply the screen scale factor to the event location after it has been |
| // transformed to the target. |
| gfx::PointF device_location = |
| @@ -57,8 +59,7 @@ void SyntheticGestureTargetAura::DispatchWebTouchEventToPlatform( |
| gfx::ScalePoint(event->root_location_f(), device_scale_factor_); |
| event->set_location_f(device_location); |
| event->set_root_location_f(device_root_location); |
| - ui::EventDispatchDetails details = |
| - host->event_sink()->OnEventFromSource(event.get()); |
| + ui::EventDispatchDetails details = injektor.Inject(host, event.get()); |
| if (details.dispatcher_destroyed) |
| break; |
| } |
| @@ -77,8 +78,9 @@ void SyntheticGestureTargetAura::DispatchWebMouseWheelEventToPlatform( |
| aura::Window* window = GetWindow(); |
| wheel_event.ConvertLocationToTarget(window, window->GetRootWindow()); |
| + aura::EventInjector injektor; |
| ui::EventDispatchDetails details = |
| - window->GetHost()->event_sink()->OnEventFromSource(&wheel_event); |
| + injektor.Inject(window->GetHost(), &wheel_event); |
| if (details.dispatcher_destroyed) |
| return; |
| } |
| @@ -162,8 +164,9 @@ void SyntheticGestureTargetAura::DispatchWebMouseEventToPlatform( |
| aura::Window* window = GetWindow(); |
| mouse_event.ConvertLocationToTarget(window, window->GetRootWindow()); |
| + aura::EventInjector injektor; |
| ui::EventDispatchDetails details = |
| - window->GetHost()->event_sink()->OnEventFromSource(&mouse_event); |
| + injektor.Inject(window->GetHost(), &mouse_event); |
| if (details.dispatcher_destroyed) |
| return; |
| } |