Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / renderer_host / input / synthetic_gesture_target.h
blob14724bf67f906436fa1331445180a9994dcdb7a5
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_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_
8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture.h"
10 #include "content/common/content_export.h"
11 #include "content/common/input/synthetic_gesture_params.h"
13 namespace blink {
14 class WebInputEvent;
17 namespace content {
19 // Interface between the synthetic gesture controller and the RenderWidgetHost.
20 class CONTENT_EXPORT SyntheticGestureTarget {
21 public:
22 SyntheticGestureTarget() {}
23 virtual ~SyntheticGestureTarget() {}
25 // Allows synthetic gestures to insert input events in the highest level of
26 // input processing on the target platform (e.g. Java on Android), so that
27 // the event traverses the entire input processing stack.
28 virtual void DispatchInputEventToPlatform(
29 const blink::WebInputEvent& event) = 0;
31 // Called by SyntheticGestureController to request a flush at a time
32 // appropriate for the platform, e.g. aligned with vsync.
33 virtual void SetNeedsFlush() = 0;
35 // Returns the default gesture source type for the target.
36 virtual SyntheticGestureParams::GestureSourceType
37 GetDefaultSyntheticGestureSourceType() const = 0;
39 // After how much time of inaction does the target assume that a pointer has
40 // stopped moving.
41 virtual base::TimeDelta PointerAssumedStoppedTime() const = 0;
43 // Returns the maximum number of DIPs a touch pointer can move without being
44 // considered moving by the platform.
45 virtual float GetTouchSlopInDips() const = 0;
47 // Returns the minimum number of DIPs two touch pointers have to be apart
48 // to perform a pinch-zoom.
49 virtual float GetMinScalingSpanInDips() const = 0;
52 } // namespace content
54 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_