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

Unified Diff: third_party/WebKit/Source/platform/WebMouseEvent.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/platform/WebMouseEvent.cpp
diff --git a/third_party/WebKit/Source/platform/WebMouseEvent.cpp b/third_party/WebKit/Source/platform/WebMouseEvent.cpp
index 4e6e9575f02fe7c06f1faa9072933c13d484ebdd..8e297fa165b3b6574d0b8c73e9c0f53c27a206fe 100644
--- a/third_party/WebKit/Source/platform/WebMouseEvent.cpp
+++ b/third_party/WebKit/Source/platform/WebMouseEvent.cpp
@@ -4,8 +4,28 @@
#include "public/platform/WebMouseEvent.h"
+#include "public/platform/WebGestureEvent.h"
+
namespace blink {
+WebMouseEvent::WebMouseEvent(WebInputEvent::Type type,
+ const WebGestureEvent& gestureEvent,
+ Button buttonParam,
+ int clickCountParam,
+ int modifiers,
+ double timeStampSeconds)
+ : WebInputEvent(sizeof(WebMouseEvent), type, modifiers, timeStampSeconds),
+ WebPointerProperties(buttonParam,
+ WebPointerProperties::PointerType::Mouse),
+ x(gestureEvent.x),
+ y(gestureEvent.y),
+ globalX(gestureEvent.globalX),
+ globalY(gestureEvent.globalY),
+ clickCount(clickCountParam) {
+ setFrameScale(gestureEvent.frameScale());
+ setFrameTranslate(gestureEvent.frameTranslate());
+}
+
WebFloatPoint WebMouseEvent::movementInRootFrame() const {
return WebFloatPoint((movementX / m_frameScale), (movementY / m_frameScale));
}
@@ -15,6 +35,12 @@ WebFloatPoint WebMouseEvent::positionInRootFrame() const {
(y / m_frameScale) + m_frameTranslate.y);
}
+WebMouseEvent WebMouseEvent::flattenTransform() const {
+ WebMouseEvent result = *this;
+ result.flattenTransformSelf();
+ return result;
+}
+
void WebMouseEvent::flattenTransformSelf() {
x = (x / m_frameScale) + m_frameTranslate.x;
y = (y / m_frameScale) + m_frameTranslate.y;
« no previous file with comments | « third_party/WebKit/Source/platform/PlatformMouseEvent.h ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698