| 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/touch_event_stream_validator.h" | 5 #include "content/common/input/touch_event_stream_validator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/common/input/web_input_event_traits.h" | 9 #include "content/common/input/web_input_event_traits.h" |
| 10 #include "content/common/input/web_touch_event_traits.h" | 10 #include "content/common/input/web_touch_event_traits.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 case WebTouchPoint::StateMoved: | 132 case WebTouchPoint::StateMoved: |
| 133 if (event.type != WebInputEvent::TouchMove) { | 133 if (event.type != WebInputEvent::TouchMove) { |
| 134 error_msg->append(StringPrintf( | 134 error_msg->append(StringPrintf( |
| 135 "Moved touch point (id=%d) outside touchmove.\n", point.id)); | 135 "Moved touch point (id=%d) outside touchmove.\n", point.id)); |
| 136 } else { | 136 } else { |
| 137 found_valid_state_for_type = true; | 137 found_valid_state_for_type = true; |
| 138 } | 138 } |
| 139 break; | 139 break; |
| 140 | 140 |
| 141 case WebTouchPoint::StateStationary: | 141 case WebTouchPoint::StateStationary: |
| 142 // TODO(): Remove this after implementing TouchMove events filtering |
| 143 // based on corrected touches state in TouchEventQueue. |
| 144 if (event.type == WebInputEvent::TouchMove) |
| 145 found_valid_state_for_type = true; |
| 146 |
| 142 break; | 147 break; |
| 143 | 148 |
| 144 case WebTouchPoint::StateCancelled: | 149 case WebTouchPoint::StateCancelled: |
| 145 if (event.type != WebInputEvent::TouchCancel) { | 150 if (event.type != WebInputEvent::TouchCancel) { |
| 146 error_msg->append(StringPrintf( | 151 error_msg->append(StringPrintf( |
| 147 "Cancelled touch point (id=%d) outside touchcancel.\n", | 152 "Cancelled touch point (id=%d) outside touchcancel.\n", |
| 148 point.id)); | 153 point.id)); |
| 149 } else { | 154 } else { |
| 150 found_valid_state_for_type = true; | 155 found_valid_state_for_type = true; |
| 151 } | 156 } |
| 152 break; | 157 break; |
| 153 } | 158 } |
| 154 } | 159 } |
| 155 | 160 |
| 156 if (!found_valid_state_for_type) { | 161 if (!found_valid_state_for_type) { |
| 157 error_msg->append( | 162 error_msg->append( |
| 158 StringPrintf("No valid touch point corresponding to event type: %s\n", | 163 StringPrintf("No valid touch point corresponding to event type: %s\n", |
| 159 WebInputEventTraits::GetName(event.type))); | 164 WebInputEventTraits::GetName(event.type))); |
| 160 } | 165 } |
| 161 | 166 |
| 162 return error_msg->empty(); | 167 return error_msg->empty(); |
| 163 } | 168 } |
| 164 | 169 |
| 165 } // namespace content | 170 } // namespace content |
| OLD | NEW |