| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include "core/events/TouchEvent.h" | 27 #include "core/events/TouchEvent.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/DOMWrapperWorld.h" | 29 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 30 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
| 31 #include "core/events/EventDispatcher.h" | 31 #include "core/events/EventDispatcher.h" |
| 32 #include "core/frame/FrameConsole.h" | 32 #include "core/frame/FrameConsole.h" |
| 33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
| 34 #include "core/frame/LocalDOMWindow.h" | 34 #include "core/frame/LocalDOMWindow.h" |
| 35 #include "core/html/HTMLElement.h" | 35 #include "core/html/HTMLElement.h" |
| 36 #include "core/input/InputDeviceCapabilities.h" |
| 36 #include "core/inspector/ConsoleMessage.h" | 37 #include "core/inspector/ConsoleMessage.h" |
| 37 #include "platform/Histogram.h" | 38 #include "platform/Histogram.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 // These offsets change indicies into the ListenerHistogram | 44 // These offsets change indicies into the ListenerHistogram |
| 44 // enumeration. The addition of a series of offsets then | 45 // enumeration. The addition of a series of offsets then |
| 45 // produces the resulting ListenerHistogram value. | 46 // produces the resulting ListenerHistogram value. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // creating this touchevent, which is always created from input device | 212 // creating this touchevent, which is always created from input device |
| 212 // capabilities from EventHandler. | 213 // capabilities from EventHandler. |
| 213 : UIEventWithKeyState( | 214 : UIEventWithKeyState( |
| 214 type, | 215 type, |
| 215 true, | 216 true, |
| 216 event.isCancelable(), | 217 event.isCancelable(), |
| 217 view, | 218 view, |
| 218 0, | 219 0, |
| 219 static_cast<PlatformEvent::Modifiers>(event.modifiers()), | 220 static_cast<PlatformEvent::Modifiers>(event.modifiers()), |
| 220 TimeTicks::FromSeconds(event.timeStampSeconds()), | 221 TimeTicks::FromSeconds(event.timeStampSeconds()), |
| 221 InputDeviceCapabilities::firesTouchEventsSourceCapabilities()), | 222 view ? view->getInputDeviceCapabilities()->firesTouchEvents(true) |
| 223 : nullptr), |
| 222 m_touches(touches), | 224 m_touches(touches), |
| 223 m_targetTouches(targetTouches), | 225 m_targetTouches(targetTouches), |
| 224 m_changedTouches(changedTouches), | 226 m_changedTouches(changedTouches), |
| 225 m_defaultPreventedBeforeCurrentTarget(false), | 227 m_defaultPreventedBeforeCurrentTarget(false), |
| 226 m_currentTouchAction(currentTouchAction) { | 228 m_currentTouchAction(currentTouchAction) { |
| 227 m_nativeEvent.reset(new WebTouchEvent(event)); | 229 m_nativeEvent.reset(new WebTouchEvent(event)); |
| 228 } | 230 } |
| 229 | 231 |
| 230 TouchEvent::TouchEvent(const AtomicString& type, | 232 TouchEvent::TouchEvent(const AtomicString& type, |
| 231 const TouchEventInit& initializer) | 233 const TouchEventInit& initializer) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 return toTouchEvent(EventDispatchMediator::event()); | 348 return toTouchEvent(EventDispatchMediator::event()); |
| 347 } | 349 } |
| 348 | 350 |
| 349 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( | 351 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( |
| 350 EventDispatcher& dispatcher) const { | 352 EventDispatcher& dispatcher) const { |
| 351 event().eventPath().adjustForTouchEvent(event()); | 353 event().eventPath().adjustForTouchEvent(event()); |
| 352 return dispatcher.dispatch(); | 354 return dispatcher.dispatch(); |
| 353 } | 355 } |
| 354 | 356 |
| 355 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |