1 // Copyright 2013 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 UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_CLIENT_H_
6 #define UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_CLIENT_H_
7 
8 #include "ui/events/blink/web_input_event_traits.h"
9 
10 namespace ui {
11 
12 // All callbacks invoked from the compositor thread.
13 class InputHandlerProxyClient {
14  public:
15   // Called just before the InputHandlerProxy shuts down.
16   virtual void WillShutdown() = 0;
17 
18   // Dispatch a non blocking event to the main thread. This is used when a
19   // gesture fling from a touchpad is processed and the target only has
20   // passive event listeners.
21   virtual void DispatchNonBlockingEventToMainThread(
22       WebScopedInputEvent event,
23       const ui::LatencyInfo& latency_info,
24       const blink::WebInputEventAttribution& attribution) = 0;
25 
26   // |HandleInputEventWithLatencyInfo/RouteToTypeSpecificHandler| will respond
27   // to overscroll by calling the passed in callback. Otherwise |DidOverscroll|
28   // will be fired.
29   virtual void DidOverscroll(
30       const gfx::Vector2dF& accumulated_overscroll,
31       const gfx::Vector2dF& latest_overscroll_delta,
32       const gfx::Vector2dF& current_fling_velocity,
33       const gfx::PointF& causal_event_viewport_point,
34       const cc::OverscrollBehavior& overscroll_behavior) = 0;
35 
36   virtual void DidAnimateForInput() = 0;
37 
38   virtual void DidStartScrollingViewport() = 0;
39 
40   // Used to send a GSB to the main thread when the scrolling should switch to
41   // the main thread.
42   virtual void GenerateScrollBeginAndSendToMainThread(
43       const blink::WebGestureEvent& update_event,
44       const blink::WebInputEventAttribution& attribution) = 0;
45 
46   virtual void SetWhiteListedTouchAction(
47       cc::TouchAction touch_action,
48       uint32_t unique_touch_event_id,
49       InputHandlerProxy::EventDisposition event_disposition) = 0;
50 
51  protected:
~InputHandlerProxyClient()52   virtual ~InputHandlerProxyClient() {}
53 };
54 
55 }  // namespace ui
56 
57 #endif  // UI_EVENTS_BLINK_INPUT_HANDLER_PROXY_CLIENT_H_
58