| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 TargetTouchesHeapMap touchesByTarget; | 121 TargetTouchesHeapMap touchesByTarget; |
| 122 | 122 |
| 123 // Array of touches per state, used to assemble the |changedTouches| list. | 123 // Array of touches per state, used to assemble the |changedTouches| list. |
| 124 ChangedTouches changedTouches[PlatformTouchPoint::TouchStateEnd]; | 124 ChangedTouches changedTouches[PlatformTouchPoint::TouchStateEnd]; |
| 125 | 125 |
| 126 for (auto touchInfo : touchInfos) { | 126 for (auto touchInfo : touchInfos) { |
| 127 const PlatformTouchPoint& point = touchInfo.point; | 127 const PlatformTouchPoint& point = touchInfo.point; |
| 128 PlatformTouchPoint::TouchState pointState = point.state(); | 128 PlatformTouchPoint::TouchState pointState = point.state(); |
| 129 | 129 |
| 130 Touch* touch = Touch::create( | 130 Touch* touch = Touch::create( |
| 131 touchInfo.targetFrame.get(), touchInfo.touchNode.get(), point.id(), | 131 touchInfo.targetFrame.get(), touchInfo.touchNode.get(), |
| 132 point.screenPos(), touchInfo.contentPoint, touchInfo.adjustedRadius, | 132 point.screenPos(), touchInfo.contentPoint, touchInfo.adjustedRadius, |
| 133 point.rotationAngle(), point.force(), touchInfo.region); | 133 point.rotationAngle(), touchInfo.region, point.pointerProperties()); |
| 134 | 134 |
| 135 // Ensure this target's touch list exists, even if it ends up empty, so | 135 // Ensure this target's touch list exists, even if it ends up empty, so |
| 136 // it can always be passed to TouchEvent::Create below. | 136 // it can always be passed to TouchEvent::Create below. |
| 137 TargetTouchesHeapMap::iterator targetTouchesIterator = | 137 TargetTouchesHeapMap::iterator targetTouchesIterator = |
| 138 touchesByTarget.find(touchInfo.touchNode.get()); | 138 touchesByTarget.find(touchInfo.touchNode.get()); |
| 139 if (targetTouchesIterator == touchesByTarget.end()) { | 139 if (targetTouchesIterator == touchesByTarget.end()) { |
| 140 touchesByTarget.set(touchInfo.touchNode.get(), TouchList::create()); | 140 touchesByTarget.set(touchInfo.touchNode.get(), TouchList::create()); |
| 141 targetTouchesIterator = touchesByTarget.find(touchInfo.touchNode.get()); | 141 targetTouchesIterator = touchesByTarget.find(touchInfo.touchNode.get()); |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 } | 499 } |
| 500 | 500 |
| 501 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); | 501 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); |
| 502 } | 502 } |
| 503 | 503 |
| 504 bool TouchEventManager::isAnyTouchActive() const { | 504 bool TouchEventManager::isAnyTouchActive() const { |
| 505 return m_touchPressed; | 505 return m_touchPressed; |
| 506 } | 506 } |
| 507 | 507 |
| 508 } // namespace blink | 508 } // namespace blink |
| OLD | NEW |