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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_event_handler.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Fix test issue Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
6 6
7 #include "base/metrics/user_metrics.h" 7 #include "base/metrics/user_metrics.h"
8 #include "base/metrics/user_metrics_action.h" 8 #include "base/metrics/user_metrics_action.h"
9 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h" 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h"
10 #include "content/browser/renderer_host/overscroll_controller.h" 10 #include "content/browser/renderer_host/overscroll_controller.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // Accept return key character events between press and release events. 277 // Accept return key character events between press and release events.
278 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; 278 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED;
279 } 279 }
280 280
281 // Call SetKeyboardFocus() for not only ET_KEY_PRESSED but also 281 // Call SetKeyboardFocus() for not only ET_KEY_PRESSED but also
282 // ET_KEY_RELEASED. If a user closed the hotdog menu with ESC key press, 282 // ET_KEY_RELEASED. If a user closed the hotdog menu with ESC key press,
283 // we need to notify focus to Blink on ET_KEY_RELEASED for ESC key. 283 // we need to notify focus to Blink on ET_KEY_RELEASED for ESC key.
284 SetKeyboardFocus(); 284 SetKeyboardFocus();
285 // We don't have to communicate with an input method here. 285 // We don't have to communicate with an input method here.
286 NativeWebKeyboardEvent webkit_event(*event); 286 NativeWebKeyboardEvent webkit_event(*event);
287 delegate_->ForwardKeyboardEvent(webkit_event, &mark_event_as_handled); 287 delegate_->ForwardKeyboardEventWithLatencyInfo(
288 webkit_event, *event->latency(), &mark_event_as_handled);
288 } 289 }
289 if (mark_event_as_handled) 290 if (mark_event_as_handled)
290 event->SetHandled(); 291 event->SetHandled();
291 } 292 }
292 293
293 void RenderWidgetHostViewEventHandler::OnMouseEvent(ui::MouseEvent* event) { 294 void RenderWidgetHostViewEventHandler::OnMouseEvent(ui::MouseEvent* event) {
294 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnMouseEvent"); 295 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnMouseEvent");
295 ForwardMouseEventToParent(event); 296 ForwardMouseEventToParent(event);
296 // TODO(mgiuca): Return if event->handled() returns true. This currently 297 // TODO(mgiuca): Return if event->handled() returns true. This currently
297 // breaks drop-down lists which means something is incorrectly setting 298 // breaks drop-down lists which means something is incorrectly setting
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 host_->ForwardWheelEventWithLatencyInfo(event, latency); 877 host_->ForwardWheelEventWithLatencyInfo(event, latency);
877 } 878 }
878 879
879 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( 880 void RenderWidgetHostViewEventHandler::ProcessTouchEvent(
880 const blink::WebTouchEvent& event, 881 const blink::WebTouchEvent& event,
881 const ui::LatencyInfo& latency) { 882 const ui::LatencyInfo& latency) {
882 host_->ForwardTouchEventWithLatencyInfo(event, latency); 883 host_->ForwardTouchEventWithLatencyInfo(event, latency);
883 } 884 }
884 885
885 } // namespace content 886 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698