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

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

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Restrict to RawKeyDown and Char events on Android & Mac Created 3 years, 7 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 9dbbf15b744908106d8bad4310cbd3e6d5f87d1c..0e369107c6ce750596ef255c0132159a94eeb823 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1736,7 +1736,13 @@ void RenderWidgetHostViewAndroid::SendKeyEvent(
if (!target_host)
return;
- target_host->ForwardKeyboardEvent(event);
+ ui::LatencyInfo latency_info;
+ if (event.GetType() == blink::WebInputEvent::kRawKeyDown ||
+ event.GetType() == blink::WebInputEvent::kChar) {
+ latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS);
+ }
+ latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
+ target_host->ForwardKeyboardEventWithLatencyInfo(event, latency_info);
}
void RenderWidgetHostViewAndroid::SendMouseEvent(

Powered by Google App Engine
This is Rietveld 408576698