| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/input/web_touch_event_traits.h" | 5 #include "content/common/input/web_touch_event_traits.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void WebTouchEventTraits::ResetType(WebInputEvent::Type type, | 51 void WebTouchEventTraits::ResetType(WebInputEvent::Type type, |
| 52 double timestamp_sec, | 52 double timestamp_sec, |
| 53 WebTouchEvent* event) { | 53 WebTouchEvent* event) { |
| 54 DCHECK(WebInputEvent::isTouchEventType(type)); | 54 DCHECK(WebInputEvent::isTouchEventType(type)); |
| 55 DCHECK(type != WebInputEvent::TouchScrollStarted); | 55 DCHECK(type != WebInputEvent::TouchScrollStarted); |
| 56 | 56 |
| 57 event->type = type; | 57 event->type = type; |
| 58 event->cancelable = (type != WebInputEvent::TouchCancel); | 58 event->dispatchType = type == WebInputEvent::TouchCancel |
| 59 ? WebInputEvent::EventNonBlocking |
| 60 : WebInputEvent::Blocking; |
| 59 event->timeStampSeconds = timestamp_sec; | 61 event->timeStampSeconds = timestamp_sec; |
| 60 } | 62 } |
| 61 | 63 |
| 62 void WebTouchEventTraits::ResetTypeAndTouchStates(WebInputEvent::Type type, | 64 void WebTouchEventTraits::ResetTypeAndTouchStates(WebInputEvent::Type type, |
| 63 double timestamp_sec, | 65 double timestamp_sec, |
| 64 WebTouchEvent* event) { | 66 WebTouchEvent* event) { |
| 65 ResetType(type, timestamp_sec, event); | 67 ResetType(type, timestamp_sec, event); |
| 66 | 68 |
| 67 WebTouchPoint::State newState = WebTouchPoint::StateUndefined; | 69 WebTouchPoint::State newState = WebTouchPoint::StateUndefined; |
| 68 switch (event->type) { | 70 switch (event->type) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 break; | 82 break; |
| 81 default: | 83 default: |
| 82 NOTREACHED(); | 84 NOTREACHED(); |
| 83 break; | 85 break; |
| 84 } | 86 } |
| 85 for (size_t i = 0; i < event->touchesLength; ++i) | 87 for (size_t i = 0; i < event->touchesLength; ++i) |
| 86 event->touches[i].state = newState; | 88 event->touches[i].state = newState; |
| 87 } | 89 } |
| 88 | 90 |
| 89 } // namespace content | 91 } // namespace content |
| OLD | NEW |