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

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

Issue 2317253005: SourceEventType added to LatencyInfo (Closed)
Patch Set: Used a switch-case to set the SourceEventType in latencyInfo. 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_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index b90a8cf51421d8b01c9d85ce23ad6f8fff351b20..9b4530328e8e866dc94314b5ae4ee11261f338d0 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -82,6 +82,7 @@
#include "ui/display/screen.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/blink/did_overscroll_params.h"
+#include "ui/events/blink/web_input_event_traits.h"
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
#include "ui/events/gesture_detection/motion_event.h"
#include "ui/gfx/android/device_display_info.h"
@@ -697,7 +698,7 @@ bool RenderWidgetHostViewAndroid::OnTouchEvent(
blink::WebTouchEvent web_event = ui::CreateWebTouchEventFromMotionEvent(
event, result.moved_beyond_slop_region);
- ui::LatencyInfo latency_info;
+ ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH);
latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
host_->ForwardTouchEventWithLatencyInfo(web_event, latency_info);
@@ -730,9 +731,11 @@ void RenderWidgetHostViewAndroid::ResetGestureDetection() {
std::unique_ptr<ui::MotionEvent> cancel_event = current_down_event->Cancel();
if (gesture_provider_.OnTouchEvent(*cancel_event).succeeded) {
bool causes_scrolling = false;
+ ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH);
+ latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
host_->ForwardTouchEventWithLatencyInfo(
ui::CreateWebTouchEventFromMotionEvent(*cancel_event, causes_scrolling),
- ui::LatencyInfo());
+ latency_info);
}
}
@@ -1505,7 +1508,7 @@ void RenderWidgetHostViewAndroid::SendMouseEvent(
void RenderWidgetHostViewAndroid::SendMouseWheelEvent(
const blink::WebMouseWheelEvent& event) {
if (host_) {
- ui::LatencyInfo latency_info;
+ ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL);
latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
host_->ForwardWheelEventWithLatencyInfo(event, latency_info);
}
@@ -1517,8 +1520,11 @@ void RenderWidgetHostViewAndroid::SendGestureEvent(
if (overscroll_controller_)
overscroll_controller_->Enable();
- if (host_)
- host_->ForwardGestureEventWithLatencyInfo(event, ui::LatencyInfo());
+ if (host_) {
+ ui::LatencyInfo latency_info =
+ ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(event);
+ host_->ForwardGestureEventWithLatencyInfo(event, latency_info);
+ }
}
void RenderWidgetHostViewAndroid::MoveCaret(const gfx::Point& point) {

Powered by Google App Engine
This is Rietveld 408576698