| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return target() ? target()->toNode() : 0; | 210 return target() ? target()->toNode() : 0; |
| 211 } | 211 } |
| 212 | 212 |
| 213 DEFINE_TRACE(MouseEvent) | 213 DEFINE_TRACE(MouseEvent) |
| 214 { | 214 { |
| 215 visitor->trace(m_relatedTarget); | 215 visitor->trace(m_relatedTarget); |
| 216 visitor->trace(m_dataTransfer); | 216 visitor->trace(m_dataTransfer); |
| 217 MouseRelatedEvent::trace(visitor); | 217 MouseRelatedEvent::trace(visitor); |
| 218 } | 218 } |
| 219 | 219 |
| 220 PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const At
omicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWill
BeRawPtr<Event> underlyingEvent) | 220 PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const At
omicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWill
BeRawPtr<Event> underlyingEvent, bool isTrusted) |
| 221 { | 221 { |
| 222 return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyin
gEvent)); | 222 return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyin
gEvent, isTrusted)); |
| 223 } | 223 } |
| 224 | 224 |
| 225 SimulatedMouseEvent::~SimulatedMouseEvent() | 225 SimulatedMouseEvent::~SimulatedMouseEvent() |
| 226 { | 226 { |
| 227 } | 227 } |
| 228 | 228 |
| 229 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
trWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent
) | 229 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
trWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent
, bool isTrusted) |
| 230 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false,
false, false, 0, 0, | 230 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false,
false, false, 0, 0, |
| 231 nullptr, nullptr, true, PlatformMouseEvent::RealOrIndistinguishable) | 231 nullptr, nullptr, true, PlatformMouseEvent::RealOrIndistinguishable) |
| 232 { | 232 { |
| 233 setTrusted(true); | 233 setTrusted(isTrusted); |
| 234 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve
nt.get())) { | 234 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve
nt.get())) { |
| 235 m_ctrlKey = keyStateEvent->ctrlKey(); | 235 m_ctrlKey = keyStateEvent->ctrlKey(); |
| 236 m_altKey = keyStateEvent->altKey(); | 236 m_altKey = keyStateEvent->altKey(); |
| 237 m_shiftKey = keyStateEvent->shiftKey(); | 237 m_shiftKey = keyStateEvent->shiftKey(); |
| 238 m_metaKey = keyStateEvent->metaKey(); | 238 m_metaKey = keyStateEvent->metaKey(); |
| 239 } | 239 } |
| 240 setUnderlyingEvent(underlyingEvent); | 240 setUnderlyingEvent(underlyingEvent); |
| 241 | 241 |
| 242 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) { | 242 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) { |
| 243 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent()); | 243 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent()); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 doubleClickEvent->setTrusted(event().isTrusted()); | 308 doubleClickEvent->setTrusted(event().isTrusted()); |
| 309 if (event().defaultHandled()) | 309 if (event().defaultHandled()) |
| 310 doubleClickEvent->setDefaultHandled(); | 310 doubleClickEvent->setDefaultHandled(); |
| 311 EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator
::create(doubleClickEvent)); | 311 EventDispatcher::dispatchEvent(dispatcher.node(), MouseEventDispatchMediator
::create(doubleClickEvent)); |
| 312 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) | 312 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) |
| 313 return false; | 313 return false; |
| 314 return !swallowEvent; | 314 return !swallowEvent; |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |