| 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(jdduke): Remove this after implementing TouchMove events | |
| 143 // filtering based on corrected touches state in TouchEventQueue, | |
| 144 // crbug.com/452032. | |
| 145 if (event.type == WebInputEvent::TouchMove) | |
| 146 found_valid_state_for_type = true; | |
| 147 | |
| 148 break; | 142 break; |
| 149 | 143 |
| 150 case WebTouchPoint::StateCancelled: | 144 case WebTouchPoint::StateCancelled: |
| 151 if (event.type != WebInputEvent::TouchCancel) { | 145 if (event.type != WebInputEvent::TouchCancel) { |
| 152 error_msg->append(StringPrintf( | 146 error_msg->append(StringPrintf( |
| 153 "Cancelled touch point (id=%d) outside touchcancel.\n", | 147 "Cancelled touch point (id=%d) outside touchcancel.\n", |
| 154 point.id)); | 148 point.id)); |
| 155 } else { | 149 } else { |
| 156 found_valid_state_for_type = true; | 150 found_valid_state_for_type = true; |
| 157 } | 151 } |
| 158 break; | 152 break; |
| 159 } | 153 } |
| 160 } | 154 } |
| 161 | 155 |
| 162 if (!found_valid_state_for_type) { | 156 if (!found_valid_state_for_type) { |
| 163 error_msg->append( | 157 error_msg->append( |
| 164 StringPrintf("No valid touch point corresponding to event type: %s\n", | 158 StringPrintf("No valid touch point corresponding to event type: %s\n", |
| 165 WebInputEventTraits::GetName(event.type))); | 159 WebInputEventTraits::GetName(event.type))); |
| 166 } | 160 } |
| 167 | 161 |
| 168 return error_msg->empty(); | 162 return error_msg->empty(); |
| 169 } | 163 } |
| 170 | 164 |
| 171 } // namespace content | 165 } // namespace content |
| OLD | NEW |