| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt
r<PointerEvent> pointerEvent) | 176 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt
r<PointerEvent> pointerEvent) |
| 177 : EventDispatchMediator(pointerEvent) | 177 : EventDispatchMediator(pointerEvent) |
| 178 { | 178 { |
| 179 } | 179 } |
| 180 | 180 |
| 181 PointerEvent& PointerEventDispatchMediator::event() const | 181 PointerEvent& PointerEventDispatchMediator::event() const |
| 182 { | 182 { |
| 183 return toPointerEvent(EventDispatchMediator::event()); | 183 return toPointerEvent(EventDispatchMediator::event()); |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool PointerEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) co
nst | 186 WebInputEventResult PointerEventDispatchMediator::dispatchEvent(EventDispatcher&
dispatcher) const |
| 187 { | 187 { |
| 188 if (isDisabledFormControl(&dispatcher.node())) | 188 if (isDisabledFormControl(&dispatcher.node())) |
| 189 return false; | 189 return WebInputEventResult::HandledSuppressed; |
| 190 | 190 |
| 191 if (event().type().isEmpty()) | 191 if (event().type().isEmpty()) |
| 192 return true; // Shouldn't happen. | 192 return WebInputEventResult::NotHandled; // Shouldn't happen. |
| 193 | 193 |
| 194 ASSERT(!event().target() || event().target() != event().relatedTarget()); | 194 ASSERT(!event().target() || event().target() != event().relatedTarget()); |
| 195 | 195 |
| 196 EventTarget* relatedTarget = event().relatedTarget(); | 196 EventTarget* relatedTarget = event().relatedTarget(); |
| 197 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget)
; | 197 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget)
; |
| 198 | 198 |
| 199 dispatcher.dispatch(); | 199 return dispatcher.dispatch(); |
| 200 return !event().defaultHandled() && !event().defaultPrevented(); | |
| 201 } | 200 } |
| 202 | 201 |
| 203 } // namespace blink | 202 } // namespace blink |
| OLD | NEW |