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

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

Issue 2507503002: Use touch events to report stylus events (Closed)
Patch Set: I should pay attention... Created 4 years 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 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 TouchEvent::TouchEvent(TouchList* touches, 205 TouchEvent::TouchEvent(TouchList* touches,
206 TouchList* targetTouches, 206 TouchList* targetTouches,
207 TouchList* changedTouches, 207 TouchList* changedTouches,
208 const AtomicString& type, 208 const AtomicString& type,
209 AbstractView* view, 209 AbstractView* view,
210 PlatformEvent::Modifiers modifiers, 210 PlatformEvent::Modifiers modifiers,
211 bool cancelable, 211 bool cancelable,
212 bool causesScrollingIfUncanceled, 212 bool causesScrollingIfUncanceled,
213 bool firstTouchMoveOrStart, 213 bool firstTouchMoveOrStart,
214 double platformTimeStamp, 214 double platformTimeStamp,
215 TouchAction currentTouchAction) 215 TouchAction currentTouchAction,
216 WebPointerProperties::PointerType pointerType)
216 // Pass a sourceCapabilities including the ability to fire touchevents when 217 // Pass a sourceCapabilities including the ability to fire touchevents when
217 // creating this touchevent, which is always created from input device 218 // creating this touchevent, which is always created from input device
218 // capabilities from EventHandler. 219 // capabilities from EventHandler.
219 : UIEventWithKeyState( 220 : UIEventWithKeyState(
220 type, 221 type,
221 true, 222 true,
222 cancelable, 223 cancelable,
223 view, 224 view,
224 0, 225 0,
225 modifiers, 226 modifiers,
226 platformTimeStamp, 227 platformTimeStamp,
227 InputDeviceCapabilities::firesTouchEventsSourceCapabilities()), 228 InputDeviceCapabilities::firesTouchEventsSourceCapabilities()),
228 m_touches(touches), 229 m_touches(touches),
229 m_targetTouches(targetTouches), 230 m_targetTouches(targetTouches),
230 m_changedTouches(changedTouches), 231 m_changedTouches(changedTouches),
231 m_causesScrollingIfUncanceled(causesScrollingIfUncanceled), 232 m_causesScrollingIfUncanceled(causesScrollingIfUncanceled),
232 m_firstTouchMoveOrStart(firstTouchMoveOrStart), 233 m_firstTouchMoveOrStart(firstTouchMoveOrStart),
233 m_defaultPreventedBeforeCurrentTarget(false), 234 m_defaultPreventedBeforeCurrentTarget(false),
234 m_currentTouchAction(currentTouchAction) {} 235 m_currentTouchAction(currentTouchAction),
236 m_pointerType(pointerType) {}
235 237
236 TouchEvent::TouchEvent(const AtomicString& type, 238 TouchEvent::TouchEvent(const AtomicString& type,
237 const TouchEventInit& initializer) 239 const TouchEventInit& initializer)
238 : UIEventWithKeyState(type, initializer), 240 : UIEventWithKeyState(type, initializer),
239 m_touches(TouchList::create(initializer.touches())), 241 m_touches(TouchList::create(initializer.touches())),
240 m_targetTouches(TouchList::create(initializer.targetTouches())), 242 m_targetTouches(TouchList::create(initializer.targetTouches())),
241 m_changedTouches(TouchList::create(initializer.changedTouches())), 243 m_changedTouches(TouchList::create(initializer.changedTouches())),
242 m_causesScrollingIfUncanceled(false), 244 m_causesScrollingIfUncanceled(false),
243 m_firstTouchMoveOrStart(false), 245 m_firstTouchMoveOrStart(false),
244 m_defaultPreventedBeforeCurrentTarget(false), 246 m_defaultPreventedBeforeCurrentTarget(false),
245 m_currentTouchAction(TouchActionAuto) {} 247 m_currentTouchAction(TouchActionAuto),
248 m_pointerType(WebPointerProperties::PointerType::Unknown) {}
246 249
247 TouchEvent::~TouchEvent() {} 250 TouchEvent::~TouchEvent() {}
248 251
249 const AtomicString& TouchEvent::interfaceName() const { 252 const AtomicString& TouchEvent::interfaceName() const {
250 return EventNames::TouchEvent; 253 return EventNames::TouchEvent;
251 } 254 }
252 255
253 bool TouchEvent::isTouchEvent() const { 256 bool TouchEvent::isTouchEvent() const {
254 return true; 257 return true;
255 } 258 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return toTouchEvent(EventDispatchMediator::event()); 352 return toTouchEvent(EventDispatchMediator::event());
350 } 353 }
351 354
352 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( 355 DispatchEventResult TouchEventDispatchMediator::dispatchEvent(
353 EventDispatcher& dispatcher) const { 356 EventDispatcher& dispatcher) const {
354 event().eventPath().adjustForTouchEvent(event()); 357 event().eventPath().adjustForTouchEvent(event());
355 return dispatcher.dispatch(); 358 return dispatcher.dispatch();
356 } 359 }
357 360
358 } // namespace blink 361 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/TouchEvent.h ('k') | third_party/WebKit/Source/core/input/TouchEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698