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

Unified Diff: content/browser/renderer_host/input/synthetic_gesture_target_base.cc

Issue 134123003: Generate proper LatencyInfo components for synthetic gestures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove InputEvent forward decl Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/synthetic_gesture_target_base.cc
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
index 0938eebb64978e2dec98d61d065625d0b9460b2c..4c90c144ebf57f97733d03aabfca7dd349a6ab76 100644
--- a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
+++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
@@ -7,7 +7,6 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/renderer_host/ui_events_helper.h"
-#include "content/common/input/input_event.h"
#include "content/common/input_messages.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/events/event.h"
@@ -42,29 +41,31 @@ SyntheticGestureTargetBase::~SyntheticGestureTargetBase() {
}
void SyntheticGestureTargetBase::DispatchInputEventToPlatform(
- const InputEvent& event) {
- const WebInputEvent* web_event = event.web_event.get();
- if (WebInputEvent::isTouchEventType(web_event->type)) {
+ const WebInputEvent& event) {
+ ui::LatencyInfo latency_info;
+ latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
+
+ if (WebInputEvent::isTouchEventType(event.type)) {
DCHECK(SupportsSyntheticGestureSourceType(
SyntheticGestureParams::TOUCH_INPUT));
- const WebTouchEvent* web_touch =
- static_cast<const WebTouchEvent*>(web_event);
- DispatchWebTouchEventToPlatform(*web_touch, event.latency_info);
- } else if (web_event->type == WebInputEvent::MouseWheel) {
+ const WebTouchEvent& web_touch =
+ static_cast<const WebTouchEvent&>(event);
+ DispatchWebTouchEventToPlatform(web_touch, latency_info);
+ } else if (event.type == WebInputEvent::MouseWheel) {
DCHECK(SupportsSyntheticGestureSourceType(
SyntheticGestureParams::MOUSE_INPUT));
- const WebMouseWheelEvent* web_wheel =
- static_cast<const WebMouseWheelEvent*>(web_event);
- DispatchWebMouseWheelEventToPlatform(*web_wheel, event.latency_info);
- } else if (WebInputEvent::isMouseEventType(web_event->type)) {
+ const WebMouseWheelEvent& web_wheel =
+ static_cast<const WebMouseWheelEvent&>(event);
+ DispatchWebMouseWheelEventToPlatform(web_wheel, latency_info);
+ } else if (WebInputEvent::isMouseEventType(event.type)) {
DCHECK(SupportsSyntheticGestureSourceType(
SyntheticGestureParams::MOUSE_INPUT));
- const WebMouseEvent* web_mouse =
- static_cast<const WebMouseEvent*>(web_event);
- DispatchWebMouseEventToPlatform(*web_mouse, event.latency_info);
+ const WebMouseEvent& web_mouse =
+ static_cast<const WebMouseEvent&>(event);
+ DispatchWebMouseEventToPlatform(web_mouse, latency_info);
} else {
NOTREACHED();
}

Powered by Google App Engine
This is Rietveld 408576698