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