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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright 9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 , m_clientPos(clientPos) 64 , m_clientPos(clientPos)
65 , m_screenPos(screenPos) 65 , m_screenPos(screenPos)
66 , m_pagePos(pagePos) 66 , m_pagePos(pagePos)
67 , m_radius(radius) 67 , m_radius(radius)
68 , m_rotationAngle(rotationAngle) 68 , m_rotationAngle(rotationAngle)
69 , m_force(force) 69 , m_force(force)
70 , m_absoluteLocation(absoluteLocation) 70 , m_absoluteLocation(absoluteLocation)
71 { 71 {
72 } 72 }
73 73
74 Touch::Touch(LocalFrame* frame, const TouchInit& initializer)
75 : m_target(initializer.target())
76 , m_identifier(initializer.identifier())
77 , m_clientPos(FloatPoint(initializer.clientX(), initializer.clientY()))
78 , m_screenPos(FloatPoint(initializer.screenX(), initializer.screenY()))
79 , m_pagePos(FloatPoint(initializer.pageX(), initializer.pageY()))
80 , m_radius(FloatSize(initializer.radiusX(), initializer.radiusY()))
81 , m_rotationAngle(initializer.rotationAngle())
82 , m_force(initializer.force())
83 {
84 float scaleFactor = frame ? frame->pageZoomFactor() : 1.0f;
85 m_absoluteLocation = roundedLayoutPoint(m_pagePos.scaledBy(scaleFactor));
86 }
87
74 PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget ) const 88 PassRefPtrWillBeRawPtr<Touch> Touch::cloneWithNewTarget(EventTarget* eventTarget ) const
75 { 89 {
76 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation)) ; 90 return adoptRefWillBeNoop(new Touch(eventTarget, m_identifier, m_clientPos, m_screenPos, m_pagePos, m_radius, m_rotationAngle, m_force, m_absoluteLocation)) ;
77 } 91 }
78 92
79 DEFINE_TRACE(Touch) 93 DEFINE_TRACE(Touch)
80 { 94 {
81 visitor->trace(m_target); 95 visitor->trace(m_target);
82 } 96 }
83 97
84 } // namespace blink 98 } // namespace blink
OLDNEW
« 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