Chromium Code Reviews| 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, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 virtual ~MouseEvent(); | 58 virtual ~MouseEvent(); |
| 59 | 59 |
| 60 static unsigned short platformModifiersToButtons(unsigned modifiers); | 60 static unsigned short platformModifiersToButtons(unsigned modifiers); |
| 61 | 61 |
| 62 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, | 62 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, |
| 63 int detail, int screenX, int screenY, int clientX, int clientY, | 63 int detail, int screenX, int screenY, int clientX, int clientY, |
| 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, | 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, |
| 65 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, unsigne d short buttons = 0); | 65 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, unsigne d short buttons = 0); |
| 66 | 66 |
| 67 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, | |
| 68 int detail, int screenX, int screenY, int clientX, int clientY, | |
| 69 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, | |
| 70 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, InputDe vice* sourceDevice, unsigned short buttons = 0); | |
|
Rick Byers
2015/06/23 00:55:57
Do you really need to add a new overload or could
lanwei
2015/06/23 22:19:20
Done.
| |
| 71 | |
| 67 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused own/up, maybe others), | 72 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused own/up, maybe others), |
| 68 // but we will match the standard DOM. | 73 // but we will match the standard DOM. |
| 69 short button() const { return m_button == -1 ? 0 : m_button; } | 74 short button() const { return m_button == -1 ? 0 : m_button; } |
| 70 unsigned short buttons() const { return m_buttons; } | 75 unsigned short buttons() const { return m_buttons; } |
| 71 bool buttonDown() const { return m_button != -1; } | 76 bool buttonDown() const { return m_button != -1; } |
| 72 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 77 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
| 73 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m _relatedTarget = relatedTarget; } | 78 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m _relatedTarget = relatedTarget; } |
| 74 | 79 |
| 75 Node* toElement() const; | 80 Node* toElement() const; |
| 76 Node* fromElement() const; | 81 Node* fromElement() const; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 virtual bool dispatchEvent(EventDispatcher&) const override; | 135 virtual bool dispatchEvent(EventDispatcher&) const override; |
| 131 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; } | 136 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; } |
| 132 MouseEventType m_mouseEventType; | 137 MouseEventType m_mouseEventType; |
| 133 }; | 138 }; |
| 134 | 139 |
| 135 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 140 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
| 136 | 141 |
| 137 } // namespace blink | 142 } // namespace blink |
| 138 | 143 |
| 139 #endif // MouseEvent_h | 144 #endif // MouseEvent_h |
| OLD | NEW |