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

Unified Diff: third_party/WebKit/Source/core/dom/Touch.cpp

Issue 1415673004: Added web-exposed constructor for Touch and TouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed runtime enabled for Touch/TouchInit Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Touch.h ('k') | third_party/WebKit/Source/core/dom/Touch.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Touch.cpp
diff --git a/third_party/WebKit/Source/core/dom/Touch.cpp b/third_party/WebKit/Source/core/dom/Touch.cpp
index ad57293616162dd1ba5bf333a3d0d2f7a30a2d8d..3cea6ce14a2aca64e5bb031848930c73481fc6ec 100644
--- a/third_party/WebKit/Source/core/dom/Touch.cpp
+++ b/third_party/WebKit/Source/core/dom/Touch.cpp
@@ -71,6 +71,20 @@ Touch::Touch(EventTarget* target, int identifier, const FloatPoint& clientPos, c
{
}
+Touch::Touch(LocalFrame* frame, const TouchInit& initializer)
+ : m_target(initializer.target())
+ , m_identifier(initializer.identifier())
+ , m_clientPos(FloatPoint(initializer.clientX(), initializer.clientY()))
+ , m_screenPos(FloatPoint(initializer.screenX(), initializer.screenY()))
+ , m_pagePos(FloatPoint(initializer.pageX(), initializer.pageY()))
+ , m_radius(FloatSize(initializer.radiusX(), initializer.radiusY()))
+ , m_rotationAngle(initializer.rotationAngle())
+ , m_force(initializer.force())
+{
+ float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f;
+ m_absoluteLocation = roundedLayoutPoint(m_pagePos.scaledBy(scaleFactor));
+}
+
PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget) const
{
return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation));
« no previous file with comments | « third_party/WebKit/Source/core/dom/Touch.h ('k') | third_party/WebKit/Source/core/dom/Touch.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698