| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 PlatformTouchPoint::TouchState pointState = point.state(); | 170 PlatformTouchPoint::TouchState pointState = point.state(); |
| 171 | 171 |
| 172 if (touchInfo.consumed) | 172 if (touchInfo.consumed) |
| 173 continue; | 173 continue; |
| 174 | 174 |
| 175 Touch* touch = Touch::create( | 175 Touch* touch = Touch::create( |
| 176 touchInfo.targetFrame.get(), | 176 touchInfo.targetFrame.get(), |
| 177 touchInfo.touchNode.get(), | 177 touchInfo.touchNode.get(), |
| 178 point.id(), | 178 point.id(), |
| 179 point.screenPos(), | 179 point.screenPos(), |
| 180 touchInfo.adjustedPagePoint, | 180 touchInfo.contentPoint, |
| 181 touchInfo.adjustedRadius, | 181 touchInfo.adjustedRadius, |
| 182 point.rotationAngle(), | 182 point.rotationAngle(), |
| 183 point.force(), | 183 point.force(), |
| 184 touchInfo.region); | 184 touchInfo.region); |
| 185 | 185 |
| 186 // Ensure this target's touch list exists, even if it ends up empty, so | 186 // Ensure this target's touch list exists, even if it ends up empty, so |
| 187 // it can always be passed to TouchEvent::Create below. | 187 // it can always be passed to TouchEvent::Create below. |
| 188 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f
ind(touchInfo.touchNode.get()); | 188 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f
ind(touchInfo.touchNode.get()); |
| 189 if (targetTouchesIterator == touchesByTarget.end()) { | 189 if (targetTouchesIterator == touchesByTarget.end()) { |
| 190 touchesByTarget.set(touchInfo.touchNode.get(), TouchList::create()); | 190 touchesByTarget.set(touchInfo.touchNode.get(), TouchList::create()); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 ASSERT(targetFrame); | 375 ASSERT(targetFrame); |
| 376 | 376 |
| 377 // pagePoint should always be in the target element's document coordinat
es. | 377 // pagePoint should always be in the target element's document coordinat
es. |
| 378 FloatPoint pagePoint = targetFrame->view()->rootFrameToContents( | 378 FloatPoint pagePoint = targetFrame->view()->rootFrameToContents( |
| 379 touchInfo.point.pos()); | 379 touchInfo.point.pos()); |
| 380 float scaleFactor = 1.0f / targetFrame->pageZoomFactor(); | 380 float scaleFactor = 1.0f / targetFrame->pageZoomFactor(); |
| 381 | 381 |
| 382 touchInfo.touchNode = touchNode; | 382 touchInfo.touchNode = touchNode; |
| 383 touchInfo.targetFrame = targetFrame; | 383 touchInfo.targetFrame = targetFrame; |
| 384 touchInfo.adjustedPagePoint = pagePoint.scaledBy(scaleFactor); | 384 touchInfo.contentPoint = pagePoint.scaledBy(scaleFactor); |
| 385 touchInfo.adjustedRadius = touchInfo.point.radius().scaledBy(scaleFactor
); | 385 touchInfo.adjustedRadius = touchInfo.point.radius().scaledBy(scaleFactor
); |
| 386 touchInfo.knownTarget = knownTarget; | 386 touchInfo.knownTarget = knownTarget; |
| 387 touchInfo.consumed = false; | 387 touchInfo.consumed = false; |
| 388 touchInfo.region = regionID; | 388 touchInfo.region = regionID; |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 bool TouchEventManager::generateTouchInfosAfterHittest( | 392 bool TouchEventManager::generateTouchInfosAfterHittest( |
| 393 const PlatformTouchEvent& event, | 393 const PlatformTouchEvent& event, |
| 394 HeapVector<TouchInfo>& touchInfos) | 394 HeapVector<TouchInfo>& touchInfos) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 } | 504 } |
| 505 | 505 |
| 506 DEFINE_TRACE(TouchEventManager) | 506 DEFINE_TRACE(TouchEventManager) |
| 507 { | 507 { |
| 508 visitor->trace(m_frame); | 508 visitor->trace(m_frame); |
| 509 visitor->trace(m_touchSequenceDocument); | 509 visitor->trace(m_touchSequenceDocument); |
| 510 visitor->trace(m_targetForTouchID); | 510 visitor->trace(m_targetForTouchID); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace blink | 513 } // namespace blink |
| OLD | NEW |