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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_event_handler.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Rebase Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_event_handler.h" 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
6 6
7 #include "base/metrics/user_metrics_action.h" 7 #include "base/metrics/user_metrics_action.h"
8 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h" 8 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h"
9 #include "content/browser/renderer_host/overscroll_controller.h" 9 #include "content/browser/renderer_host/overscroll_controller.h"
10 #include "content/browser/renderer_host/render_view_host_delegate.h" 10 #include "content/browser/renderer_host/render_view_host_delegate.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // caret won't be moved with an ongoing composition text. 498 // caret won't be moved with an ongoing composition text.
499 if (event->type() == ui::ET_GESTURE_TAP) 499 if (event->type() == ui::ET_GESTURE_TAP)
500 FinishImeCompositionSession(); 500 FinishImeCompositionSession();
501 501
502 blink::WebGestureEvent gesture = 502 blink::WebGestureEvent gesture =
503 ui::MakeWebGestureEvent(*event, base::Bind(&GetScreenLocationFromEvent)); 503 ui::MakeWebGestureEvent(*event, base::Bind(&GetScreenLocationFromEvent));
504 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { 504 if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
505 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an 505 // Webkit does not stop a fling-scroll on tap-down. So explicitly send an
506 // event to stop any in-progress flings. 506 // event to stop any in-progress flings.
507 blink::WebGestureEvent fling_cancel = gesture; 507 blink::WebGestureEvent fling_cancel = gesture;
508 fling_cancel.type = blink::WebInputEvent::GestureFlingCancel; 508 fling_cancel.setType(blink::WebInputEvent::GestureFlingCancel);
509 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen; 509 fling_cancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
510 if (ShouldRouteEvent(event)) { 510 if (ShouldRouteEvent(event)) {
511 host_->delegate()->GetInputEventRouter()->RouteGestureEvent( 511 host_->delegate()->GetInputEventRouter()->RouteGestureEvent(
512 host_view_, &fling_cancel, 512 host_view_, &fling_cancel,
513 ui::LatencyInfo(ui::SourceEventType::TOUCH)); 513 ui::LatencyInfo(ui::SourceEventType::TOUCH));
514 } else { 514 } else {
515 host_->ForwardGestureEvent(fling_cancel); 515 host_->ForwardGestureEvent(fling_cancel);
516 } 516 }
517 } 517 }
518 518
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 host_->ForwardWheelEventWithLatencyInfo(event, latency); 864 host_->ForwardWheelEventWithLatencyInfo(event, latency);
865 } 865 }
866 866
867 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( 867 void RenderWidgetHostViewEventHandler::ProcessTouchEvent(
868 const blink::WebTouchEvent& event, 868 const blink::WebTouchEvent& event,
869 const ui::LatencyInfo& latency) { 869 const ui::LatencyInfo& latency) {
870 host_->ForwardTouchEventWithLatencyInfo(event, latency); 870 host_->ForwardTouchEventWithLatencyInfo(event, latency);
871 } 871 }
872 872
873 } // namespace content 873 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698