Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: Source/core/events/MouseEvent.h

Issue 1174683004: Populates sourceDevice attribute into MouseEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused own/up, maybe others), 67 // 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. 68 // but we will match the standard DOM.
69 short button() const { return m_button == -1 ? 0 : m_button; } 69 short button() const { return m_button == -1 ? 0 : m_button; }
70 unsigned short buttons() const { return m_buttons; } 70 unsigned short buttons() const { return m_buttons; }
71 bool buttonDown() const { return m_button != -1; } 71 bool buttonDown() const { return m_button != -1; }
72 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } 72 EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
73 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m _relatedTarget = relatedTarget; } 73 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m _relatedTarget = relatedTarget; }
74 PlatformMouseEvent::SyntheticEventType syntheticEventType() const { return m _syntheticEventType; }
74 75
75 Node* toElement() const; 76 Node* toElement() const;
76 Node* fromElement() const; 77 Node* fromElement() const;
77 78
78 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g et() : 0; } 79 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g et() : 0; }
79 80
80 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent:: FromTouch; } 81 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent:: FromTouch; }
81 82
82 virtual const AtomicString& interfaceName() const override; 83 virtual const AtomicString& interfaceName() const override;
83 84
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 virtual bool dispatchEvent(EventDispatcher&) const override; 131 virtual bool dispatchEvent(EventDispatcher&) const override;
131 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; } 132 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; }
132 MouseEventType m_mouseEventType; 133 MouseEventType m_mouseEventType;
133 }; 134 };
134 135
135 DEFINE_EVENT_TYPE_CASTS(MouseEvent); 136 DEFINE_EVENT_TYPE_CASTS(MouseEvent);
136 137
137 } // namespace blink 138 } // namespace blink
138 139
139 #endif // MouseEvent_h 140 #endif // MouseEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698