Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / content / renderer / input / synchronous_input_handler_proxy.h
blob8f84aad7654d23159264639603bc6a1f427df5e7
1 // Copyright 2015 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_RENDERER_INPUT_SYNCHRONOUS_INPUT_HANDLER_PROXY_H_
6 #define CONTENT_RENDERER_INPUT_SYNCHRONOUS_INPUT_HANDLER_PROXY_H_
8 #include "base/time/time.h"
10 namespace content {
12 class CONTENT_EXPORT SynchronousInputHandler {
13 public:
14 // Informs the Android WebView embedder that a fling animation is running, and
15 // that it should call SynchronouslyAnimate() if it wants to execute that
16 // animation. The embedder/app may choose to override and ignore the
17 // request for animation.
18 virtual void SetNeedsSynchronousAnimateInput() = 0;
21 // Android WebView requires synchronous scrolling from the WebView application.
22 // This interface provides support for that behaviour. The WebView embedder will
23 // act as the InputHandler for controlling the timing of input (fling)
24 // animations.
25 class CONTENT_EXPORT SynchronousInputHandlerProxy {
26 public:
27 // Tell the proxy that we will control the timing of root fling animations
28 // from the SynchronousInputHandler. Once this is set, the InputHandler is
29 // not requested to Animate() the InputHandlerProxy for root layer flings.
30 // Instead, requests for animation will go to the SynchronousInputHandler and
31 // animation ticks will only come back through SynchronouslyAnimate().
32 // Non-root flings are not affected.
33 virtual void SetOnlySynchronouslyAnimateRootFlings(
34 SynchronousInputHandler* synchronous_input_handler) = 0;
36 // Tick input (fling) animations. This may happen out of phase with the frame
37 // timing, or not at all, as it is controlled by the WebView application. When
38 // it returns, it expects the animation scroll offsets to be visible to the
39 // application.
40 virtual void SynchronouslyAnimate(base::TimeTicks time) = 0;
43 } // namespace content
45 #endif // CONTENT_RENDERER_INPUT_SYNCHRONOUS_INPUT_HANDLER_PROXY_H_