| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/events/PointerEvent.h" | 6 #include "core/events/PointerEvent.h" |
| 7 | 7 |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/events/EventDispatcher.h" | 9 #include "core/events/EventDispatcher.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt
r<PointerEvent> pointerEvent) | 77 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt
r<PointerEvent> pointerEvent) |
| 78 : EventDispatchMediator(pointerEvent) | 78 : EventDispatchMediator(pointerEvent) |
| 79 { | 79 { |
| 80 } | 80 } |
| 81 | 81 |
| 82 PointerEvent& PointerEventDispatchMediator::event() const | 82 PointerEvent& PointerEventDispatchMediator::event() const |
| 83 { | 83 { |
| 84 return toPointerEvent(EventDispatchMediator::event()); | 84 return toPointerEvent(EventDispatchMediator::event()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool PointerEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) co
nst | 87 WebInputEventResult PointerEventDispatchMediator::dispatchEvent(EventDispatcher&
dispatcher) const |
| 88 { | 88 { |
| 89 if (isDisabledFormControl(&dispatcher.node())) | 89 if (isDisabledFormControl(&dispatcher.node())) |
| 90 return false; | 90 return WebInputEventResult::HandledSuppressed; |
| 91 | 91 |
| 92 if (event().type().isEmpty()) | 92 if (event().type().isEmpty()) |
| 93 return true; // Shouldn't happen. | 93 return WebInputEventResult::NotHandled; // Shouldn't happen. |
| 94 | 94 |
| 95 ASSERT(!event().target() || event().target() != event().relatedTarget()); | 95 ASSERT(!event().target() || event().target() != event().relatedTarget()); |
| 96 | 96 |
| 97 EventTarget* relatedTarget = event().relatedTarget(); | 97 EventTarget* relatedTarget = event().relatedTarget(); |
| 98 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget)
; | 98 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget)
; |
| 99 | 99 |
| 100 dispatcher.dispatch(); | 100 return dispatcher.dispatch(); |
| 101 return !event().defaultHandled() && !event().defaultPrevented(); | |
| 102 } | 101 } |
| 103 | 102 |
| 104 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |