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

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

Issue 537733003: [Android] Enable input event stream validation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format 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
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 #ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR 5 #ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
6 #define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR 6 #define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "content/common/content_export.h"
11 12
12 namespace blink { 13 namespace blink {
13 class WebGestureEvent; 14 class WebGestureEvent;
14 } 15 }
15 16
16 namespace content { 17 namespace content {
17 18
18 // Utility class for validating a stream of WebGestureEvents. 19 // Utility class for validating a stream of WebGestureEvents.
19 class GestureEventStreamValidator { 20 class CONTENT_EXPORT GestureEventStreamValidator {
20 public: 21 public:
21 GestureEventStreamValidator(); 22 GestureEventStreamValidator();
22 ~GestureEventStreamValidator(); 23 ~GestureEventStreamValidator();
23 24
24 // If |event| is valid for the current stream, returns true. 25 // If |event| is valid for the current stream, returns true.
25 // Otherwise, returns false with a corresponding error message. 26 // Otherwise, returns false with a corresponding error message.
26 bool Validate(const blink::WebGestureEvent& event, std::string* error_msg); 27 bool Validate(const blink::WebGestureEvent& event, std::string* error_msg);
27 28
28 private: 29 private:
29 bool scrolling_; 30 bool scrolling_;
30 bool pinching_; 31 bool pinching_;
31 bool waiting_for_tap_end_; 32 bool waiting_for_tap_end_;
32 33
33 DISALLOW_COPY_AND_ASSIGN(GestureEventStreamValidator); 34 DISALLOW_COPY_AND_ASSIGN(GestureEventStreamValidator);
34 }; 35 };
35 36
36 } // namespace content 37 } // namespace content
37 38
38 #endif // CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR 39 #endif // CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698