Index: third_party/WebKit/Source/core/dom/Touch.h |
diff --git a/third_party/WebKit/Source/core/dom/Touch.h b/third_party/WebKit/Source/core/dom/Touch.h |
index 95cd5fe4d223c4a0cbb5f70717b7b1b9efaf2720..5e35aa8e037146d310f50bf7ac64137537f4fd8f 100644 |
--- a/third_party/WebKit/Source/core/dom/Touch.h |
+++ b/third_party/WebKit/Source/core/dom/Touch.h |
@@ -35,6 +35,7 @@ |
#include "platform/geometry/FloatSize.h" |
#include "platform/geometry/LayoutPoint.h" |
#include "platform/heap/Handle.h" |
+#include "public/platform/WebPointerProperties.h" |
namespace blink { |
@@ -54,17 +55,30 @@ class CORE_EXPORT Touch final : public GarbageCollectedFinalized<Touch>, |
float rotationAngle, |
float force, |
String region) { |
- return new Touch(frame, target, identifier, screenPos, pagePos, radius, |
- rotationAngle, force, region); |
+ WebPointerProperties properties; |
+ properties.id = identifier; |
+ properties.force = force; |
+ return new Touch(frame, target, screenPos, pagePos, radius, rotationAngle, |
+ region, properties); |
+ } |
+ static Touch* create(LocalFrame* frame, |
+ EventTarget* target, |
+ const FloatPoint& screenPos, |
+ const FloatPoint& pagePos, |
+ const FloatSize& radius, |
+ float rotationAngle, |
+ String region, |
+ const WebPointerProperties& properties) { |
+ return new Touch(frame, target, screenPos, pagePos, radius, rotationAngle, |
+ region, properties); |
} |
- |
static Touch* create(const Document& document, const TouchInit& initializer) { |
return new Touch(document.frame(), initializer); |
} |
// DOM Touch implementation |
EventTarget* target() const { return m_target.get(); } |
- int identifier() const { return m_identifier; } |
+ int identifier() const { return m_pointerProperties.id; } |
double clientX() const { return m_clientPos.x(); } |
double clientY() const { return m_clientPos.y(); } |
double screenX() const { return m_screenPos.x(); } |
@@ -74,42 +88,42 @@ class CORE_EXPORT Touch final : public GarbageCollectedFinalized<Touch>, |
float radiusX() const { return m_radius.width(); } |
float radiusY() const { return m_radius.height(); } |
float rotationAngle() const { return m_rotationAngle; } |
- float force() const { return m_force; } |
+ float force() const { return m_pointerProperties.force; } |
const String& region() const { return m_region; } |
// Blink-internal methods |
const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; } |
const FloatPoint& screenLocation() const { return m_screenPos; } |
Touch* cloneWithNewTarget(EventTarget*) const; |
+ const WebPointerProperties& pointerProperties() const { |
+ return m_pointerProperties; |
+ } |
DECLARE_TRACE(); |
private: |
Touch(LocalFrame*, |
EventTarget*, |
- int identifier, |
const FloatPoint& screenPos, |
const FloatPoint& pagePos, |
const FloatSize& radius, |
float rotationAngle, |
- float force, |
- String region); |
+ String region, |
+ const WebPointerProperties&); |
Touch(EventTarget*, |
- int identifier, |
const FloatPoint& clientPos, |
const FloatPoint& screenPos, |
const FloatPoint& pagePos, |
const FloatSize& radius, |
float rotationAngle, |
- float force, |
String region, |
+ const WebPointerProperties&, |
LayoutPoint absoluteLocation); |
Touch(LocalFrame*, const TouchInit&); |
Member<EventTarget> m_target; |
- int m_identifier; |
// Position relative to the viewport in CSS px. |
FloatPoint m_clientPos; |
// Position relative to the screen in DIPs. |
@@ -119,12 +133,12 @@ class CORE_EXPORT Touch final : public GarbageCollectedFinalized<Touch>, |
// Radius in CSS px. |
FloatSize m_radius; |
float m_rotationAngle; |
- float m_force; |
String m_region; |
// FIXME(rbyers): Shouldn't we be able to migrate callers to relying on |
// screenPos, pagePos or clientPos? absoluteLocation appears to be the same as |
// pagePos but without browser scale applied. |
LayoutPoint m_absoluteLocation; |
+ WebPointerProperties m_pointerProperties; |
}; |
} // namespace blink |