| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/input/TouchEventManager.h" | 5 #include "core/input/TouchEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/events/TouchEvent.h" | 8 #include "core/events/TouchEvent.h" |
| 9 #include "core/frame/EventHandlerRegistry.h" | 9 #include "core/frame/EventHandlerRegistry.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(
eventTarget, domDispatchResult)); | 244 rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(
eventTarget, domDispatchResult)); |
| 245 | 245 |
| 246 // Count the handled touch starts and first touch moves before a
nd after the page is fully loaded respectively. | 246 // Count the handled touch starts and first touch moves before a
nd after the page is fully loaded respectively. |
| 247 if (m_frame->document()->isLoadCompleted()) { | 247 if (m_frame->document()->isLoadCompleted()) { |
| 248 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA
fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent
DispatchResultTypeMax)); | 248 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA
fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent
DispatchResultTypeMax)); |
| 249 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe
sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); | 249 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe
sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| 250 } else { | 250 } else { |
| 251 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB
eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve
ntDispatchResultTypeMax)); | 251 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB
eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve
ntDispatchResultTypeMax)); |
| 252 touchDispositionsBeforePageLoadHistogram.count((domDispatchR
esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); | 252 touchDispositionsBeforePageLoadHistogram.count((domDispatchR
esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| 253 } | 253 } |
| 254 |
| 255 // Count the handled touch starts while there is an active fling
animation. |
| 256 if (event.type() == PlatformEvent::TouchStart && event.shouldFor
ceBePassive()) { |
| 257 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsD
uringFlingHistogram, ("Event.Touch.TouchDispositionsDuringFling", TouchEventDisp
atchResultTypeMax)); |
| 258 touchDispositionsDuringFlingHistogram.count((domDispatchResu
lt != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| 259 } |
| 254 } | 260 } |
| 255 eventResult = EventHandler::mergeEventResult(eventResult, | 261 eventResult = EventHandler::mergeEventResult(eventResult, |
| 256 EventHandler::toWebInputEventResult(domDispatchResult)); | 262 EventHandler::toWebInputEventResult(domDispatchResult)); |
| 257 } | 263 } |
| 258 } | 264 } |
| 259 return eventResult; | 265 return eventResult; |
| 260 } | 266 } |
| 261 | 267 |
| 262 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( | 268 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( |
| 263 HeapVector<TouchInfo>& touchInfos) | 269 HeapVector<TouchInfo>& touchInfos) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 } | 510 } |
| 505 | 511 |
| 506 DEFINE_TRACE(TouchEventManager) | 512 DEFINE_TRACE(TouchEventManager) |
| 507 { | 513 { |
| 508 visitor->trace(m_frame); | 514 visitor->trace(m_frame); |
| 509 visitor->trace(m_touchSequenceDocument); | 515 visitor->trace(m_touchSequenceDocument); |
| 510 visitor->trace(m_targetForTouchID); | 516 visitor->trace(m_targetForTouchID); |
| 511 } | 517 } |
| 512 | 518 |
| 513 } // namespace blink | 519 } // namespace blink |
| OLD | NEW |