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/Deprecation.h" | 9 #include "core/frame/Deprecation.h" |
| 10 #include "core/frame/EventHandlerRegistry.h" | 10 #include "core/frame/EventHandlerRegistry.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 ? HandledTouches | 285 ? HandledTouches |
| 286 : UnhandledTouches); | 286 : UnhandledTouches); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 eventResult = EventHandlingUtil::mergeEventResult( | 289 eventResult = EventHandlingUtil::mergeEventResult( |
| 290 eventResult, | 290 eventResult, |
| 291 EventHandlingUtil::toWebInputEventResult(domDispatchResult)); | 291 EventHandlingUtil::toWebInputEventResult(domDispatchResult)); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 // Do not suppress any touchmoves if the touchstart is consumed. | |
|
Rick Byers
2017/02/16 21:21:57
nit: it seems like it would be a small clean-up to
mustaq
2017/02/16 21:41:26
The "true" value is used in Line 138, so we have t
Rick Byers
2017/02/16 22:09:19
But it's used only if we're currently processing a
lanwei
2017/02/17 15:11:17
Acknowledged.
Yes, we can merge line 131 here, tha
| |
| 296 if (m_suppressingTouchmovesWithinSlop && | |
| 297 event.type() == WebInputEvent::TouchStart && | |
| 298 eventResult != WebInputEventResult::NotHandled) { | |
| 299 m_suppressingTouchmovesWithinSlop = false; | |
| 300 } | |
| 301 | |
| 295 return eventResult; | 302 return eventResult; |
| 296 } | 303 } |
| 297 | 304 |
| 298 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( | 305 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( |
| 299 HeapVector<TouchInfo>& touchInfos) { | 306 HeapVector<TouchInfo>& touchInfos) { |
| 300 for (auto& touchInfo : touchInfos) { | 307 for (auto& touchInfo : touchInfos) { |
| 301 // Touch events implicitly capture to the touched node, and don't change | 308 // Touch events implicitly capture to the touched node, and don't change |
| 302 // active/hover states themselves (Gesture events do). So we only need | 309 // active/hover states themselves (Gesture events do). So we only need |
| 303 // to hit-test on touchstart and when the target could be different than | 310 // to hit-test on touchstart and when the target could be different than |
| 304 // the corresponding pointer event target. | 311 // the corresponding pointer event target. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 } | 519 } |
| 513 | 520 |
| 514 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); | 521 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); |
| 515 } | 522 } |
| 516 | 523 |
| 517 bool TouchEventManager::isAnyTouchActive() const { | 524 bool TouchEventManager::isAnyTouchActive() const { |
| 518 return m_touchPressed; | 525 return m_touchPressed; |
| 519 } | 526 } |
| 520 | 527 |
| 521 } // namespace blink | 528 } // namespace blink |
| OLD | NEW |