OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_input_event_traits.h" | 5 #include "content/common/input/web_input_event_traits.h" |
6 | 6 |
7 #include <bitset> | 7 #include <bitset> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 event.data.scrollUpdate.deltaX, | 84 event.data.scrollUpdate.deltaX, |
85 event.data.scrollUpdate.deltaY, | 85 event.data.scrollUpdate.deltaY, |
86 event.data.scrollUpdate.velocityX, | 86 event.data.scrollUpdate.velocityX, |
87 event.data.scrollUpdate.velocityY, | 87 event.data.scrollUpdate.velocityY, |
88 event.data.scrollUpdate.previousUpdateInSequencePrevented); | 88 event.data.scrollUpdate.previousUpdateInSequencePrevented); |
89 } | 89 } |
90 | 90 |
91 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) { | 91 void ApppendTouchPointDetails(const WebTouchPoint& point, std::string* result) { |
92 StringAppendF(result, | 92 StringAppendF(result, |
93 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f)," | 93 " (ID: %d, State: %d, ScreenPos: (%f, %f), Pos: (%f, %f)," |
94 " Radius: (%f, %f), Rot: %f, Force: %f),\n", | 94 " Radius: (%f, %f), Rot: %f, Force: %f," |
| 95 " Tilt: (%d, %d)),\n", |
95 point.id, | 96 point.id, |
96 point.state, | 97 point.state, |
97 point.screenPosition.x, | 98 point.screenPosition.x, |
98 point.screenPosition.y, | 99 point.screenPosition.y, |
99 point.position.x, | 100 point.position.x, |
100 point.position.y, | 101 point.position.y, |
101 point.radiusX, | 102 point.radiusX, |
102 point.radiusY, | 103 point.radiusY, |
103 point.rotationAngle, | 104 point.rotationAngle, |
104 point.force); | 105 point.force, |
| 106 point.tiltX, |
| 107 point.tiltY); |
105 } | 108 } |
106 | 109 |
107 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { | 110 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { |
108 StringAppendF(result, | 111 StringAppendF(result, |
109 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d," | 112 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d," |
110 " uniqueTouchEventId: %u\n[\n", | 113 " uniqueTouchEventId: %u\n[\n", |
111 event.touchesLength, event.cancelable, | 114 event.touchesLength, event.cancelable, |
112 event.causesScrollingIfUncanceled, event.uniqueTouchEventId); | 115 event.causesScrollingIfUncanceled, event.uniqueTouchEventId); |
113 for (unsigned i = 0; i < event.touchesLength; ++i) | 116 for (unsigned i = 0; i < event.touchesLength; ++i) |
114 ApppendTouchPointDetails(event.touches[i], result); | 117 ApppendTouchPointDetails(event.touches[i], result); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 489 } |
487 | 490 |
488 uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) { | 491 uint32 WebInputEventTraits::GetUniqueTouchEventId(const WebInputEvent& event) { |
489 if (WebInputEvent::isTouchEventType(event.type)) { | 492 if (WebInputEvent::isTouchEventType(event.type)) { |
490 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; | 493 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; |
491 } | 494 } |
492 return 0U; | 495 return 0U; |
493 } | 496 } |
494 | 497 |
495 } // namespace content | 498 } // namespace content |
OLD | NEW |