| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR |
| #define CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR |
| |
| #include <string> |
| |
| #include "base/basictypes.h" |
| |
| namespace blink { |
| class WebGestureEvent; |
| } |
| |
| namespace content { |
| |
| // Utility class for validating a stream of WebGestureEvents. |
| class GestureEventStreamValidator { |
| public: |
| GestureEventStreamValidator(); |
| ~GestureEventStreamValidator(); |
| |
| // If |event| is valid for the current stream, returns true. |
| // Otherwise, returns false with a corresponding error message. |
| bool Validate(const blink::WebGestureEvent& event, std::string* error_msg); |
| |
| private: |
| bool scrolling_; |
| bool pinching_; |
| bool waiting_for_tap_end_; |
| |
| DISALLOW_COPY_AND_ASSIGN(GestureEventStreamValidator); |
| }; |
| |
| } // namespace content |
| |
| #endif // CONTENT_COMMON_INPUT_GESTURE_EVENT_STREAM_VALIDATOR |