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/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/ElementTraversal.h" | 7 #include "core/dom/ElementTraversal.h" |
| 8 #include "core/dom/shadow/FlatTreeTraversal.h" | 8 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 9 #include "core/events/MouseEvent.h" | 9 #include "core/events/MouseEvent.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 } | 161 } |
| 162 | 162 |
| 163 if (!RuntimeEnabledFeatures::pointerEventEnabled()) | 163 if (!RuntimeEnabledFeatures::pointerEventEnabled()) |
| 164 return WebInputEventResult::NotHandled; | 164 return WebInputEventResult::NotHandled; |
| 165 if (!checkForListener || target->hasEventListeners(eventType)) { | 165 if (!checkForListener || target->hasEventListeners(eventType)) { |
| 166 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch); | 166 UseCounter::count(m_frame->document(), UseCounter::PointerEventDispatch); |
| 167 if (eventType == EventTypeNames::pointerdown) | 167 if (eventType == EventTypeNames::pointerdown) |
| 168 UseCounter::count(m_frame->document(), | 168 UseCounter::count(m_frame->document(), |
| 169 UseCounter::PointerEventDispatchPointerDown); | 169 UseCounter::PointerEventDispatchPointerDown); |
| 170 | 170 |
| 171 std::unique_ptr<UserGestureIndicator> gestureIndicator; | |
| 172 if (eventType == EventTypeNames::pointerup) { | |
| 173 gestureIndicator = | |
| 174 wrapUnique(new UserGestureIndicator(DefinitelyProcessingUserGesture)); | |
|
mustaq
2016/10/07 19:06:21
Can't we make this a one-liner like this?
if(poi
Navid Zolghadr
2016/10/11 13:19:26
That wouldn't work. Because the variable will go o
Rick Byers
2016/10/11 15:11:52
Note that you can also avoid indirection via a uni
Navid Zolghadr
2016/10/12 15:18:01
Since the other change landed before this if I add
| |
| 175 } | |
| 176 | |
| 171 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent); | 177 DispatchEventResult dispatchResult = target->dispatchEvent(pointerEvent); |
| 172 return EventHandlingUtil::toWebInputEventResult(dispatchResult); | 178 return EventHandlingUtil::toWebInputEventResult(dispatchResult); |
| 173 } | 179 } |
| 174 return WebInputEventResult::NotHandled; | 180 return WebInputEventResult::NotHandled; |
| 175 } | 181 } |
| 176 | 182 |
| 177 EventTarget* PointerEventManager::getEffectiveTargetForPointerEvent( | 183 EventTarget* PointerEventManager::getEffectiveTargetForPointerEvent( |
| 178 EventTarget* target, | 184 EventTarget* target, |
| 179 int pointerId) { | 185 int pointerId) { |
| 180 if (EventTarget* capturingTarget = getCapturingNode(pointerId)) | 186 if (EventTarget* capturingTarget = getCapturingNode(pointerId)) |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 673 return true; | 679 return true; |
| 674 } | 680 } |
| 675 return false; | 681 return false; |
| 676 } | 682 } |
| 677 | 683 |
| 678 EventTarget* PointerEventManager::getMouseCapturingNode() { | 684 EventTarget* PointerEventManager::getMouseCapturingNode() { |
| 679 return getCapturingNode(PointerEventFactory::s_mouseId); | 685 return getCapturingNode(PointerEventFactory::s_mouseId); |
| 680 } | 686 } |
| 681 | 687 |
| 682 } // namespace blink | 688 } // namespace blink |
| OLD | NEW |