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/gesture_event_stream_validator.h" | 5 #include "content/common/input/gesture_event_stream_validator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/WebKit/public/web/WebInputEvent.h" | 8 #include "third_party/WebKit/public/web/WebInputEvent.h" |
9 | 9 |
10 using blink::WebInputEvent; | 10 using blink::WebInputEvent; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 case WebInputEvent::GestureTapUnconfirmed: | 65 case WebInputEvent::GestureTapUnconfirmed: |
66 if (!waiting_for_tap_end_) | 66 if (!waiting_for_tap_end_) |
67 error_msg->append("Missing TapDown event before TapUnconfirmed\n"); | 67 error_msg->append("Missing TapDown event before TapUnconfirmed\n"); |
68 break; | 68 break; |
69 case WebInputEvent::GestureTapCancel: | 69 case WebInputEvent::GestureTapCancel: |
70 if (!waiting_for_tap_end_) | 70 if (!waiting_for_tap_end_) |
71 error_msg->append("Missing TapDown event before TapCancel\n"); | 71 error_msg->append("Missing TapDown event before TapCancel\n"); |
72 waiting_for_tap_end_ = false; | 72 waiting_for_tap_end_ = false; |
73 break; | 73 break; |
74 case WebInputEvent::GestureTap: | 74 case WebInputEvent::GestureTap: |
| 75 if (!waiting_for_tap_end_) |
| 76 error_msg->append("Missing TapDown event before Tap\n"); |
| 77 waiting_for_tap_end_ = false; |
| 78 break; |
75 case WebInputEvent::GestureDoubleTap: | 79 case WebInputEvent::GestureDoubleTap: |
76 // Both Tap and DoubleTap gestures may be synthetically inserted, and do | 80 // DoubleTap gestures may be synthetically inserted, and do not require a |
77 // not require a preceding TapDown. | 81 // preceding TapDown. |
78 waiting_for_tap_end_ = false; | 82 waiting_for_tap_end_ = false; |
79 break; | 83 break; |
80 default: | 84 default: |
81 break; | 85 break; |
82 } | 86 } |
83 return error_msg->empty(); | 87 return error_msg->empty(); |
84 } | 88 } |
85 | 89 |
86 } // namespace content | 90 } // namespace content |
OLD | NEW |