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

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: 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 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 const blink::WebMouseWheelEvent& event) { 2239 const blink::WebMouseWheelEvent& event) {
2240 host_->ForwardWheelEvent(event); 2240 host_->ForwardWheelEvent(event);
2241 } 2241 }
2242 2242
2243 void RenderWidgetHostViewAura::ProcessTouchEvent( 2243 void RenderWidgetHostViewAura::ProcessTouchEvent(
2244 const blink::WebTouchEvent& event, 2244 const blink::WebTouchEvent& event,
2245 const ui::LatencyInfo& latency) { 2245 const ui::LatencyInfo& latency) {
2246 host_->ForwardTouchEventWithLatencyInfo(event, latency); 2246 host_->ForwardTouchEventWithLatencyInfo(event, latency);
2247 } 2247 }
2248 2248
2249 void RenderWidgetHostViewAura::ProcessGestureEvent(
2250 const blink::WebGestureEvent& event,
2251 const ui::LatencyInfo& latency) {
2252 host_->ForwardGestureEventWithLatencyInfo(event, latency);
2253 }
2254
2249 void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace( 2255 void RenderWidgetHostViewAura::TransformPointToLocalCoordSpace(
2250 const gfx::Point& point, 2256 const gfx::Point& point,
2251 cc::SurfaceId original_surface, 2257 cc::SurfaceId original_surface,
2252 gfx::Point* transformed_point) { 2258 gfx::Point* transformed_point) {
2253 delegated_frame_host_->TransformPointToLocalCoordSpace( 2259 delegated_frame_host_->TransformPointToLocalCoordSpace(
2254 point, original_surface, transformed_point); 2260 point, original_surface, transformed_point);
2255 } 2261 }
2256 2262
2257 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { 2263 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
2258 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent"); 2264 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnScrollEvent");
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 if (event->type() == ui::ET_GESTURE_TAP) 2353 if (event->type() == ui::ET_GESTURE_TAP)
2348 FinishImeCompositionSession(); 2354 FinishImeCompositionSession();
2349 2355
2350 blink::WebGestureEvent gesture = MakeWebGestureEvent(*event); 2356 blink::WebGestureEvent gesture = MakeWebGestureEvent(*event);
2351 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 2357 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
2352 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an 2358 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an
2353 // event to stop any in-progress flings. 2359 // event to stop any in-progress flings.
2354 blink::WebGestureEvent fling_cancel = gesture; 2360 blink::WebGestureEvent fling_cancel = gesture;
2355 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; 2361 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel;
2356 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen; 2362 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
2357 host_->ForwardGestureEvent(fling_cancel); 2363 if (ShouldRouteEvent(event)) {
2364 host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
2365 this, &fling_cancel, ui::LatencyInfo());
2366 } else {
2367 host_->ForwardGestureEvent(fling_cancel);
2368 }
2358 } 2369 }
2359 2370
2360 if (gesture.type != blink::WebInputEvent::Undefined) { 2371 if (gesture.type != blink::WebInputEvent::Undefined) {
2361 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency()); 2372 if (ShouldRouteEvent(event)) {
2373 host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
2374 this, &gesture, *event->latency());
2375 } else {
2376 host_->ForwardGestureEventWithLatencyInfo(gesture, *event->latency());
2377 }
2362 2378
2363 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 2379 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
2364 event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 2380 event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
2365 event->type() == ui::ET_GESTURE_SCROLL_END) { 2381 event->type() == ui::ET_GESTURE_SCROLL_END) {
2366 RecordAction(base::UserMetricsAction("TouchscreenScroll")); 2382 RecordAction(base::UserMetricsAction("TouchscreenScroll"));
2367 } else if (event->type() == ui::ET_SCROLL_FLING_START) { 2383 } else if (event->type() == ui::ET_SCROLL_FLING_START) {
2368 RecordAction(base::UserMetricsAction("TouchscreenScrollFling")); 2384 RecordAction(base::UserMetricsAction("TouchscreenScrollFling"));
2369 } 2385 }
2370 } 2386 }
2371 2387
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 3112
3097 //////////////////////////////////////////////////////////////////////////////// 3113 ////////////////////////////////////////////////////////////////////////////////
3098 // RenderWidgetHostViewBase, public: 3114 // RenderWidgetHostViewBase, public:
3099 3115
3100 // static 3116 // static
3101 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3117 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3102 GetScreenInfoForWindow(results, NULL); 3118 GetScreenInfoForWindow(results, NULL);
3103 } 3119 }
3104 3120
3105 } // namespace content 3121 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698