Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
| diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| index 442b6da650562e5c4ac8773c60e462ed47e5999a..f050d3854a1568ece978908c14b9691a0b7a45a4 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -256,6 +256,12 @@ TouchTargetAndDispatchResultType toTouchTargetHistogramValue(EventTarget* eventT |
| return static_cast<TouchTargetAndDispatchResultType>(result); |
| } |
| +enum TouchEventDispatchResultType { |
| + NotHandledTouches, // Not handled touch events. |
|
Ilya Sherman
2016/04/26 20:27:11
"Not handled events" -- does that mean "Unhandled
lanwei
2016/04/27 04:43:30
Done.
|
| + HandledTouches, // Handled touch events. |
| + TouchEventDispatchResultTypeMax, |
| +}; |
| + |
| } // namespace |
| using namespace HTMLNames; |
| @@ -3893,11 +3899,19 @@ WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent& |
| if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.cancelable() && !m_frame->document()->ownerElement()) { |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax)); |
| rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult)); |
| + |
| + // Count the canceled touch starts and first touch moves before and after page finishes loading respectively. |
| + if (m_frame->document()->isLoadCompleted()) { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCanceledAfterPageLoadHistogram, ("Event.Touch.TouchesCanceledAfterPageLoad", TouchEventDispatchResultTypeMax)); |
| + touchesCanceledAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches); |
| + } else { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCanceledBeforePageLoadHistogram, ("Event.Touch.TouchesCanceledBeforePageLoad", TouchEventDispatchResultTypeMax)); |
| + touchesCanceledBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches); |
| + } |
| } |
| eventResult = mergeEventResult(eventResult, toWebInputEventResult(domDispatchResult)); |
| } |
| } |
| - |
| return eventResult; |
| } |