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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 point.radiusX, | 104 point.radiusX, |
105 point.radiusY, | 105 point.radiusY, |
106 point.rotationAngle, | 106 point.rotationAngle, |
107 point.force, | 107 point.force, |
108 point.tiltX, | 108 point.tiltX, |
109 point.tiltY); | 109 point.tiltY); |
110 } | 110 } |
111 | 111 |
112 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { | 112 void ApppendEventDetails(const WebTouchEvent& event, std::string* result) { |
113 StringAppendF(result, | 113 StringAppendF(result, |
114 "{\n Touches: %u, Cancelable: %d, CausesScrolling: %d," | 114 "{\n Touches: %u, DispatchType: %d, CausesScrolling: %d," |
115 " uniqueTouchEventId: %u\n[\n", | 115 " uniqueTouchEventId: %u\n[\n", |
116 event.touchesLength, event.cancelable, | 116 event.touchesLength, event.dispatchType, |
117 event.movedBeyondSlopRegion, event.uniqueTouchEventId); | 117 event.movedBeyondSlopRegion, event.uniqueTouchEventId); |
118 for (unsigned i = 0; i < event.touchesLength; ++i) | 118 for (unsigned i = 0; i < event.touchesLength; ++i) |
119 ApppendTouchPointDetails(event.touches[i], result); | 119 ApppendTouchPointDetails(event.touches[i], result); |
120 result->append(" ]\n}"); | 120 result->append(" ]\n}"); |
121 } | 121 } |
122 | 122 |
123 bool CanCoalesce(const WebKeyboardEvent& event_to_coalesce, | 123 bool CanCoalesce(const WebKeyboardEvent& event_to_coalesce, |
124 const WebKeyboardEvent& event) { | 124 const WebKeyboardEvent& event) { |
125 return false; | 125 return false; |
126 } | 126 } |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 case WebInputEvent::MouseLeave: | 474 case WebInputEvent::MouseLeave: |
475 case WebInputEvent::ContextMenu: | 475 case WebInputEvent::ContextMenu: |
476 case WebInputEvent::GestureScrollBegin: | 476 case WebInputEvent::GestureScrollBegin: |
477 case WebInputEvent::GestureScrollEnd: | 477 case WebInputEvent::GestureScrollEnd: |
478 case WebInputEvent::GestureShowPress: | 478 case WebInputEvent::GestureShowPress: |
479 case WebInputEvent::GestureTapUnconfirmed: | 479 case WebInputEvent::GestureTapUnconfirmed: |
480 case WebInputEvent::GestureTapDown: | 480 case WebInputEvent::GestureTapDown: |
481 case WebInputEvent::GestureTapCancel: | 481 case WebInputEvent::GestureTapCancel: |
482 case WebInputEvent::GesturePinchBegin: | 482 case WebInputEvent::GesturePinchBegin: |
483 case WebInputEvent::GesturePinchEnd: | 483 case WebInputEvent::GesturePinchEnd: |
484 return false; | |
484 case WebInputEvent::TouchCancel: | 485 case WebInputEvent::TouchCancel: |
486 DCHECK_NE(WebInputEvent::Blocking, | |
487 static_cast<const WebTouchEvent&>(event).dispatchType); | |
tdresser
2016/04/18 15:12:02
Why do we DCHECK here, but for no other event type
dtapuska
2016/04/18 19:19:33
This is a move of the dcheck that was in the input
| |
485 return false; | 488 return false; |
486 case WebInputEvent::TouchStart: | 489 case WebInputEvent::TouchStart: |
487 case WebInputEvent::TouchEnd: | 490 case WebInputEvent::TouchEnd: |
488 return static_cast<const WebTouchEvent&>(event).cancelable; | 491 return static_cast<const WebTouchEvent&>(event).dispatchType == |
492 WebInputEvent::Blocking; | |
489 default: | 493 default: |
490 return true; | 494 return true; |
491 } | 495 } |
492 } | 496 } |
493 | 497 |
494 uint32_t WebInputEventTraits::GetUniqueTouchEventId( | 498 uint32_t WebInputEventTraits::GetUniqueTouchEventId( |
495 const WebInputEvent& event) { | 499 const WebInputEvent& event) { |
496 if (WebInputEvent::isTouchEventType(event.type)) { | 500 if (WebInputEvent::isTouchEventType(event.type)) { |
497 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; | 501 return static_cast<const WebTouchEvent&>(event).uniqueTouchEventId; |
498 } | 502 } |
499 return 0U; | 503 return 0U; |
500 } | 504 } |
501 | 505 |
502 } // namespace content | 506 } // namespace content |
OLD | NEW |