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

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

Issue 134683003: [Android] Provide touch and gesture system timestamps for LatencyInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64edead900919062273824bdf24593f586479459..17c4cceb5769ed44f3658dca01f384554e828899 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -110,6 +110,23 @@ bool UsingDelegatedRenderer() {
return using_delegated_renderer;
}
+ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent event) {
+ ui::LatencyInfo latency_info;
+ // The latency number should only be added if the timestamp is valid.
+ if (event.timeStampSeconds) {
+ const int64 time_micros = static_cast<int64>(
+ event.timeStampSeconds * base::Time::kMicrosecondsPerSecond);
+ latency_info.AddLatencyNumberWithTimestamp(
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
+ 0,
+ 0,
+ base::TimeTicks() + base::TimeDelta::FromMicroseconds(time_micros),
+ 1,
+ false);
+ }
+ return latency_info;
+}
+
} // anonymous namespace
RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
@@ -1178,7 +1195,7 @@ void RenderWidgetHostViewAndroid::SendKeyEvent(
void RenderWidgetHostViewAndroid::SendTouchEvent(
const blink::WebTouchEvent& event) {
if (host_)
- host_->ForwardTouchEventWithLatencyInfo(event, ui::LatencyInfo());
+ host_->ForwardTouchEventWithLatencyInfo(event, CreateLatencyInfo(event));
}
@@ -1201,7 +1218,7 @@ void RenderWidgetHostViewAndroid::SendGestureEvent(
overscroll_effect_->Enable();
if (host_)
- host_->ForwardGestureEvent(event);
+ host_->ForwardGestureEventWithLatencyInfo(event, CreateLatencyInfo(event));
}
void RenderWidgetHostViewAndroid::SelectRange(const gfx::Point& start,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698