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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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, 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 AbstractView* abstractView, 188 AbstractView* abstractView,
189 PlatformMouseEvent::SyntheticEventType syntheticEventType, 189 PlatformMouseEvent::SyntheticEventType syntheticEventType,
190 const String& region, 190 const String& region,
191 const WebMouseEvent& event) 191 const WebMouseEvent& event)
192 : UIEventWithKeyState( 192 : UIEventWithKeyState(
193 eventType, 193 eventType,
194 canBubble, 194 canBubble,
195 cancelable, 195 cancelable,
196 abstractView, 196 abstractView,
197 0, 197 0,
198 static_cast<PlatformEvent::Modifiers>(event.modifiers), 198 static_cast<PlatformEvent::Modifiers>(event.modifiers()),
199 TimeTicks::FromSeconds(event.timeStampSeconds), 199 TimeTicks::FromSeconds(event.timeStampSeconds()),
200 syntheticEventType == PlatformMouseEvent::FromTouch 200 syntheticEventType == PlatformMouseEvent::FromTouch
201 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 201 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities()
202 : InputDeviceCapabilities:: 202 : InputDeviceCapabilities::
203 doesntFireTouchEventsSourceCapabilities()), 203 doesntFireTouchEventsSourceCapabilities()),
204 m_screenLocation(event.globalX, event.globalY), 204 m_screenLocation(event.globalX, event.globalY),
205 m_movementDelta(flooredIntPoint(event.movementInRootFrame())), 205 m_movementDelta(flooredIntPoint(event.movementInRootFrame())),
206 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless 206 m_positionType(syntheticEventType == PlatformMouseEvent::Positionless
207 ? PositionType::Positionless 207 ? PositionType::Positionless
208 : PositionType::Position), 208 : PositionType::Position),
209 m_button(0), 209 m_button(0),
210 m_buttons(platformModifiersToButtons(event.modifiers)), 210 m_buttons(platformModifiersToButtons(event.modifiers())),
211 m_syntheticEventType(syntheticEventType), 211 m_syntheticEventType(syntheticEventType),
212 m_region(region) { 212 m_region(region) {
213 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame()); 213 IntPoint rootFrameCoordinates = flooredIntPoint(event.positionInRootFrame());
214 initCoordinatesFromRootFrame(rootFrameCoordinates.x(), 214 initCoordinatesFromRootFrame(rootFrameCoordinates.x(),
215 rootFrameCoordinates.y()); 215 rootFrameCoordinates.y());
216 } 216 }
217 217
218 MouseEvent::MouseEvent( 218 MouseEvent::MouseEvent(
219 const AtomicString& eventType, 219 const AtomicString& eventType,
220 bool canBubble, 220 bool canBubble,
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 int MouseEvent::offsetY() { 600 int MouseEvent::offsetY() {
601 if (!hasPosition()) 601 if (!hasPosition())
602 return 0; 602 return 0;
603 if (!m_hasCachedRelativePosition) 603 if (!m_hasCachedRelativePosition)
604 computeRelativePosition(); 604 computeRelativePosition();
605 return std::round(m_offsetLocation.y()); 605 return std::round(m_offsetLocation.y());
606 } 606 }
607 607
608 } // namespace blink 608 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/KeyboardEvent.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698