| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // PointerEventManager. If it was the second touch there is a | 280 // PointerEventManager. If it was the second touch there is a |
| 281 // capturing documents for the touch and |m_touchSequenceDocument| | 281 // capturing documents for the touch and |m_touchSequenceDocument| |
| 282 // is not null. So if PointerEventManager should hit-test again | 282 // is not null. So if PointerEventManager should hit-test again |
| 283 // against |m_touchSequenceDocument| if the target set by | 283 // against |m_touchSequenceDocument| if the target set by |
| 284 // PointerEventManager was either null or not in | 284 // PointerEventManager was either null or not in |
| 285 // |m_touchSequenceDocument|. | 285 // |m_touchSequenceDocument|. |
| 286 if (m_touchSequenceDocument && | 286 if (m_touchSequenceDocument && |
| 287 (!touchInfo.touchNode || | 287 (!touchInfo.touchNode || |
| 288 &touchInfo.touchNode->document() != m_touchSequenceDocument)) { | 288 &touchInfo.touchNode->document() != m_touchSequenceDocument)) { |
| 289 if (m_touchSequenceDocument->frame()) { | 289 if (m_touchSequenceDocument->frame()) { |
| 290 LayoutPoint framePoint = roundedLayoutPoint( | 290 LayoutPoint framePoint = LayoutPoint( |
| 291 m_touchSequenceDocument->frame()->view()->rootFrameToContents( | 291 m_touchSequenceDocument->frame()->view()->rootFrameToContents( |
| 292 touchInfo.point.pos())); | 292 touchInfo.point.pos())); |
| 293 result = EventHandlingUtil::hitTestResultInFrame( | 293 result = EventHandlingUtil::hitTestResultInFrame( |
| 294 m_touchSequenceDocument->frame(), framePoint, hitType); | 294 m_touchSequenceDocument->frame(), framePoint, hitType); |
| 295 Node* node = result.innerNode(); | 295 Node* node = result.innerNode(); |
| 296 if (!node) | 296 if (!node) |
| 297 continue; | 297 continue; |
| 298 if (isHTMLCanvasElement(node)) { | 298 if (isHTMLCanvasElement(node)) { |
| 299 HitTestCanvasResult* hitTestCanvasResult = | 299 HitTestCanvasResult* hitTestCanvasResult = |
| 300 toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists( | 300 toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists( |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } | 491 } |
| 492 | 492 |
| 493 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); | 493 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); |
| 494 } | 494 } |
| 495 | 495 |
| 496 bool TouchEventManager::isAnyTouchActive() const { | 496 bool TouchEventManager::isAnyTouchActive() const { |
| 497 return m_touchPressed; | 497 return m_touchPressed; |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace blink | 500 } // namespace blink |
| OLD | NEW |