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

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index c9eef0f9997b00a53efadaa829616a57da7d9be2..07385275214487ba6a20e3a88b079696ab80abe5 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -118,12 +118,19 @@ static bool dragTypeIsValid(DragSourceAction action) {
}
#endif // DCHECK_IS_ON()
-static PlatformMouseEvent createMouseEvent(DragData* dragData) {
- return PlatformMouseEvent(
- dragData->clientPosition(), dragData->globalPosition(),
- WebPointerProperties::Button::Left, PlatformEvent::MouseMoved, 0,
+static WebMouseEvent createMouseEvent(DragData* dragData) {
+ WebMouseEvent result(
+ WebInputEvent::MouseMove, WebFloatPoint(dragData->clientPosition().x(),
+ dragData->clientPosition().y()),
+ WebFloatPoint(dragData->globalPosition().x(),
+ dragData->globalPosition().y()),
+ WebPointerProperties::Button::Left, 0,
static_cast<PlatformEvent::Modifiers>(dragData->modifiers()),
- PlatformMouseEvent::RealOrIndistinguishable, TimeTicks::Now());
+ TimeTicks::Now().InSeconds());
+ // TODO(dtapuska): Really we should chnage DragData to store the viewport
+ // coordinates and scale.
+ result.setFrameScale(1);
+ return result;
}
static DataTransfer* createDraggingDataTransfer(DataTransferAccessPolicy policy,
@@ -719,7 +726,7 @@ bool DragController::tryDHTMLDrag(DragData* dragData,
DragOperation srcOpMask = dragData->draggingSourceOperationMask();
dataTransfer->setSourceOperation(srcOpMask);
- PlatformMouseEvent event = createMouseEvent(dragData);
+ WebMouseEvent event = createMouseEvent(dragData);
if (localRoot.eventHandler().updateDragAndDrop(event, dataTransfer) ==
WebInputEventResult::NotHandled) {
dataTransfer->setAccessPolicy(
@@ -1050,7 +1057,7 @@ static std::unique_ptr<DragImage> dragImageForLink(
bool DragController::startDrag(LocalFrame* src,
const DragState& state,
- const PlatformMouseEvent& dragEvent,
+ const WebMouseEvent& dragEvent,
const IntPoint& dragOrigin) {
#if DCHECK_IS_ON()
DCHECK(dragTypeIsValid(state.m_dragType));
@@ -1072,8 +1079,8 @@ bool DragController::startDrag(LocalFrame* src,
const KURL& linkURL = hitTestResult.absoluteLinkURL();
const KURL& imageURL = hitTestResult.absoluteImageURL();
- IntPoint mouseDraggedPoint =
- src->view()->rootFrameToContents(dragEvent.position());
+ IntPoint mouseDraggedPoint = src->view()->rootFrameToContents(
+ flooredIntPoint(dragEvent.positionInRootFrame()));
IntPoint dragLocation;
IntPoint dragOffset;
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.h ('k') | third_party/WebKit/Source/core/page/EventWithHitTestResults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698