Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 TouchTargetAndDispatchResultTypeMax)); | 192 TouchTargetAndDispatchResultTypeMax)); |
| 193 rootDocumentListenerHistogram.count( | 193 rootDocumentListenerHistogram.count( |
| 194 static_cast<TouchTargetAndDispatchResultType>(result)); | 194 static_cast<TouchTargetAndDispatchResultType>(result)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace | 197 } // namespace |
| 198 | 198 |
| 199 TouchEvent::TouchEvent() | 199 TouchEvent::TouchEvent() |
| 200 : m_causesScrollingIfUncanceled(false), | 200 : m_causesScrollingIfUncanceled(false), |
| 201 m_firstTouchMoveOrStart(false), | 201 m_firstTouchMoveOrStart(false), |
| 202 m_defaultPreventedBeforeCurrentTarget(false) {} | 202 m_defaultPreventedBeforeCurrentTarget(false), |
| 203 m_currentTouchAction(TouchActionAuto) {} | |
| 203 | 204 |
| 204 TouchEvent::TouchEvent(TouchList* touches, | 205 TouchEvent::TouchEvent(TouchList* touches, |
| 205 TouchList* targetTouches, | 206 TouchList* targetTouches, |
| 206 TouchList* changedTouches, | 207 TouchList* changedTouches, |
| 207 const AtomicString& type, | 208 const AtomicString& type, |
| 208 AbstractView* view, | 209 AbstractView* view, |
| 209 PlatformEvent::Modifiers modifiers, | 210 PlatformEvent::Modifiers modifiers, |
| 210 bool cancelable, | 211 bool cancelable, |
| 211 bool causesScrollingIfUncanceled, | 212 bool causesScrollingIfUncanceled, |
| 212 bool firstTouchMoveOrStart, | 213 bool firstTouchMoveOrStart, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 233 m_currentTouchAction(currentTouchAction) {} | 234 m_currentTouchAction(currentTouchAction) {} |
| 234 | 235 |
| 235 TouchEvent::TouchEvent(const AtomicString& type, | 236 TouchEvent::TouchEvent(const AtomicString& type, |
| 236 const TouchEventInit& initializer) | 237 const TouchEventInit& initializer) |
| 237 : UIEventWithKeyState(type, initializer), | 238 : UIEventWithKeyState(type, initializer), |
| 238 m_touches(TouchList::create(initializer.touches())), | 239 m_touches(TouchList::create(initializer.touches())), |
| 239 m_targetTouches(TouchList::create(initializer.targetTouches())), | 240 m_targetTouches(TouchList::create(initializer.targetTouches())), |
| 240 m_changedTouches(TouchList::create(initializer.changedTouches())), | 241 m_changedTouches(TouchList::create(initializer.changedTouches())), |
| 241 m_causesScrollingIfUncanceled(false), | 242 m_causesScrollingIfUncanceled(false), |
| 242 m_firstTouchMoveOrStart(false), | 243 m_firstTouchMoveOrStart(false), |
| 243 m_defaultPreventedBeforeCurrentTarget(false) {} | 244 m_defaultPreventedBeforeCurrentTarget(false), |
| 245 m_currentTouchAction(TouchActionAuto) {} | |
| 244 | 246 |
| 245 TouchEvent::~TouchEvent() {} | 247 TouchEvent::~TouchEvent() {} |
| 246 | 248 |
| 247 const AtomicString& TouchEvent::interfaceName() const { | 249 const AtomicString& TouchEvent::interfaceName() const { |
| 248 return EventNames::TouchEvent; | 250 return EventNames::TouchEvent; |
| 249 } | 251 } |
| 250 | 252 |
| 251 bool TouchEvent::isTouchEvent() const { | 253 bool TouchEvent::isTouchEvent() const { |
| 252 return true; | 254 return true; |
| 253 } | 255 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 return TouchEventDispatchMediator::create(this); | 307 return TouchEventDispatchMediator::create(this); |
| 306 } | 308 } |
| 307 | 309 |
| 308 DEFINE_TRACE(TouchEvent) { | 310 DEFINE_TRACE(TouchEvent) { |
| 309 visitor->trace(m_touches); | 311 visitor->trace(m_touches); |
| 310 visitor->trace(m_targetTouches); | 312 visitor->trace(m_targetTouches); |
| 311 visitor->trace(m_changedTouches); | 313 visitor->trace(m_changedTouches); |
| 312 UIEventWithKeyState::trace(visitor); | 314 UIEventWithKeyState::trace(visitor); |
| 313 } | 315 } |
| 314 | 316 |
| 317 bool TouchEvent::shouldLogPassiveDevtoolsWarning() const { | |
| 318 return m_currentTouchAction == TouchActionAuto; | |
|
Rick Byers
2016/11/22 20:40:33
nit: add a comment explaining why we disable the w
| |
| 319 } | |
| 320 | |
| 315 TouchEventDispatchMediator* TouchEventDispatchMediator::create( | 321 TouchEventDispatchMediator* TouchEventDispatchMediator::create( |
| 316 TouchEvent* touchEvent) { | 322 TouchEvent* touchEvent) { |
| 317 return new TouchEventDispatchMediator(touchEvent); | 323 return new TouchEventDispatchMediator(touchEvent); |
| 318 } | 324 } |
| 319 | 325 |
| 320 TouchEventDispatchMediator::TouchEventDispatchMediator(TouchEvent* touchEvent) | 326 TouchEventDispatchMediator::TouchEventDispatchMediator(TouchEvent* touchEvent) |
| 321 : EventDispatchMediator(touchEvent) {} | 327 : EventDispatchMediator(touchEvent) {} |
| 322 | 328 |
| 323 TouchEvent& TouchEventDispatchMediator::event() const { | 329 TouchEvent& TouchEventDispatchMediator::event() const { |
| 324 return toTouchEvent(EventDispatchMediator::event()); | 330 return toTouchEvent(EventDispatchMediator::event()); |
| 325 } | 331 } |
| 326 | 332 |
| 327 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( | 333 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( |
| 328 EventDispatcher& dispatcher) const { | 334 EventDispatcher& dispatcher) const { |
| 329 event().eventPath().adjustForTouchEvent(event()); | 335 event().eventPath().adjustForTouchEvent(event()); |
| 330 return dispatcher.dispatch(); | 336 return dispatcher.dispatch(); |
| 331 } | 337 } |
| 332 | 338 |
| 333 } // namespace blink | 339 } // namespace blink |
| OLD | NEW |