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 "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 "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 waiting_for_tap_end_ = false; | 93 waiting_for_tap_end_ = false; |
94 break; | 94 break; |
95 case WebInputEvent::GestureDoubleTap: | 95 case WebInputEvent::GestureDoubleTap: |
96 // DoubleTap gestures may be synthetically inserted, and do not require a | 96 // DoubleTap gestures may be synthetically inserted, and do not require a |
97 // preceding TapDown. | 97 // preceding TapDown. |
98 waiting_for_tap_end_ = false; | 98 waiting_for_tap_end_ = false; |
99 break; | 99 break; |
100 default: | 100 default: |
101 break; | 101 break; |
102 } | 102 } |
103 // TODO(wjmaclean): At some future point we may wish to consider adding a | |
104 // 'continuity check', requiring that all events between an initial tap-down | |
105 // and whatever terminates the sequence to have the same source device type. | |
106 if (event.sourceDevice == blink::WebGestureDeviceTouchpad && | |
107 !WebInputEvent::isGestureScrollEventType(event.type)) { | |
108 error_msg->append( | |
jdduke (slow)
2015/10/19 18:15:38
Hmm, I was thinking something even more basic, lik
wjmaclean
2015/10/19 18:58:49
Done.
| |
109 "Touchpad device should only be used for scroll events.\n"); | |
110 } | |
111 | |
103 return error_msg->empty(); | 112 return error_msg->empty(); |
104 } | 113 } |
105 | 114 |
106 } // namespace content | 115 } // namespace content |
OLD | NEW |