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

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

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: 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
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, 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 detail, event.globalPosition().x(), event.globalPosition().y(), event.po sition().x(), event.position().y(), 62 detail, event.globalPosition().x(), event.globalPosition().y(), event.po sition().x(), event.position().y(),
63 event.movementDelta().x(), event.movementDelta().y(), 63 event.movementDelta().x(), event.movementDelta().y(),
64 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), even t.button(), 64 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), even t.button(),
65 relatedTarget, nullptr, false); 65 relatedTarget, nullptr, false);
66 } 66 }
67 67
68 PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, 68 PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view,
69 int detail, int screenX, int screenY, int pageX, int pageY, 69 int detail, int screenX, int screenY, int pageX, int pageY,
70 int movementX, int movementY, 70 int movementX, int movementY,
71 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto n, 71 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short butto n,
72 PassRefPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPtr<Clipboard> cli pboard, bool isSimulated) 72 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPtr<Cl ipboard> clipboard, bool isSimulated)
73 { 73 {
74 return adoptRefWillBeNoop(new MouseEvent(type, canBubble, cancelable, view, 74 return adoptRefWillBeNoop(new MouseEvent(type, canBubble, cancelable, view,
75 detail, screenX, screenY, pageX, pageY, 75 detail, screenX, screenY, pageX, pageY,
76 movementX, movementY, 76 movementX, movementY,
77 ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, clipboard, is Simulated)); 77 ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, clipboard, is Simulated));
78 } 78 }
79 79
80 MouseEvent::MouseEvent() 80 MouseEvent::MouseEvent()
81 : m_button(0) 81 : m_button(0)
82 , m_buttonDown(false) 82 , m_buttonDown(false)
83 { 83 {
84 ScriptWrappable::init(this); 84 ScriptWrappable::init(this);
85 } 85 }
86 86
87 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance lable, PassRefPtrWillBeRawPtr<AbstractView> view, 87 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance lable, PassRefPtrWillBeRawPtr<AbstractView> view,
88 int detail, int screenX, int screenY, int pageX, int pageY, 88 int detail, int screenX, int screenY, int pageX, int pageY,
89 int movementX, int movementY, 89 int movementX, int movementY,
90 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 90 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
91 unsigned short button, PassRefPtr<EventTarget> relatedTarget, 91 unsigned short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget,
92 PassRefPtrWillBeRawPtr<Clipboard> clipboard, bool isSimulated) 92 PassRefPtrWillBeRawPtr<Clipboard> clipboard, bool isSimulated)
93 : MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, IntPoint (screenX, screenY), 93 : MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, IntPoint (screenX, screenY),
94 IntPoint(pageX, pageY), 94 IntPoint(pageX, pageY),
95 IntPoint(movementX, movementY), 95 IntPoint(movementX, movementY),
96 ctrlKey, altKey, shiftKey, metaKey, isSimulated) 96 ctrlKey, altKey, shiftKey, metaKey, isSimulated)
97 , m_button(button == (unsigned short)-1 ? 0 : button) 97 , m_button(button == (unsigned short)-1 ? 0 : button)
98 , m_buttonDown(button != (unsigned short)-1) 98 , m_buttonDown(button != (unsigned short)-1)
99 , m_relatedTarget(relatedTarget) 99 , m_relatedTarget(relatedTarget)
100 , m_clipboard(clipboard) 100 , m_clipboard(clipboard)
101 { 101 {
(...skipping 14 matching lines...) Expand all
116 initCoordinates(IntPoint(initializer.clientX, initializer.clientY)); 116 initCoordinates(IntPoint(initializer.clientX, initializer.clientY));
117 } 117 }
118 118
119 MouseEvent::~MouseEvent() 119 MouseEvent::~MouseEvent()
120 { 120 {
121 } 121 }
122 122
123 void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool c ancelable, PassRefPtrWillBeRawPtr<AbstractView> view, 123 void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool c ancelable, PassRefPtrWillBeRawPtr<AbstractView> view,
124 int detail, int screenX, int screenY, int client X, int clientY, 124 int detail, int screenX, int screenY, int client X, int clientY,
125 bool ctrlKey, bool altKey, bool shiftKey, bool m etaKey, 125 bool ctrlKey, bool altKey, bool shiftKey, bool m etaKey,
126 unsigned short button, PassRefPtr<EventTarget> r elatedTarget) 126 unsigned short button, PassRefPtrWillBeRawPtr<Ev entTarget> relatedTarget)
127 { 127 {
128 if (dispatched()) 128 if (dispatched())
129 return; 129 return;
130 130
131 initUIEvent(type, canBubble, cancelable, view, detail); 131 initUIEvent(type, canBubble, cancelable, view, detail);
132 132
133 m_screenLocation = IntPoint(screenX, screenY); 133 m_screenLocation = IntPoint(screenX, screenY);
134 m_ctrlKey = ctrlKey; 134 m_ctrlKey = ctrlKey;
135 m_altKey = altKey; 135 m_altKey = altKey;
136 m_shiftKey = shiftKey; 136 m_shiftKey = shiftKey;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 { 185 {
186 // MSIE extension - "object from which activation or the mouse pointer is ex iting during the event" (huh?) 186 // MSIE extension - "object from which activation or the mouse pointer is ex iting during the event" (huh?)
187 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea ve) 187 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea ve)
188 return relatedTarget() ? relatedTarget()->toNode() : 0; 188 return relatedTarget() ? relatedTarget()->toNode() : 0;
189 189
190 return target() ? target()->toNode() : 0; 190 return target() ? target()->toNode() : 0;
191 } 191 }
192 192
193 void MouseEvent::trace(Visitor* visitor) 193 void MouseEvent::trace(Visitor* visitor)
194 { 194 {
195 visitor->trace(m_relatedTarget);
195 visitor->trace(m_clipboard); 196 visitor->trace(m_clipboard);
196 MouseRelatedEvent::trace(visitor); 197 MouseRelatedEvent::trace(visitor);
197 } 198 }
198 199
199 PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const At omicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWill BeRawPtr<Event> underlyingEvent) 200 PassRefPtrWillBeRawPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const At omicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWill BeRawPtr<Event> underlyingEvent)
200 { 201 {
201 return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyin gEvent)); 202 return adoptRefWillBeNoop(new SimulatedMouseEvent(eventType, view, underlyin gEvent));
202 } 203 }
203 204
204 SimulatedMouseEvent::~SimulatedMouseEvent() 205 SimulatedMouseEvent::~SimulatedMouseEvent()
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 event()->button(), relatedTarget); 280 event()->button(), relatedTarget);
280 if (event()->defaultHandled()) 281 if (event()->defaultHandled())
281 doubleClickEvent->setDefaultHandled(); 282 doubleClickEvent->setDefaultHandled();
282 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato r::create(doubleClickEvent)); 283 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato r::create(doubleClickEvent));
283 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ()) 284 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ())
284 return false; 285 return false;
285 return !swallowEvent; 286 return !swallowEvent;
286 } 287 }
287 288
288 } // namespace WebCore 289 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698