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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 UIEventWithKeyState::preventDefault(); | 102 UIEventWithKeyState::preventDefault(); |
103 | 103 |
104 // A common developer error is to wait too long before attempting to stop | 104 // A common developer error is to wait too long before attempting to stop |
105 // scrolling by consuming a touchmove event. Generate a warning if this | 105 // scrolling by consuming a touchmove event. Generate a warning if this |
106 // event is uncancelable. | 106 // event is uncancelable. |
107 if (!cancelable() && view() && view()->isLocalDOMWindow() && view()->frame()
) { | 107 if (!cancelable() && view() && view()->isLocalDOMWindow() && view()->frame()
) { |
108 toLocalDOMWindow(view())->frame()->console().addMessage(ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, | 108 toLocalDOMWindow(view())->frame()->console().addMessage(ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, |
109 "Ignored attempt to cancel a " + type() + " event with cancelable=fa
lse, for example because scrolling is in progress and cannot be interrupted.")); | 109 "Ignored attempt to cancel a " + type() + " event with cancelable=fa
lse, for example because scrolling is in progress and cannot be interrupted.")); |
110 } | 110 } |
111 } | 111 } |
| 112 |
| 113 PassRefPtrWillBeRawPtr<EventDispatchMediator> TouchEvent::createMediator() |
| 114 { |
| 115 return TouchEventDispatchMediator::create(this); |
| 116 } |
| 117 |
112 DEFINE_TRACE(TouchEvent) | 118 DEFINE_TRACE(TouchEvent) |
113 { | 119 { |
114 visitor->trace(m_touches); | 120 visitor->trace(m_touches); |
115 visitor->trace(m_targetTouches); | 121 visitor->trace(m_targetTouches); |
116 visitor->trace(m_changedTouches); | 122 visitor->trace(m_changedTouches); |
117 UIEventWithKeyState::trace(visitor); | 123 UIEventWithKeyState::trace(visitor); |
118 } | 124 } |
119 | 125 |
120 PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::c
reate(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent) | 126 PassRefPtrWillBeRawPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::c
reate(PassRefPtrWillBeRawPtr<TouchEvent> touchEvent) |
121 { | 127 { |
(...skipping 10 matching lines...) Expand all Loading... |
132 return toTouchEvent(EventDispatchMediator::event()); | 138 return toTouchEvent(EventDispatchMediator::event()); |
133 } | 139 } |
134 | 140 |
135 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons
t | 141 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) cons
t |
136 { | 142 { |
137 event().eventPath().adjustForTouchEvent(event()); | 143 event().eventPath().adjustForTouchEvent(event()); |
138 return dispatcher.dispatch(); | 144 return dispatcher.dispatch(); |
139 } | 145 } |
140 | 146 |
141 } // namespace blink | 147 } // namespace blink |
OLD | NEW |