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

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

Issue 2317253005: SourceEventType added to LatencyInfo (Closed)
Patch Set: Added a fake return to the end of EventTypeToLatencySourceEventType, for compilers that don't know … Created 4 years, 3 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 9ab4d9f79feb40c73ad95890fcc119b4f417c1de..3d71e22532d640f4f65e849d0dd4ad61b409b6fc 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"
@@ -955,7 +956,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);
}
@@ -984,7 +986,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(
@@ -1011,7 +1014,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(
@@ -1048,7 +1054,9 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
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.
@@ -1062,15 +1070,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);
}
@@ -1159,8 +1169,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