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

Side by Side 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: Address nits, convert test to use positioned iframe. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 const blink::WebMouseWheelEvent& event) { 2253 const blink::WebMouseWheelEvent& event) {
2254 host_->ForwardWheelEvent(event); 2254 host_->ForwardWheelEvent(event);
2255 } 2255 }
2256 2256
2257 void RenderWidgetHostViewAura::ProcessTouchEvent( 2257 void RenderWidgetHostViewAura::ProcessTouchEvent(
2258 const blink::WebTouchEvent& event, 2258 const blink::WebTouchEvent& event,
2259 const ui::LatencyInfo& latency) { 2259 const ui::LatencyInfo& latency) {
2260 host_->ForwardTouchEventWithLatencyInfo(event, latency); 2260 host_->ForwardTouchEventWithLatencyInfo(event, latency);
2261 } 2261 }
2262 2262
2263 void RenderWidgetHostViewAura::ProcessGestureEvent(
2264 const blink::WebGestureEvent& event,
2265 const ui::LatencyInfo& latency) {
2266 host_->ForwardGestureEventWithLatencyInfo(event, latency);
2267 }
2268
2263 void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace( 2269 void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace(
2264 const gfx::Point& point, 2270 const gfx::Point& point,
2265 cc::SurfaceId original_surface, 2271 cc::SurfaceId original_surface,
2266 gfx::Point* transformed_point) { 2272 gfx::Point* transformed_point) {
2267 delegated_frame_host_->TransformPointToLocalCoordSpace( 2273 delegated_frame_host_->TransformPointToLocalCoordSpace(
2268 point, original_surface, transformed_point); 2274 point, original_surface, transformed_point);
2269 } 2275 }
2270 2276
2271 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { 2277 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
2272 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); 2278 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 if (event->type() == ui::ET_GESTURE_TAP) 2367 if (event->type() == ui::ET_GESTURE_TAP)
2362 FinishImeCompositionSession(); 2368 FinishImeCompositionSession();
2363 2369
2364 blink::WebGestureEvent gesture = MakeWebGestureEvent(*event); 2370 blink::WebGestureEvent gesture = MakeWebGestureEvent(*event);
2365 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 2371 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
2366 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an 2372 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an
2367 // event to stop any in-progress flings. 2373 // event to stop any in-progress flings.
2368 blink::WebGestureEvent fling_cancel = gesture; 2374 blink::WebGestureEvent fling_cancel = gesture;
2369 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; 2375 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel;
2370 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen; 2376 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
2371 host_->ForwardGestureEvent(fling_cancel); 2377 if (ShouldRouteEvent(event)) {
2378 host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
2379 this, &fling_cancel, ui::LatencyInfo());
2380 } else {
2381 host_->ForwardGestureEvent(fling_cancel);
2382 }
2372 } 2383 }
2373 2384
2374 if (gesture.type != blink::WebInputEvent::Undefined) { 2385 if (gesture.type != blink::WebInputEvent::Undefined) {
2375 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency()); 2386 if (ShouldRouteEvent(event)) {
2387 host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
2388 this, &gesture, *event->latency());
2389 } else {
2390 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency());
2391 }
2376 2392
2377 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 2393 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
2378 event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 2394 event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
2379 event->type() == ui::ET_GESTURE_SCROLL_END) { 2395 event->type() == ui::ET_GESTURE_SCROLL_END) {
2380 RecordAction(base::UserMetricsAction("TouchscreenScroll")); 2396 RecordAction(base::UserMetricsAction("TouchscreenScroll"));
2381 } else if (event->type() == ui::ET_SCROLL_FLING_START) { 2397 } else if (event->type() == ui::ET_SCROLL_FLING_START) {
2382 RecordAction(base::UserMetricsAction("TouchscreenScrollFling")); 2398 RecordAction(base::UserMetricsAction("TouchscreenScrollFling"));
2383 } 2399 }
2384 } 2400 }
2385 2401
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
3110 3126
3111 //////////////////////////////////////////////////////////////////////////////// 3127 ////////////////////////////////////////////////////////////////////////////////
3112 // RenderWidgetHostViewBase, public: 3128 // RenderWidgetHostViewBase, public:
3113 3129
3114 // static 3130 // static
3115 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3131 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3116 GetScreenInfoForWindow(results, NULL); 3132 GetScreenInfoForWindow(results, NULL);
3117 } 3133 }
3118 3134
3119 } // namespace content 3135 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698