| 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/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentUserGestureToken.h" |
| 7 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
| 8 #include "core/dom/shadow/FlatTreeTraversal.h" | 9 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 9 #include "core/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
| 10 #include "core/frame/FrameView.h" | 11 #include "core/frame/FrameView.h" |
| 11 #include "core/frame/UseCounter.h" | 12 #include "core/frame/UseCounter.h" |
| 12 #include "core/html/HTMLCanvasElement.h" | 13 #include "core/html/HTMLCanvasElement.h" |
| 13 #include "core/input/EventHandler.h" | 14 #include "core/input/EventHandler.h" |
| 14 #include "core/input/EventHandlingUtil.h" | 15 #include "core/input/EventHandlingUtil.h" |
| 15 #include "core/input/MouseEventManager.h" | 16 #include "core/input/MouseEventManager.h" |
| 16 #include "core/input/TouchActionUtil.h" | 17 #include "core/input/TouchActionUtil.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!checkForListener || target->hasEventListeners(eventType)) { | 166 if (!checkForListener || target->hasEventListeners(eventType)) { |
| 166 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch); | 167 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch); |
| 167 if (eventType == EventTypeNames::pointerdown) | 168 if (eventType == EventTypeNames::pointerdown) |
| 168 UseCounter::count(m_frame->document(), | 169 UseCounter::count(m_frame->document(), |
| 169 UseCounter::PointerEventDispatchPointerDown); | 170 UseCounter::PointerEventDispatchPointerDown); |
| 170 | 171 |
| 171 std::unique_ptr<UserGestureIndicator> gestureIndicator; | 172 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
| 172 if (eventType == EventTypeNames::pointerup && | 173 if (eventType == EventTypeNames::pointerup && |
| 173 pointerEvent->pointerType() == "touch") { | 174 pointerEvent->pointerType() == "touch") { |
| 174 gestureIndicator = | 175 gestureIndicator = |
| 175 wrapUnique(new UserGestureIndicator(UserGestureToken::create())); | 176 wrapUnique(new UserGestureIndicator(DocumentUserGestureToken::create( |
| 177 target->toNode() ? &target->toNode()->document() : nullptr))); |
| 176 } | 178 } |
| 177 | 179 |
| 178 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent); | 180 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent); |
| 179 return EventHandlingUtil::toWebInputEventResult(dispatchResult); | 181 return EventHandlingUtil::toWebInputEventResult(dispatchResult); |
| 180 } | 182 } |
| 181 return WebInputEventResult::NotHandled; | 183 return WebInputEventResult::NotHandled; |
| 182 } | 184 } |
| 183 | 185 |
| 184 EventTarget* PointerEventManager::getEffectiveTargetForPointerEvent( | 186 EventTarget* PointerEventManager::getEffectiveTargetForPointerEvent( |
| 185 EventTarget* target, | 187 EventTarget* target, |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 return true; | 700 return true; |
| 699 } | 701 } |
| 700 return false; | 702 return false; |
| 701 } | 703 } |
| 702 | 704 |
| 703 EventTarget* PointerEventManager::getMouseCapturingNode() { | 705 EventTarget* PointerEventManager::getMouseCapturingNode() { |
| 704 return getCapturingNode(PointerEventFactory::s_mouseId); | 706 return getCapturingNode(PointerEventFactory::s_mouseId); |
| 705 } | 707 } |
| 706 | 708 |
| 707 } // namespace blink | 709 } // namespace blink |
| OLD | NEW |