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

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

Issue 2393783005: re-land the "SourceEventType added to LatencyInfo." (Closed)
Patch Set: Created 4 years, 2 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/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 6a05961dcff5ac66b2c4ec910de6dcdf15082787..ce1aa4eca539acf6059328e5262b0b556d1d389a 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -74,6 +74,7 @@
#include "skia/ext/image_operations.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
+#include "ui/events/blink/web_input_event_traits.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/color_space.h"
@@ -957,7 +958,8 @@ void RenderWidgetHostImpl::OnFirstPaintAfterLoad() {
}
void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
- ForwardMouseEventWithLatencyInfo(mouse_event, ui::LatencyInfo());
+ ForwardMouseEventWithLatencyInfo(mouse_event,
+ ui::LatencyInfo(ui::SourceEventType::OTHER));
if (owner_delegate_)
owner_delegate_->RenderWidgetDidForwardMouseEvent(mouse_event);
}
@@ -986,7 +988,8 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo(
void RenderWidgetHostImpl::ForwardWheelEvent(
const WebMouseWheelEvent& wheel_event) {
- ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo());
+ ForwardWheelEventWithLatencyInfo(wheel_event,
+ ui::LatencyInfo(ui::SourceEventType::WHEEL));
}
void RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo(
@@ -1013,7 +1016,10 @@ void RenderWidgetHostImpl::ForwardEmulatedGestureEvent(
void RenderWidgetHostImpl::ForwardGestureEvent(
const blink::WebGestureEvent& gesture_event) {
- ForwardGestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo());
+ ForwardGestureEventWithLatencyInfo(
+ gesture_event,
+ ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(
+ gesture_event));
}
void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
@@ -1052,7 +1058,9 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
// Bubble to test the resending logic of gesture events.
if (scroll_update_needs_wrapping) {
ForwardGestureEventWithLatencyInfo(
- CreateScrollBeginForWrapping(gesture_event), ui::LatencyInfo());
+ CreateScrollBeginForWrapping(gesture_event),
+ ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(
+ gesture_event));
}
// Delegate must be non-null, due to |ShouldDropInputEvents()| test.
@@ -1066,15 +1074,17 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
if (scroll_update_needs_wrapping) {
ForwardGestureEventWithLatencyInfo(
- CreateScrollEndForWrapping(gesture_event), ui::LatencyInfo());
+ CreateScrollEndForWrapping(gesture_event),
+ ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(
+ gesture_event));
}
}
void RenderWidgetHostImpl::ForwardEmulatedTouchEvent(
const blink::WebTouchEvent& touch_event) {
TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardEmulatedTouchEvent");
-
- TouchEventWithLatencyInfo touch_with_latency(touch_event);
+ ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH);
+ TouchEventWithLatencyInfo touch_with_latency(touch_event, latency_info);
DispatchInputEventWithLatencyInfo(touch_event, &touch_with_latency.latency);
input_router_->SendTouchEvent(touch_with_latency);
}
@@ -1163,8 +1173,9 @@ void RenderWidgetHostImpl::ForwardKeyboardEvent(
if (touch_emulator_ && touch_emulator_->HandleKeyboardEvent(key_event))
return;
-
- NativeWebKeyboardEventWithLatencyInfo key_event_with_latency(key_event);
+ ui::LatencyInfo latency_info(ui::SourceEventType::OTHER);
+ NativeWebKeyboardEventWithLatencyInfo key_event_with_latency(key_event,
+ latency_info);
key_event_with_latency.event.isBrowserShortcut = is_shortcut;
DispatchInputEventWithLatencyInfo(key_event, &key_event_with_latency.latency);
input_router_->SendKeyboardEvent(key_event_with_latency);

Powered by Google App Engine
This is Rietveld 408576698