| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 { | 34 { |
| 35 AtomicString eventType; | 35 AtomicString eventType; |
| 36 float deltaX = 0; | 36 float deltaX = 0; |
| 37 float deltaY = 0; | 37 float deltaY = 0; |
| 38 switch (event.type()) { | 38 switch (event.type()) { |
| 39 case PlatformEvent::GestureScrollBegin: | 39 case PlatformEvent::GestureScrollBegin: |
| 40 eventType = EventTypeNames::gesturescrollstart; break; | 40 eventType = EventTypeNames::gesturescrollstart; break; |
| 41 case PlatformEvent::GestureScrollEnd: | 41 case PlatformEvent::GestureScrollEnd: |
| 42 eventType = EventTypeNames::gesturescrollend; break; | 42 eventType = EventTypeNames::gesturescrollend; break; |
| 43 case PlatformEvent::GestureScrollUpdate: | 43 case PlatformEvent::GestureScrollUpdate: |
| 44 case PlatformEvent::GestureScrollUpdateWithoutPropagation: | |
| 45 // Only deltaX/Y are used when converting this | 44 // Only deltaX/Y are used when converting this |
| 46 // back to a PlatformGestureEvent. | 45 // back to a PlatformGestureEvent. |
| 47 eventType = EventTypeNames::gesturescrollupdate; | 46 eventType = EventTypeNames::gesturescrollupdate; |
| 48 deltaX = event.deltaX(); | 47 deltaX = event.deltaX(); |
| 49 deltaY = event.deltaY(); | 48 deltaY = event.deltaY(); |
| 50 break; | 49 break; |
| 51 case PlatformEvent::GestureTap: | 50 case PlatformEvent::GestureTap: |
| 52 eventType = EventTypeNames::gesturetap; break; | 51 eventType = EventTypeNames::gesturetap; break; |
| 53 case PlatformEvent::GestureTapUnconfirmed: | 52 case PlatformEvent::GestureTapUnconfirmed: |
| 54 eventType = EventTypeNames::gesturetapunconfirmed; break; | 53 eventType = EventTypeNames::gesturetapunconfirmed; break; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 109 } |
| 111 | 110 |
| 112 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) co
nst | 111 bool GestureEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) co
nst |
| 113 { | 112 { |
| 114 dispatcher->dispatch(); | 113 dispatcher->dispatch(); |
| 115 ASSERT(!event()->defaultPrevented()); | 114 ASSERT(!event()->defaultPrevented()); |
| 116 return event()->defaultHandled() || event()->defaultPrevented(); | 115 return event()->defaultHandled() || event()->defaultPrevented(); |
| 117 } | 116 } |
| 118 | 117 |
| 119 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |