Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1497)

Side by Side Diff: content/common/input/gesture_event_stream_validator.cc

Issue 572853005: Allow synthetic Tap gestures without a preceding TapDown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/common/input/gesture_event_stream_validator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 case WebInputEvent::GesturePinchEnd: 55 case WebInputEvent::GesturePinchEnd:
56 if (!pinching_) 56 if (!pinching_)
57 error_msg->append("Pinch end outside of pinch\n"); 57 error_msg->append("Pinch end outside of pinch\n");
58 pinching_ = false; 58 pinching_ = false;
59 break; 59 break;
60 case WebInputEvent::GestureTapDown: 60 case WebInputEvent::GestureTapDown:
61 if (waiting_for_tap_end_) 61 if (waiting_for_tap_end_)
62 error_msg->append("Missing tap end event\n"); 62 error_msg->append("Missing tap end event\n");
63 waiting_for_tap_end_ = true; 63 waiting_for_tap_end_ = true;
64 break; 64 break;
65 case WebInputEvent::GestureTap: 65 case WebInputEvent::GestureTapUnconfirmed:
66 if (!waiting_for_tap_end_)
67 error_msg->append("Missing TapDown event before TapUnconfirmed\n");
68 break;
66 case WebInputEvent::GestureTapCancel: 69 case WebInputEvent::GestureTapCancel:
67 if (!waiting_for_tap_end_) 70 if (!waiting_for_tap_end_)
68 error_msg->append("Missing GestureTapDown event\n"); 71 error_msg->append("Missing TapDown event before TapCancel\n");
69 waiting_for_tap_end_ = false; 72 waiting_for_tap_end_ = false;
70 break; 73 break;
74 case WebInputEvent::GestureTap:
71 case WebInputEvent::GestureDoubleTap: 75 case WebInputEvent::GestureDoubleTap:
76 // Both Tap and DoubleTap gestures may be synthetically inserted, and do
77 // not require a preceding TapDown.
tdresser 2014/09/16 18:03:46 Can this ever happen on Aura? We don't do tap dis
jdduke (slow) 2014/09/16 19:00:46 You tell me :)
72 waiting_for_tap_end_ = false; 78 waiting_for_tap_end_ = false;
73 break; 79 break;
74 default: 80 default:
75 break; 81 break;
76 } 82 }
77 return error_msg->empty(); 83 return error_msg->empty();
78 } 84 }
79 85
80 } // namespace content 86 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/input/gesture_event_stream_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698