Commit 49a2a2e2 authored by Hayley Ferr's avatar Hayley Ferr Committed by Commit Bot

Histogram for gesture events being dropped based on allowed touch action.

Added an UMA_HISTOGRAM_BOOLEAN to report how often a gesture event is
or is not dropped based on the current touch action state not
matching the gesture event.

Bug: 745718
Change-Id: Ib1c9f91cfcaa846f3e8bba9a7b1c87f698b2a962
Reviewed-on: https://chromium-review.googlesource.com/575071
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488296}
parent b51a81e4
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <math.h> #include <math.h>
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "third_party/WebKit/public/platform/WebGestureEvent.h" #include "third_party/WebKit/public/platform/WebGestureEvent.h"
using blink::WebInputEvent; using blink::WebInputEvent;
...@@ -25,6 +26,12 @@ bool IsXAxisActionDisallowed(cc::TouchAction action) { ...@@ -25,6 +26,12 @@ bool IsXAxisActionDisallowed(cc::TouchAction action) {
return (action & cc::kTouchActionPanY) && !(action & cc::kTouchActionPanX); return (action & cc::kTouchActionPanY) && !(action & cc::kTouchActionPanX);
} }
// Report how often the gesture event is or is not dropped due to the current
// allowed touch action state not matching the gesture event.
void ReportGestureEventFiltered(bool event_filtered) {
UMA_HISTOGRAM_BOOLEAN("TouchAction.GestureEventFiltered", event_filtered);
}
} // namespace } // namespace
TouchActionFilter::TouchActionFilter() TouchActionFilter::TouchActionFilter()
...@@ -69,6 +76,7 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) { ...@@ -69,6 +76,7 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) {
break; break;
case WebInputEvent::kGestureFlingStart: case WebInputEvent::kGestureFlingStart:
ReportGestureEventFiltered(suppress_manipulation_events_);
// Touchscreen flings should always have non-zero velocity. // Touchscreen flings should always have non-zero velocity.
DCHECK(gesture_event->data.fling_start.velocity_x || DCHECK(gesture_event->data.fling_start.velocity_x ||
gesture_event->data.fling_start.velocity_y); gesture_event->data.fling_start.velocity_y);
...@@ -89,11 +97,13 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) { ...@@ -89,11 +97,13 @@ bool TouchActionFilter::FilterGestureEvent(WebGestureEvent* gesture_event) {
return FilterManipulationEventAndResetState(); return FilterManipulationEventAndResetState();
case WebInputEvent::kGestureScrollEnd: case WebInputEvent::kGestureScrollEnd:
ReportGestureEventFiltered(suppress_manipulation_events_);
return FilterManipulationEventAndResetState(); return FilterManipulationEventAndResetState();
case WebInputEvent::kGesturePinchBegin: case WebInputEvent::kGesturePinchBegin:
case WebInputEvent::kGesturePinchUpdate: case WebInputEvent::kGesturePinchUpdate:
case WebInputEvent::kGesturePinchEnd: case WebInputEvent::kGesturePinchEnd:
ReportGestureEventFiltered(suppress_manipulation_events_);
return suppress_manipulation_events_; return suppress_manipulation_events_;
// The double tap gesture is a tap ending event. If a double tap gesture is // The double tap gesture is a tap ending event. If a double tap gesture is
......
...@@ -36968,6 +36968,11 @@ from previous Chrome versions. ...@@ -36968,6 +36968,11 @@ from previous Chrome versions.
<int value="3" label="Disabled"/> <int value="3" label="Disabled"/>
</enum> </enum>
<enum name="TouchGestureEventFiltered">
<int value="0" label="Touch gesture event not filtered"/>
<int value="1" label="Touch gesture event filtered"/>
</enum>
<enum name="TouchpadDeviceState"> <enum name="TouchpadDeviceState">
<int value="0" label="NO_TP_PRESENT_NO_TP_EXPECTED"> <int value="0" label="NO_TP_PRESENT_NO_TP_EXPECTED">
No touchpad detected on a device without built-in touchpad No touchpad detected on a device without built-in touchpad
...@@ -80413,6 +80413,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -80413,6 +80413,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="TouchAction.GestureEventFiltered"
enum="TouchGestureEventFiltered">
<owner>hayleyferr@chromium.org</owner>
<owner>xidachen@chromium.org</owner>
<summary>
Tracks how often a gesture event is or is not dropped due to the current
allowed touch action state not matching the gesture event.
</summary>
</histogram>
<histogram name="TouchBar.Default.Metrics" enum="DefaultTouchBarActions"> <histogram name="TouchBar.Default.Metrics" enum="DefaultTouchBarActions">
<owner>spqchan@chromium.com</owner> <owner>spqchan@chromium.com</owner>
<summary>Tracks the usage of the default touch bar buttons.</summary> <summary>Tracks the usage of the default touch bar buttons.</summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment