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

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

Issue 316443004: Oilpan: Remove ref counting from EventTarget and all uses of Pass/RefPtr<EventTarget>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/events/MouseEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 38
39 int screenX; 39 int screenX;
40 int screenY; 40 int screenY;
41 int clientX; 41 int clientX;
42 int clientY; 42 int clientY;
43 bool ctrlKey; 43 bool ctrlKey;
44 bool altKey; 44 bool altKey;
45 bool shiftKey; 45 bool shiftKey;
46 bool metaKey; 46 bool metaKey;
47 unsigned short button; 47 unsigned short button;
48 RefPtr<EventTarget> relatedTarget; 48 RefPtrWillBeMember<EventTarget> relatedTarget;
49 }; 49 };
50 50
51 class MouseEvent : public MouseRelatedEvent { 51 class MouseEvent : public MouseRelatedEvent {
52 public: 52 public:
53 static PassRefPtrWillBeRawPtr<MouseEvent> create() 53 static PassRefPtrWillBeRawPtr<MouseEvent> create()
54 { 54 {
55 return adoptRefWillBeNoop(new MouseEvent); 55 return adoptRefWillBeNoop(new MouseEvent);
56 } 56 }
57 57
58 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& type, b ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, 58 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& type, b ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>,
59 int detail, int screenX, int screenY, int pageX, int pageY, 59 int detail, int screenX, int screenY, int pageX, int pageY,
60 int movementX, int movementY, 60 int movementX, int movementY,
61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b utton, 61 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b utton,
62 PassRefPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPtr<Clipboard> , bool isSimulated = false); 62 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPt r<Clipboard>, bool isSimulated = false);
63 63
64 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget); 64 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget);
65 65
66 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy pe, const MouseEventInit&); 66 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy pe, const MouseEventInit&);
67 67
68 virtual ~MouseEvent(); 68 virtual ~MouseEvent();
69 69
70 void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelabl e, PassRefPtrWillBeRawPtr<AbstractView>, 70 void initMouseEvent(const AtomicString& type, bool canBubble, bool cancelabl e, PassRefPtrWillBeRawPtr<AbstractView>,
71 int detail, int screenX, int screenY, int clientX, int clientY, 71 int detail, int screenX, int screenY, int clientX, int clientY,
72 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 72 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
73 unsigned short button, PassRefPtr<EventTarget> relatedTarget); 73 unsigned short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget );
74 74
75 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused own/up, maybe others), 75 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused own/up, maybe others),
76 // but we will match the standard DOM. 76 // but we will match the standard DOM.
77 unsigned short button() const { return m_button; } 77 unsigned short button() const { return m_button; }
78 bool buttonDown() const { return m_buttonDown; } 78 bool buttonDown() const { return m_buttonDown; }
79 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } 79 EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
80 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); } 80 EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); }
81 void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarg et = relatedTarget; } 81 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m _relatedTarget = relatedTarget; }
82 82
83 Node* toElement() const; 83 Node* toElement() const;
84 Node* fromElement() const; 84 Node* fromElement() const;
85 85
86 Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() : 0; } 86 Clipboard* dataTransfer() const { return isDragEvent() ? m_clipboard.get() : 0; }
87 87
88 virtual const AtomicString& interfaceName() const OVERRIDE; 88 virtual const AtomicString& interfaceName() const OVERRIDE;
89 89
90 virtual bool isMouseEvent() const OVERRIDE; 90 virtual bool isMouseEvent() const OVERRIDE;
91 virtual bool isDragEvent() const OVERRIDE FINAL; 91 virtual bool isDragEvent() const OVERRIDE FINAL;
92 virtual int which() const OVERRIDE FINAL; 92 virtual int which() const OVERRIDE FINAL;
93 93
94 virtual void trace(Visitor*) OVERRIDE; 94 virtual void trace(Visitor*) OVERRIDE;
95 95
96 protected: 96 protected:
97 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe fPtrWillBeRawPtr<AbstractView>, 97 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe fPtrWillBeRawPtr<AbstractView>,
98 int detail, int screenX, int screenY, int pageX, int pageY, 98 int detail, int screenX, int screenY, int pageX, int pageY,
99 int movementX, int movementY, 99 int movementX, int movementY,
100 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b utton, 100 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b utton,
101 PassRefPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPtr<Clipboard> , bool isSimulated); 101 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPt r<Clipboard>, bool isSimulated);
102 102
103 MouseEvent(const AtomicString& type, const MouseEventInit&); 103 MouseEvent(const AtomicString& type, const MouseEventInit&);
104 104
105 MouseEvent(); 105 MouseEvent();
106 106
107 private: 107 private:
108 unsigned short m_button; 108 unsigned short m_button;
109 bool m_buttonDown; 109 bool m_buttonDown;
110 RefPtr<EventTarget> m_relatedTarget; 110 RefPtrWillBeMember<EventTarget> m_relatedTarget;
111 RefPtrWillBeMember<Clipboard> m_clipboard; 111 RefPtrWillBeMember<Clipboard> m_clipboard;
112 }; 112 };
113 113
114 class SimulatedMouseEvent FINAL : public MouseEvent { 114 class SimulatedMouseEvent FINAL : public MouseEvent {
115 public: 115 public:
116 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString & eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent); 116 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString & eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent);
117 virtual ~SimulatedMouseEvent(); 117 virtual ~SimulatedMouseEvent();
118 118
119 virtual void trace(Visitor*) OVERRIDE; 119 virtual void trace(Visitor*) OVERRIDE;
120 120
(...skipping 13 matching lines...) Expand all
134 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; 134 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
135 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; } 135 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou seEvent; }
136 MouseEventType m_mouseEventType; 136 MouseEventType m_mouseEventType;
137 }; 137 };
138 138
139 DEFINE_EVENT_TYPE_CASTS(MouseEvent); 139 DEFINE_EVENT_TYPE_CASTS(MouseEvent);
140 140
141 } // namespace WebCore 141 } // namespace WebCore
142 142
143 #endif // MouseEvent_h 143 #endif // MouseEvent_h
OLDNEW
« no previous file with comments | « Source/core/events/MessageEvent.h ('k') | Source/core/events/MouseEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698