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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 void TouchEvent::preventDefault() | 92 void TouchEvent::preventDefault() |
93 { | 93 { |
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() && view()->frame()->isLocalFr
ame()) { |
100 view()->frame()->console().addMessage(ConsoleMessage::create(JSMessageSo
urce, WarningMessageLevel, | 100 toLocalFrame(view()->frame())->console().addMessage(ConsoleMessage::crea
te(JSMessageSource, 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) | 104 void TouchEvent::trace(Visitor* visitor) |
105 { | 105 { |
106 visitor->trace(m_touches); | 106 visitor->trace(m_touches); |
107 visitor->trace(m_targetTouches); | 107 visitor->trace(m_targetTouches); |
108 visitor->trace(m_changedTouches); | 108 visitor->trace(m_changedTouches); |
109 UIEventWithKeyState::trace(visitor); | 109 UIEventWithKeyState::trace(visitor); |
110 } | 110 } |
(...skipping 13 matching lines...) Expand all Loading... |
124 return toTouchEvent(EventDispatchMediator::event()); | 124 return toTouchEvent(EventDispatchMediator::event()); |
125 } | 125 } |
126 | 126 |
127 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t | 127 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
t |
128 { | 128 { |
129 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event()); | 129 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event()); |
130 return dispatcher->dispatch(); | 130 return dispatcher->dispatch(); |
131 } | 131 } |
132 | 132 |
133 } // namespace blink | 133 } // namespace blink |
OLD | NEW |