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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 if (event->type() == blink::WebInputEvent::MouseWheel) { 601 if (event->type() == blink::WebInputEvent::MouseWheel) {
602 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); 602 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL);
603 host_->ForwardWheelEventWithLatencyInfo( 603 host_->ForwardWheelEventWithLatencyInfo(
604 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); 604 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info);
605 return; 605 return;
606 } 606 }
607 607
608 if (blink::WebInputEvent::isKeyboardEventType(event->type())) { 608 if (blink::WebInputEvent::isKeyboardEventType(event->type())) {
609 if (!embedder->GetLastKeyboardEvent()) 609 if (!embedder->GetLastKeyboardEvent())
610 return; 610 return;
611 ui::LatencyInfo latency_info(ui::SourceEventType::KEY);
611 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); 612 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent());
612 host_->ForwardKeyboardEvent(keyboard_event); 613 host_->ForwardKeyboardEventWithLatencyInfo(keyboard_event, latency_info);
613 return; 614 return;
614 } 615 }
615 616
616 if (blink::WebInputEvent::isTouchEventType(event->type())) { 617 if (blink::WebInputEvent::isTouchEventType(event->type())) {
617 if (event->type() == blink::WebInputEvent::TouchStart && 618 if (event->type() == blink::WebInputEvent::TouchStart &&
618 !embedder->GetView()->HasFocus()) { 619 !embedder->GetView()->HasFocus()) {
619 embedder->GetView()->Focus(); 620 embedder->GetView()->Focus();
620 } 621 }
621 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); 622 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH);
622 host_->ForwardTouchEventWithLatencyInfo( 623 host_->ForwardTouchEventWithLatencyInfo(
(...skipping 21 matching lines...) Expand all
644 host_->ForwardGestureEvent(gesture_event); 645 host_->ForwardGestureEvent(gesture_event);
645 return; 646 return;
646 } 647 }
647 } 648 }
648 649
649 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { 650 bool RenderWidgetHostViewGuest::HasEmbedderChanged() {
650 return guest_ && guest_->has_attached_since_surface_set(); 651 return guest_ && guest_->has_attached_since_surface_set();
651 } 652 }
652 653
653 } // namespace content 654 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698