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

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

Issue 724313003: [Android] Always precede Tap gesture events with TapDown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698