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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 1965313003: Fix Renderer4.MainThreadWheelScrollReason not being reported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ui/events/blink/input_handler_proxy.h ('k') | ui/events/blink/input_handler_proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index fb9f9cad7fc391e4195af4b0cf5172ffd2b80c46..e31a7dab47b773ab4318a8841c68d4fe021f1af9 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -385,23 +385,23 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
}
void InputHandlerProxy::RecordMainThreadScrollingReasons(
- WebInputEvent::Type type,
+ blink::WebGestureDevice device,
uint32_t reasons) {
static const char* kGestureHistogramName =
"Renderer4.MainThreadGestureScrollReason";
static const char* kWheelHistogramName =
"Renderer4.MainThreadWheelScrollReason";
- DCHECK(type == WebInputEvent::GestureScrollBegin ||
- type == WebInputEvent::MouseWheel);
+ DCHECK(device == blink::WebGestureDeviceTouchpad ||
+ device == blink::WebGestureDeviceTouchscreen);
- if (type != WebInputEvent::GestureScrollBegin &&
- type != WebInputEvent::MouseWheel) {
+ if (device != blink::WebGestureDeviceTouchpad &&
+ device != blink::WebGestureDeviceTouchscreen) {
return;
}
if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
- if (type == WebInputEvent::GestureScrollBegin) {
+ if (device == blink::WebGestureDeviceTouchscreen) {
UMA_HISTOGRAM_ENUMERATION(
kGestureHistogramName,
cc::MainThreadScrollingReason::kNotScrollingOnMain,
@@ -419,7 +419,7 @@ void InputHandlerProxy::RecordMainThreadScrollingReasons(
++i) {
unsigned val = 1 << i;
if (reasons & val) {
- if (type == WebInputEvent::GestureScrollBegin) {
+ if (device == blink::WebGestureDeviceTouchscreen) {
UMA_HISTOGRAM_ENUMERATION(
kGestureHistogramName, i + 1,
cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount);
@@ -488,7 +488,8 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
// thread, so punt it to the main thread. http://crbug.com/236639
result = DID_NOT_HANDLE;
RecordMainThreadScrollingReasons(
- wheel_event.type, cc::MainThreadScrollingReason::kPageBasedScrolling);
+ blink::WebGestureDeviceTouchpad,
+ cc::MainThreadScrollingReason::kPageBasedScrolling);
} else if (!wheel_event.canScroll) {
// Wheel events with |canScroll| == false will not trigger scrolling,
@@ -500,7 +501,8 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
scroll_delta);
RecordMainThreadScrollingReasons(
- wheel_event.type, scroll_status.main_thread_scrolling_reasons);
+ blink::WebGestureDeviceTouchpad,
+ scroll_status.main_thread_scrolling_reasons);
switch (scroll_status.thread) {
case cc::InputHandler::SCROLL_ON_IMPL_THREAD:
@@ -523,7 +525,8 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
&scroll_state_begin, cc::InputHandler::WHEEL);
RecordMainThreadScrollingReasons(
- wheel_event.type, scroll_status.main_thread_scrolling_reasons);
+ blink::WebGestureDeviceTouchpad,
+ scroll_status.main_thread_scrolling_reasons);
switch (scroll_status.thread) {
case cc::InputHandler::SCROLL_ON_IMPL_THREAD: {
@@ -613,7 +616,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
scroll_status.thread,
cc::InputHandler::LAST_SCROLL_STATUS + 1);
- RecordMainThreadScrollingReasons(gesture_event.type,
+ RecordMainThreadScrollingReasons(gesture_event.sourceDevice,
scroll_status.main_thread_scrolling_reasons);
InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE;
« no previous file with comments | « ui/events/blink/input_handler_proxy.h ('k') | ui/events/blink/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698