Chromium Code Reviews| 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 and isn't an ac tive fling animation. | |
|
tdresser
2016/05/13 13:42:21
Report the touch disposition, split by whether the
lanwei
2016/05/13 18:15:48
Done.
| |
| 256 if (event.type() == PlatformEvent::TouchStart) { | |
| 257 if (event.dispatchedDuringFling()) { | |
| 258 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositi onsDuringFlingHistogram, ("Event.Touch.TouchDispositionsDuringFling", TouchEvent DispatchResultTypeMax)); | |
| 259 touchDispositionsDuringFlingHistogram.count((domDispatch Result != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches) ; | |
| 260 } else { | |
| 261 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositi onsNoFlingHistogram, ("Event.Touch.TouchDispositionsNoFling", TouchEventDispatch ResultTypeMax)); | |
| 262 touchDispositionsNoFlingHistogram.count((domDispatchResu lt != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); | |
| 263 } | |
| 264 } | |
| 254 } | 265 } |
| 255 eventResult = EventHandler::mergeEventResult(eventResult, | 266 eventResult = EventHandler::mergeEventResult(eventResult, |
| 256 EventHandler::toWebInputEventResult(domDispatchResult)); | 267 EventHandler::toWebInputEventResult(domDispatchResult)); |
| 257 } | 268 } |
| 258 } | 269 } |
| 259 return eventResult; | 270 return eventResult; |
| 260 } | 271 } |
| 261 | 272 |
| 262 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( | 273 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( |
| 263 HeapVector<TouchInfo>& touchInfos) | 274 HeapVector<TouchInfo>& touchInfos) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 } | 515 } |
| 505 | 516 |
| 506 DEFINE_TRACE(TouchEventManager) | 517 DEFINE_TRACE(TouchEventManager) |
| 507 { | 518 { |
| 508 visitor->trace(m_frame); | 519 visitor->trace(m_frame); |
| 509 visitor->trace(m_touchSequenceDocument); | 520 visitor->trace(m_touchSequenceDocument); |
| 510 visitor->trace(m_targetForTouchID); | 521 visitor->trace(m_targetForTouchID); |
| 511 } | 522 } |
| 512 | 523 |
| 513 } // namespace blink | 524 } // namespace blink |
| OLD | NEW |