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

Unified Diff: third_party/WebKit/public/platform/WebMouseEvent.h

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: 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/public/platform/WebMouseEvent.h
diff --git a/third_party/WebKit/public/platform/WebMouseEvent.h b/third_party/WebKit/public/platform/WebMouseEvent.h
index ec23a72f442ff2b38d364fd209ec010d1f54cd99..c9e5a419d1edf86275db03e94f2bea6eb4d895ac 100644
--- a/third_party/WebKit/public/platform/WebMouseEvent.h
+++ b/third_party/WebKit/public/platform/WebMouseEvent.h
@@ -9,6 +9,8 @@
namespace blink {
+class WebGestureEvent;
+
// See WebInputEvent.h for details why this pack is here.
#pragma pack(push, 4)
@@ -34,16 +36,69 @@ class WebMouseEvent : public WebInputEvent, public WebPointerProperties {
int movementY;
int clickCount;
- WebMouseEvent(Type type, int modifiers, double timeStampSeconds)
- : WebInputEvent(sizeof(WebMouseEvent), type, modifiers, timeStampSeconds),
- WebPointerProperties() {}
-
- WebMouseEvent()
- : WebInputEvent(sizeof(WebMouseEvent)), WebPointerProperties() {}
+ WebMouseEvent(Type typeParam,
+ int xParam,
+ int yParam,
+ int globalXParam,
+ int globalYParam,
+ int modifiersParam,
+ double timeStampSecondsParam)
+ : WebInputEvent(sizeof(WebMouseEvent),
+ typeParam,
+ modifiersParam,
+ timeStampSecondsParam),
+ WebPointerProperties(),
+ x(xParam),
+ y(yParam),
+ globalX(globalXParam),
+ globalY(globalYParam) {}
+
+ WebMouseEvent(Type typeParam,
+ WebFloatPoint position,
+ WebFloatPoint globalPosition,
+ Button buttonParam,
+ int clickCountParam,
+ int modifiersParam,
+ double timeStampSecondsParam)
+ : WebInputEvent(sizeof(WebMouseEvent),
+ typeParam,
+ modifiersParam,
+ timeStampSecondsParam),
+ WebPointerProperties(buttonParam, PointerType::Mouse),
+ x(position.x),
+ y(position.y),
+ globalX(globalPosition.x),
+ globalY(globalPosition.y),
+ clickCount(clickCountParam) {}
+
+ WebMouseEvent(Type typeParam,
+ int modifiersParam,
+ double timeStampSecondsParam)
+ : WebMouseEvent(sizeof(WebMouseEvent),
+ typeParam,
+ modifiersParam,
+ timeStampSecondsParam) {}
+
+ WebMouseEvent() : WebMouseEvent(sizeof(WebMouseEvent)) {}
+
+ bool fromTouch() const {
+ return (modifiers() & IsCompatibilityEventForTouch) != 0;
+ }
#if INSIDE_BLINK
+ BLINK_PLATFORM_EXPORT WebMouseEvent(Type typeParam,
+ const WebGestureEvent&,
+ Button buttonParam,
+ int clickCountParam,
+ int modifiersParam,
+ double timeStampSecondsParam);
+
BLINK_PLATFORM_EXPORT WebFloatPoint movementInRootFrame() const;
BLINK_PLATFORM_EXPORT WebFloatPoint positionInRootFrame() const;
+
+ // Sets any scaled values to be their computed values and sets |frameScale|
+ // back to 1 and |translateX|, |translateY| back to 0.
+ BLINK_PLATFORM_EXPORT WebMouseEvent flattenTransform() const;
#endif
protected:

Powered by Google App Engine
This is Rietveld 408576698