Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| index 691149711b408195492c51dc928578823511b3f2..9d9a563ec3042fd0403b50dd2ca3d34655347910 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| @@ -44,6 +44,7 @@ |
| #include "content/browser/renderer_host/web_input_event_aura.h" |
| #include "content/common/gpu/client/gl_helper.h" |
| #include "content/common/gpu/gpu_messages.h" |
| +#include "content/common/site_isolation_policy.h" |
| #include "content/common/view_messages.h" |
| #include "content/public/browser/content_browser_client.h" |
| #include "content/public/browser/overscroll_configuration.h" |
| @@ -861,6 +862,13 @@ bool RenderWidgetHostViewAura::CanRendererHandleEvent( |
| return true; |
| } |
| +bool RenderWidgetHostViewAura::ShouldRouteEvent(const ui::Event* event) const { |
| + bool result = host_->delegate() && host_->delegate()->GetInputEventRouter(); |
| + if (event->IsMouseEvent()) |
|
Charlie Reis
2015/11/30 18:09:11
Please add a comment in this method about what pol
wjmaclean
2015/12/10 16:09:07
Done.
Charlie Reis
2015/12/10 21:58:14
I think you misunderstood my question. By default
|
| + result = result && SiteIsolationPolicy::AreCrossProcessFramesPossible(); |
| + return result; |
| +} |
| + |
| void RenderWidgetHostViewAura::HandleParentBoundsChanged() { |
| SnapToPhysicalPixelBoundary(); |
| #if defined(OS_WIN) |
| @@ -2131,7 +2139,7 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { |
| blink::WebMouseWheelEvent mouse_wheel_event = |
| MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent&>(*event)); |
| if (mouse_wheel_event.deltaX != 0 || mouse_wheel_event.deltaY != 0) { |
| - if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { |
| + if (ShouldRouteEvent(event)) { |
| host_->delegate()->GetInputEventRouter()->RouteMouseWheelEvent( |
| this, &mouse_wheel_event); |
| } else { |
| @@ -2150,7 +2158,7 @@ void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { |
| blink::WebMouseEvent mouse_event = MakeWebMouseEvent(*event); |
| ModifyEventMovementAndCoords(&mouse_event); |
| - if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { |
| + if (ShouldRouteEvent(event)) { |
| host_->delegate()->GetInputEventRouter()->RouteMouseEvent(this, |
| &mouse_event); |
| } else { |
| @@ -2223,6 +2231,12 @@ void RenderWidgetHostViewAura::ProcessMouseWheelEvent( |
| host_->ForwardWheelEvent(event); |
| } |
| +void RenderWidgetHostViewAura::ProcessTouchEvent( |
| + const blink::WebTouchEvent& event, |
| + const ui::LatencyInfo& latency) { |
| + host_->ForwardTouchEventWithLatencyInfo(event, latency); |
| +} |
| + |
| void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace( |
| const gfx::Point& point, |
| cc::SurfaceId original_surface, |
| @@ -2297,7 +2311,12 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { |
| // Set unchanged touch point to StateStationary for touchmove and |
| // touchcancel to make sure only send one ack per WebTouchEvent. |
| MarkUnchangedTouchPointsAsStationary(&touch_event, event->touch_id()); |
| - host_->ForwardTouchEventWithLatencyInfo(touch_event, *event->latency()); |
| + if (ShouldRouteEvent(event)) { |
| + host_->delegate()->GetInputEventRouter()->RouteTouchEvent( |
| + this, &touch_event, *event->latency()); |
| + } else { |
| + ProcessTouchEvent(touch_event, *event->latency()); |
| + } |
| } |
| void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { |