| Index: content/browser/renderer_host/input/touch_stream_tracker.h
|
| diff --git a/content/browser/renderer_host/input/touch_stream_tracker.h b/content/browser/renderer_host/input/touch_stream_tracker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3c63f3c4042b87233413b027b66817e715ce759e
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/input/touch_stream_tracker.h
|
| @@ -0,0 +1,43 @@
|
| +// 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_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
|
| +
|
| +#include "content/browser/renderer_host/event_with_latency_info.h"
|
| +#include "content/common/input/input_event_ack_state.h"
|
| +#include "third_party/WebKit/public/web/WebInputEvent.h"
|
| +
|
| +namespace content {
|
| +
|
| +// Tracks multiple touch streams and filters events from all other streams
|
| +// while one is active.
|
| +class CONTENT_EXPORT TouchStreamTracker {
|
| + public:
|
| + enum TouchStream {
|
| + NATIVE_STREAM,
|
| + EMULATED_STREAM
|
| + };
|
| +
|
| + TouchStreamTracker();
|
| + virtual ~TouchStreamTracker();
|
| +
|
| + // Tracker may immediately ack touch event if another touch stream is active.
|
| + InputEventAckState FilterTouchEventFromStream(
|
| + const blink::WebTouchEvent& touch_event, TouchStream stream);
|
| +
|
| + // Returns the touch stream which should receive this ack.
|
| + TouchStream OnTouchEventAck(
|
| + const TouchEventWithLatencyInfo& event, InputEventAckState ack_result);
|
| +
|
| + private:
|
| + bool has_active_touch_stream_;
|
| + TouchStream active_touch_stream_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TouchStreamTracker);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_
|
|
|