| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 UIEventWithKeyState::preventDefault(); | 94 UIEventWithKeyState::preventDefault(); |
| 95 | 95 |
| 96 // A common developer error is to wait too long before attempting to stop | 96 // A common developer error is to wait too long before attempting to stop |
| 97 // scrolling by consuming a touchmove event. Generate a warning if this | 97 // scrolling by consuming a touchmove event. Generate a warning if this |
| 98 // event is uncancelable. | 98 // event is uncancelable. |
| 99 if (!cancelable() && view() && view()->frame()) { | 99 if (!cancelable() && view() && view()->frame()) { |
| 100 view()->frame()->console().addMessage(ConsoleMessage::create(JSMessageSo
urce, WarningMessageLevel, | 100 view()->frame()->console().addMessage(ConsoleMessage::create(JSMessageSo
urce, WarningMessageLevel, |
| 101 "Ignored attempt to cancel a " + type() + " event with cancelable=fa
lse, for example because scrolling is in progress and cannot be interrupted.")); | 101 "Ignored attempt to cancel a " + type() + " event with cancelable=fa
lse, for example because scrolling is in progress and cannot be interrupted.")); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 void TouchEvent::trace(Visitor* visitor) | |
| 105 { | |
| 106 visitor->trace(m_touches); | |
| 107 visitor->trace(m_targetTouches); | |
| 108 visitor->trace(m_changedTouches); | |
| 109 UIEventWithKeyState::trace(visitor); | |
| 110 } | |
| 111 | 104 |
| 112 PassRefPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::create(PassRe
fPtr<TouchEvent> touchEvent) | 105 PassRefPtr<TouchEventDispatchMediator> TouchEventDispatchMediator::create(PassRe
fPtr<TouchEvent> touchEvent) |
| 113 { | 106 { |
| 114 return adoptRef(new TouchEventDispatchMediator(touchEvent)); | 107 return adoptRef(new TouchEventDispatchMediator(touchEvent)); |
| 115 } | 108 } |
| 116 | 109 |
| 117 TouchEventDispatchMediator::TouchEventDispatchMediator(PassRefPtr<TouchEvent> to
uchEvent) | 110 TouchEventDispatchMediator::TouchEventDispatchMediator(PassRefPtr<TouchEvent> to
uchEvent) |
| 118 : EventDispatchMediator(touchEvent) | 111 : EventDispatchMediator(touchEvent) |
| 119 { | 112 { |
| 120 } | 113 } |
| 121 | 114 |
| 122 TouchEvent* TouchEventDispatchMediator::event() const | 115 TouchEvent* TouchEventDispatchMediator::event() const |
| 123 { | 116 { |
| 124 return toTouchEvent(EventDispatchMediator::event()); | 117 return toTouchEvent(EventDispatchMediator::event()); |
| 125 } | 118 } |
| 126 | 119 |
| 127 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t | 120 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t |
| 128 { | 121 { |
| 129 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event()); | 122 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event()); |
| 130 return dispatcher->dispatch(); | 123 return dispatcher->dispatch(); |
| 131 } | 124 } |
| 132 | 125 |
| 133 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |