Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / common / input / gesture_event_stream_validator.h
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.
4
5 #ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
6 #define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "content/common/content_export.h"
12
13 namespace blink {
14 class WebGestureEvent;
15 }
16
17 namespace content {
18
19 // Utility class for validating a stream of WebGestureEvents.
20 class CONTENT_EXPORT GestureEventStreamValidator {
21  public:
22   GestureEventStreamValidator();
23   ~GestureEventStreamValidator();
24
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);
28
29  private:
30   bool scrolling_;
31   bool pinching_;
32   bool waiting_for_tap_end_;
33
34   DISALLOW_COPY_AND_ASSIGN(GestureEventStreamValidator);
35 };
36
37 }  // namespace content
38
39 #endif  // CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR