Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / content / renderer / input / input_handler_manager_client.h
bloba098808c41014c79fefbb9e5a8073e8eb473e05d
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.
5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/callback_forward.h"
11 #include "content/common/content_export.h"
12 #include "ui/gfx/geometry/vector2d_f.h"
14 namespace ui {
15 class LatencyInfo;
18 namespace cc {
19 class InputHandler;
22 namespace blink {
23 class WebInputEvent;
26 namespace content {
27 struct DidOverscrollParams;
28 class SynchronousInputHandlerProxy;
30 class CONTENT_EXPORT InputHandlerManagerClient {
31 public:
32 virtual ~InputHandlerManagerClient() {}
34 // The Manager will supply a |handler| when bound to the client. This is valid
35 // until the manager shuts down, at which point it supplies a null |handler|.
36 // The client should only makes calls to |handler| on the compositor thread.
37 typedef base::Callback<
38 InputEventAckState(int /*routing_id*/,
39 const blink::WebInputEvent*,
40 ui::LatencyInfo* latency_info)> Handler;
42 // Called from the main thread.
43 virtual void SetBoundHandler(const Handler& handler) = 0;
45 // Called from the compositor thread.
46 virtual void DidAddInputHandler(
47 int routing_id,
48 cc::InputHandler* input_handler,
49 SynchronousInputHandlerProxy* synchronous_handler) = 0;
50 virtual void DidRemoveInputHandler(int routing_id) = 0;
51 virtual void DidOverscroll(int routing_id,
52 const DidOverscrollParams& params) = 0;
53 virtual void DidStopFlinging(int routing_id) = 0;
55 protected:
56 InputHandlerManagerClient() {}
58 private:
59 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient);
62 } // namespace content
64 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_