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

Side by Side Diff: sky/engine/core/events/MouseEvent.cpp

Issue 723253004: Remove tons of OILPAN. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/events/MouseEvent.h ('k') | sky/engine/core/events/MouseRelatedEvent.h » ('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, 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 Node* MouseEvent::fromElement() const 178 Node* MouseEvent::fromElement() const
179 { 179 {
180 // MSIE extension - "object from which activation or the mouse pointer is ex iting during the event" (huh?) 180 // MSIE extension - "object from which activation or the mouse pointer is ex iting during the event" (huh?)
181 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea ve) 181 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea ve)
182 return relatedTarget() ? relatedTarget()->toNode() : 0; 182 return relatedTarget() ? relatedTarget()->toNode() : 0;
183 183
184 return target() ? target()->toNode() : 0; 184 return target() ? target()->toNode() : 0;
185 } 185 }
186 186
187 void MouseEvent::trace(Visitor* visitor)
188 {
189 visitor->trace(m_relatedTarget);
190 MouseRelatedEvent::trace(visitor);
191 }
192
193 PassRefPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent) 187 PassRefPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent)
194 { 188 {
195 return adoptRef(new SimulatedMouseEvent(eventType, view, underlyingEvent)); 189 return adoptRef(new SimulatedMouseEvent(eventType, view, underlyingEvent));
196 } 190 }
197 191
198 SimulatedMouseEvent::~SimulatedMouseEvent() 192 SimulatedMouseEvent::~SimulatedMouseEvent()
199 { 193 {
200 } 194 }
201 195
202 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP tr<AbstractView> view, PassRefPtr<Event> underlyingEvent) 196 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP tr<AbstractView> view, PassRefPtr<Event> underlyingEvent)
203 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 0, 197 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false, false, false, 0,
204 nullptr, true, PlatformMouseEvent::RealOrIndistinguishable) 198 nullptr, true, PlatformMouseEvent::RealOrIndistinguishable)
205 { 199 {
206 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve nt.get())) { 200 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve nt.get())) {
207 m_ctrlKey = keyStateEvent->ctrlKey(); 201 m_ctrlKey = keyStateEvent->ctrlKey();
208 m_altKey = keyStateEvent->altKey(); 202 m_altKey = keyStateEvent->altKey();
209 m_shiftKey = keyStateEvent->shiftKey(); 203 m_shiftKey = keyStateEvent->shiftKey();
210 m_metaKey = keyStateEvent->metaKey(); 204 m_metaKey = keyStateEvent->metaKey();
211 } 205 }
212 setUnderlyingEvent(underlyingEvent); 206 setUnderlyingEvent(underlyingEvent);
213 207
214 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) { 208 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) {
215 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent()); 209 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent());
216 m_screenLocation = mouseEvent->screenLocation(); 210 m_screenLocation = mouseEvent->screenLocation();
217 initCoordinates(mouseEvent->clientLocation()); 211 initCoordinates(mouseEvent->clientLocation());
218 } 212 }
219 } 213 }
220 214
221 void SimulatedMouseEvent::trace(Visitor* visitor)
222 {
223 MouseEvent::trace(visitor);
224 }
225
226 PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRe fPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) 215 PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRe fPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType)
227 { 216 {
228 return adoptRef(new MouseEventDispatchMediator(mouseEvent, mouseEventType)); 217 return adoptRef(new MouseEventDispatchMediator(mouseEvent, mouseEventType));
229 } 218 }
230 219
231 MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtr<MouseEvent> mo useEvent, MouseEventType mouseEventType) 220 MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtr<MouseEvent> mo useEvent, MouseEventType mouseEventType)
232 : EventDispatchMediator(mouseEvent), m_mouseEventType(mouseEventType) 221 : EventDispatchMediator(mouseEvent), m_mouseEventType(mouseEventType)
233 { 222 {
234 } 223 }
235 224
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 event()->button(), relatedTarget); 258 event()->button(), relatedTarget);
270 if (event()->defaultHandled()) 259 if (event()->defaultHandled())
271 doubleClickEvent->setDefaultHandled(); 260 doubleClickEvent->setDefaultHandled();
272 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato r::create(doubleClickEvent)); 261 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato r::create(doubleClickEvent));
273 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ()) 262 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented ())
274 return false; 263 return false;
275 return !swallowEvent; 264 return !swallowEvent;
276 } 265 }
277 266
278 } // namespace blink 267 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/events/MouseEvent.h ('k') | sky/engine/core/events/MouseRelatedEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698