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

Side by Side Diff: third_party/WebKit/Source/core/dom/Touch.h

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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 25 matching lines...) Expand all
36 #include "platform/geometry/LayoutPoint.h" 36 #include "platform/geometry/LayoutPoint.h"
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 #include "wtf/PassRefPtr.h" 38 #include "wtf/PassRefPtr.h"
39 #include "wtf/RefCounted.h" 39 #include "wtf/RefCounted.h"
40 #include "wtf/RefPtr.h" 40 #include "wtf/RefPtr.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 class LocalFrame; 44 class LocalFrame;
45 45
46 class CORE_EXPORT Touch final : public RefCountedWillBeGarbageCollected<Touch>, public ScriptWrappable { 46 class CORE_EXPORT Touch final : public GarbageCollected<Touch>, public ScriptWra ppable {
47 DEFINE_WRAPPERTYPEINFO(); 47 DEFINE_WRAPPERTYPEINFO();
48 public: 48 public:
49 static PassRefPtrWillBeRawPtr<Touch> create(LocalFrame* frame, EventTarget* target, 49 static RawPtr<Touch> create(LocalFrame* frame, EventTarget* target,
50 int identifier, const FloatPoint& screenPos, const FloatPoint& pagePos, 50 int identifier, const FloatPoint& screenPos, const FloatPoint& pagePos,
51 const FloatSize& radius, float rotationAngle, float force) 51 const FloatSize& radius, float rotationAngle, float force)
52 { 52 {
53 return adoptRefWillBeNoop( 53 return (
54 new Touch(frame, target, identifier, screenPos, pagePos, radius, rot ationAngle, force)); 54 new Touch(frame, target, identifier, screenPos, pagePos, radius, rot ationAngle, force));
55 } 55 }
56 56
57 static PassRefPtrWillBeRawPtr<Touch> create(const Document& document, const TouchInit& initializer) 57 static RawPtr<Touch> create(const Document& document, const TouchInit& initi alizer)
58 { 58 {
59 return adoptRefWillBeNoop(new Touch(document.frame(), initializer)); 59 return (new Touch(document.frame(), initializer));
60 } 60 }
61 61
62 // DOM Touch implementation 62 // DOM Touch implementation
63 EventTarget* target() const { return m_target.get(); } 63 EventTarget* target() const { return m_target.get(); }
64 int identifier() const { return m_identifier; } 64 int identifier() const { return m_identifier; }
65 double clientX() const { return m_clientPos.x(); } 65 double clientX() const { return m_clientPos.x(); }
66 double clientY() const { return m_clientPos.y(); } 66 double clientY() const { return m_clientPos.y(); }
67 double screenX() const { return m_screenPos.x(); } 67 double screenX() const { return m_screenPos.x(); }
68 double screenY() const { return m_screenPos.y(); } 68 double screenY() const { return m_screenPos.y(); }
69 double pageX() const { return m_pagePos.x(); } 69 double pageX() const { return m_pagePos.x(); }
70 double pageY() const { return m_pagePos.y(); } 70 double pageY() const { return m_pagePos.y(); }
71 float radiusX() const { return m_radius.width(); } 71 float radiusX() const { return m_radius.width(); }
72 float radiusY() const { return m_radius.height(); } 72 float radiusY() const { return m_radius.height(); }
73 float rotationAngle() const { return m_rotationAngle; } 73 float rotationAngle() const { return m_rotationAngle; }
74 float force() const { return m_force; } 74 float force() const { return m_force; }
75 75
76 // Blink-internal methods 76 // Blink-internal methods
77 const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; } 77 const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
78 const FloatPoint& screenLocation() const { return m_screenPos; } 78 const FloatPoint& screenLocation() const { return m_screenPos; }
79 PassRefPtrWillBeRawPtr<Touch> cloneWithNewTarget(EventTarget*) const; 79 RawPtr<Touch> cloneWithNewTarget(EventTarget*) const;
80 80
81 DECLARE_TRACE(); 81 DECLARE_TRACE();
82 82
83 private: 83 private:
84 Touch(LocalFrame*, EventTarget*, int identifier, 84 Touch(LocalFrame*, EventTarget*, int identifier,
85 const FloatPoint& screenPos, const FloatPoint& pagePos, 85 const FloatPoint& screenPos, const FloatPoint& pagePos,
86 const FloatSize& radius, float rotationAngle, float force); 86 const FloatSize& radius, float rotationAngle, float force);
87 87
88 Touch(EventTarget*, int identifier, const FloatPoint& clientPos, 88 Touch(EventTarget*, int identifier, const FloatPoint& clientPos,
89 const FloatPoint& screenPos, const FloatPoint& pagePos, 89 const FloatPoint& screenPos, const FloatPoint& pagePos,
90 const FloatSize& radius, float rotationAngle, float force, LayoutPoint a bsoluteLocation); 90 const FloatSize& radius, float rotationAngle, float force, LayoutPoint a bsoluteLocation);
91 91
92 Touch(LocalFrame*, const TouchInit&); 92 Touch(LocalFrame*, const TouchInit&);
93 93
94 RefPtrWillBeMember<EventTarget> m_target; 94 Member<EventTarget> m_target;
95 int m_identifier; 95 int m_identifier;
96 // Position relative to the viewport in CSS px. 96 // Position relative to the viewport in CSS px.
97 FloatPoint m_clientPos; 97 FloatPoint m_clientPos;
98 // Position relative to the screen in DIPs. 98 // Position relative to the screen in DIPs.
99 FloatPoint m_screenPos; 99 FloatPoint m_screenPos;
100 // Position relative to the page in CSS px. 100 // Position relative to the page in CSS px.
101 FloatPoint m_pagePos; 101 FloatPoint m_pagePos;
102 // Radius in CSS px. 102 // Radius in CSS px.
103 FloatSize m_radius; 103 FloatSize m_radius;
104 float m_rotationAngle; 104 float m_rotationAngle;
105 float m_force; 105 float m_force;
106 // FIXME(rbyers): Shouldn't we be able to migrate callers to relying on scre enPos, pagePos 106 // FIXME(rbyers): Shouldn't we be able to migrate callers to relying on scre enPos, pagePos
107 // or clientPos? absoluteLocation appears to be the same as pagePos but with out browser 107 // or clientPos? absoluteLocation appears to be the same as pagePos but with out browser
108 // scale applied. 108 // scale applied.
109 LayoutPoint m_absoluteLocation; 109 LayoutPoint m_absoluteLocation;
110 }; 110 };
111 111
112 } // namespace blink 112 } // namespace blink
113 113
114 #endif // Touch_h 114 #endif // Touch_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698