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

Side by Side Diff: third_party/WebKit/Source/core/events/GestureEvent.cpp

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 (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
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 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "core/events/GestureEvent.h" 26 #include "core/events/GestureEvent.h"
27 27
28 #include "core/dom/Element.h" 28 #include "core/dom/Element.h"
29 #include "wtf/text/AtomicString.h" 29 #include "wtf/text/AtomicString.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 PassRefPtrWillBeRawPtr<GestureEvent> GestureEvent::create(PassRefPtrWillBeRawPtr <AbstractView> view, const PlatformGestureEvent& event) 33 RawPtr<GestureEvent> GestureEvent::create(RawPtr<AbstractView> view, const Platf ormGestureEvent& event)
34 { 34 {
35 AtomicString eventType; 35 AtomicString eventType;
36 float deltaX = 0; 36 float deltaX = 0;
37 float deltaY = 0; 37 float deltaY = 0;
38 float velocityX = 0; 38 float velocityX = 0;
39 float velocityY = 0; 39 float velocityY = 0;
40 bool inertial = false; 40 bool inertial = false;
41 41
42 GestureSource source = GestureSourceUninitialized; 42 GestureSource source = GestureSourceUninitialized;
43 switch (event.source()) { 43 switch (event.source()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 velocityY = event.velocityY(); 80 velocityY = event.velocityY();
81 break; 81 break;
82 case PlatformEvent::GestureTwoFingerTap: 82 case PlatformEvent::GestureTwoFingerTap:
83 case PlatformEvent::GesturePinchBegin: 83 case PlatformEvent::GesturePinchBegin:
84 case PlatformEvent::GesturePinchEnd: 84 case PlatformEvent::GesturePinchEnd:
85 case PlatformEvent::GesturePinchUpdate: 85 case PlatformEvent::GesturePinchUpdate:
86 case PlatformEvent::GestureTapDownCancel: 86 case PlatformEvent::GestureTapDownCancel:
87 default: 87 default:
88 return nullptr; 88 return nullptr;
89 } 89 }
90 return adoptRefWillBeNoop(new GestureEvent(eventType, view, event.globalPosi tion().x(), event.globalPosition().y(), event.position().x(), event.position().y (), event.modifiers(), deltaX, deltaY, velocityX, velocityY, inertial, event.tim estamp(), event.resendingPluginId(), source)); 90 return (new GestureEvent(eventType, view, event.globalPosition().x(), event. globalPosition().y(), event.position().x(), event.position().y(), event.modifier s(), deltaX, deltaY, velocityX, velocityY, inertial, event.timestamp(), event.re sendingPluginId(), source));
91 } 91 }
92 92
93 const AtomicString& GestureEvent::interfaceName() const 93 const AtomicString& GestureEvent::interfaceName() const
94 { 94 {
95 // FIXME: when a GestureEvent.idl interface is defined, return the string "G estureEvent". 95 // FIXME: when a GestureEvent.idl interface is defined, return the string "G estureEvent".
96 // Until that happens, do not advertise an interface that does not exist, si nce it will 96 // Until that happens, do not advertise an interface that does not exist, si nce it will
97 // trip up the bindings integrity checks. 97 // trip up the bindings integrity checks.
98 return UIEvent::interfaceName(); 98 return UIEvent::interfaceName();
99 } 99 }
100 100
101 bool GestureEvent::isGestureEvent() const 101 bool GestureEvent::isGestureEvent() const
102 { 102 {
103 return true; 103 return true;
104 } 104 }
105 105
106 GestureEvent::GestureEvent() 106 GestureEvent::GestureEvent()
107 : m_deltaX(0) 107 : m_deltaX(0)
108 , m_deltaY(0) 108 , m_deltaY(0)
109 , m_velocityX(0) 109 , m_velocityX(0)
110 , m_velocityY(0) 110 , m_velocityY(0)
111 , m_inertial(false) 111 , m_inertial(false)
112 , m_source(GestureSourceUninitialized) 112 , m_source(GestureSourceUninitialized)
113 , m_resendingPluginId(-1) 113 , m_resendingPluginId(-1)
114 { 114 {
115 } 115 }
116 116
117 GestureEvent::GestureEvent(const AtomicString& type, PassRefPtrWillBeRawPtr<Abst ractView> view, int screenX, int screenY, int clientX, int clientY, PlatformEven t::Modifiers modifiers, float deltaX, float deltaY, float velocityX, float veloc ityY, bool inertial, double platformTimeStamp, int resendingPluginId, GestureSou rce source) 117 GestureEvent::GestureEvent(const AtomicString& type, RawPtr<AbstractView> view, int screenX, int screenY, int clientX, int clientY, PlatformEvent::Modifiers mod ifiers, float deltaX, float deltaY, float velocityX, float velocityY, bool inert ial, double platformTimeStamp, int resendingPluginId, GestureSource source)
118 : MouseRelatedEvent(type, true, true, view, 0, IntPoint(screenX, screenY), I ntPoint(clientX, clientY), IntPoint(0, 0), modifiers, platformTimeStamp, Positio nType::Position) 118 : MouseRelatedEvent(type, true, true, view, 0, IntPoint(screenX, screenY), I ntPoint(clientX, clientY), IntPoint(0, 0), modifiers, platformTimeStamp, Positio nType::Position)
119 , m_deltaX(deltaX) 119 , m_deltaX(deltaX)
120 , m_deltaY(deltaY) 120 , m_deltaY(deltaY)
121 , m_velocityX(velocityX) 121 , m_velocityX(velocityX)
122 , m_velocityY(velocityY) 122 , m_velocityY(velocityY)
123 , m_inertial(inertial) 123 , m_inertial(inertial)
124 , m_source(source) 124 , m_source(source)
125 , m_resendingPluginId(resendingPluginId) 125 , m_resendingPluginId(resendingPluginId)
126 { 126 {
127 } 127 }
128 128
129 PassRefPtrWillBeRawPtr<EventDispatchMediator> GestureEvent::createMediator() 129 RawPtr<EventDispatchMediator> GestureEvent::createMediator()
130 { 130 {
131 return GestureEventDispatchMediator::create(this); 131 return GestureEventDispatchMediator::create(this);
132 } 132 }
133 133
134 DEFINE_TRACE(GestureEvent) 134 DEFINE_TRACE(GestureEvent)
135 { 135 {
136 MouseRelatedEvent::trace(visitor); 136 MouseRelatedEvent::trace(visitor);
137 } 137 }
138 138
139 GestureEventDispatchMediator::GestureEventDispatchMediator(PassRefPtrWillBeRawPt r<GestureEvent> gestureEvent) 139 GestureEventDispatchMediator::GestureEventDispatchMediator(RawPtr<GestureEvent> gestureEvent)
140 : EventDispatchMediator(gestureEvent) 140 : EventDispatchMediator(gestureEvent)
141 { 141 {
142 } 142 }
143 143
144 GestureEvent& GestureEventDispatchMediator::event() const 144 GestureEvent& GestureEventDispatchMediator::event() const
145 { 145 {
146 return toGestureEvent(EventDispatchMediator::event()); 146 return toGestureEvent(EventDispatchMediator::event());
147 } 147 }
148 148
149 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) co nst 149 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) co nst
150 { 150 {
151 dispatcher.dispatch(); 151 dispatcher.dispatch();
152 ASSERT(!event().defaultPrevented()); 152 ASSERT(!event().defaultPrevented());
153 return event().defaultHandled() || event().defaultPrevented(); 153 return event().defaultHandled() || event().defaultPrevented();
154 } 154 }
155 155
156 } // namespace blink 156 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698