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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 1752833002: Implement Gesture event hit testing/forwarding for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wjmCFTouch.v2
Patch Set: Update comments as per suggestions. Created 4 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
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 6963b213ad3806a21bdf94826a1268a601d402f4..3a46b4c3c4f2220dd8ca20b272296b707eb5d3fa 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -481,6 +481,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host,
begin_frame_observer_proxy_(this),
set_focus_on_mouse_down_or_key_event_(false),
device_scale_factor_(0.0f),
+ disable_input_event_router_for_testing_(false),
weak_ptr_factory_(this) {
if (!is_guest_view_hack_)
host_->SetView(this);
@@ -869,7 +870,8 @@ bool RenderWidgetHostViewAura::ShouldRouteEvent(const ui::Event* event) const {
// frame. TODO(wjmaclean): At present, this doesn't work for OOPIF, but
// it should be a simple extension to modify RenderWidgetHostViewChildFrame
// in a similar manner to RenderWidgetHostViewGuest.
- bool result = host_->delegate() && host_->delegate()->GetInputEventRouter();
+ bool result = host_->delegate() && host_->delegate()->GetInputEventRouter() &&
+ !disable_input_event_router_for_testing_;
if (event->IsMouseEvent())
result = result && SiteIsolationPolicy::AreCrossProcessFramesPossible();
return result;
@@ -2260,6 +2262,12 @@ void RenderWidgetHostViewAura::ProcessTouchEvent(
host_->ForwardTouchEventWithLatencyInfo(event, latency);
}
+void RenderWidgetHostViewAura::ProcessGestureEvent(
+ const blink::WebGestureEvent& event,
+ const ui::LatencyInfo& latency) {
+ host_->ForwardGestureEventWithLatencyInfo(event, latency);
+}
+
void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace(
const gfx::Point& point,
cc::SurfaceId original_surface,
@@ -2368,11 +2376,21 @@ void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {
blink::WebGestureEvent fling_cancel = gesture;
fling_cancel.type = blink::WebInputEvent::GestureFlingCancel;
fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
- host_->ForwardGestureEvent(fling_cancel);
+ if (ShouldRouteEvent(event)) {
+ host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
+ this, &fling_cancel, ui::LatencyInfo());
+ } else {
+ host_->ForwardGestureEvent(fling_cancel);
+ }
}
if (gesture.type != blink::WebInputEvent::Undefined) {
- host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency());
+ if (ShouldRouteEvent(event)) {
+ host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
+ this, &gesture, *event->latency());
+ } else {
+ host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency());
+ }
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
@@ -2738,6 +2756,7 @@ void RenderWidgetHostViewAura::SetSelectionControllerClientForTest(
scoped_ptr<TouchSelectionControllerClientAura> client) {
selection_controller_client_.swap(client);
CreateSelectionController();
+ disable_input_event_router_for_testing_ = true;
}
void RenderWidgetHostViewAura::InternalSetBounds(const gfx::Rect& rect) {

Powered by Google App Engine
This is Rietveld 408576698