Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / common / input / gesture_event_stream_validator.h
blobf5d536fd2fad022d7d2583105608a352ed797d78
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR_H_
6 #define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "content/common/content_export.h"
13 namespace blink {
14 class WebGestureEvent;
17 namespace content {
19 // Utility class for validating a stream of WebGestureEvents.
20 class CONTENT_EXPORT GestureEventStreamValidator {
21 public:
22 GestureEventStreamValidator();
23 ~GestureEventStreamValidator();
25 // If |event| is valid for the current stream, returns true.
26 // Otherwise, returns false with a corresponding error message.
27 bool Validate(const blink::WebGestureEvent& event, std::string* error_msg);
29 private:
30 bool scrolling_;
31 bool pinching_;
32 bool waiting_for_tap_end_;
34 DISALLOW_COPY_AND_ASSIGN(GestureEventStreamValidator);
37 } // namespace content
39 #endif // CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR_H_