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

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

Issue 2942903002: Remove AreCrossProcessFramesPossible on Android (Closed)
Patch Set: Removed unnecessary call Created 3 years, 6 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 | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_input_event_router.cc
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index c88f7d63470077bf2808037a847c69179c78be73..d537fb13527089194d5f1928f97745dd90870966 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -790,26 +790,21 @@ void RenderWidgetHostInputEventRouter::RouteTouchscreenGestureEvent(
return;
}
- // We use GestureTapDown to detect the start of a gesture sequence since there
- // is no WebGestureEvent equivalent for ET_GESTURE_BEGIN. Note that this
- // means the GestureFlingCancel that always comes between ET_GESTURE_BEGIN and
- // GestureTapDown is sent to the previous target, in case it is still in a
- // fling.
- if (event->GetType() == blink::WebInputEvent::kGestureTapDown) {
- bool no_target = touchscreen_gesture_target_queue_.empty();
- // This UMA metric is temporary, and will be removed once it has fulfilled
- // it's purpose, namely telling us when the incidents of empty
- // gesture-queues has dropped to zero. https://crbug.com/642008
- UMA_HISTOGRAM_BOOLEAN("Event.FrameEventRouting.NoGestureTarget", no_target);
- if (no_target) {
- LOG(ERROR) << "Gesture sequence start detected with no target available.";
- // Ignore this gesture sequence as no target is available.
- // TODO(wjmaclean): this only happens on Windows, and should not happen.
- // https://crbug.com/595422
- touchscreen_gesture_target_.target = nullptr;
- return;
- }
-
+ // On Android it is possible for touchscreen gesture events to arrive that
+ // are not associated with touch events, because non-synthetic events can be
+ // created by ContentView. In that case the target queue will be empty.
+ if (touchscreen_gesture_target_queue_.empty()) {
+ gfx::Point transformed_point;
+ gfx::Point original_point(event->x, event->y);
+ touchscreen_gesture_target_.target =
+ FindEventTarget(root_view, original_point, &transformed_point);
+ touchscreen_gesture_target_.delta = transformed_point - original_point;
+ } else if (event->GetType() == blink::WebInputEvent::kGestureTapDown) {
+ // We use GestureTapDown to detect the start of a gesture sequence since
+ // there is no WebGestureEvent equivalent for ET_GESTURE_BEGIN. Note that
+ // this means the GestureFlingCancel that always comes between
+ // ET_GESTURE_BEGIN and GestureTapDown is sent to the previous target, in
+ // case it is still in a fling.
touchscreen_gesture_target_ = touchscreen_gesture_target_queue_.front();
touchscreen_gesture_target_queue_.pop_front();
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698