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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 1729
1730 RenderWidgetHostImpl* target_host = host_; 1730 RenderWidgetHostImpl* target_host = host_;
1731 1731
1732 // If there are multiple widgets on the page (such as when there are 1732 // If there are multiple widgets on the page (such as when there are
1733 // out-of-process iframes), pick the one that should process this event. 1733 // out-of-process iframes), pick the one that should process this event.
1734 if (host_->delegate()) 1734 if (host_->delegate())
1735 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_); 1735 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_);
1736 if (!target_host) 1736 if (!target_host)
1737 return; 1737 return;
1738 1738
1739 target_host->ForwardKeyboardEvent(event); 1739 ui::LatencyInfo latency_info;
1740 if (event.GetType() == blink::WebInputEvent::kRawKeyDown ||
1741 event.GetType() == blink::WebInputEvent::kChar) {
1742 latency_info.set_source_event_type(ui::SourceEventType::KEY_PRESS);
1743 }
1744 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
1745 target_host->ForwardKeyboardEventWithLatencyInfo(event, latency_info);
1740 } 1746 }
1741 1747
1742 void RenderWidgetHostViewAndroid::SendMouseEvent( 1748 void RenderWidgetHostViewAndroid::SendMouseEvent(
1743 const ui::MotionEventAndroid& motion_event, 1749 const ui::MotionEventAndroid& motion_event,
1744 int action_button) { 1750 int action_button) {
1745 blink::WebInputEvent::Type webMouseEventType = 1751 blink::WebInputEvent::Type webMouseEventType =
1746 ui::ToWebMouseEventType(motion_event.GetAction()); 1752 ui::ToWebMouseEventType(motion_event.GetAction());
1747 1753
1748 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build( 1754 blink::WebMouseEvent mouse_event = WebMouseEventBuilder::Build(
1749 webMouseEventType, 1755 webMouseEventType,
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 2205
2200 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 2206 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
2201 if (!compositor) 2207 if (!compositor)
2202 return; 2208 return;
2203 2209
2204 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 2210 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
2205 overscroll_refresh_handler, compositor, view_.GetDipScale()); 2211 overscroll_refresh_handler, compositor, view_.GetDipScale());
2206 } 2212 }
2207 2213
2208 } // namespace content 2214 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698