• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_
7 
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"
12 
13 namespace blink {
14 class WebInputEvent;
15 }
16 
17 namespace content {
18 
19 // Interface between the synthetic gesture controller and the RenderWidgetHost.
20 class CONTENT_EXPORT SyntheticGestureTarget {
21  public:
SyntheticGestureTarget()22   SyntheticGestureTarget() {}
~SyntheticGestureTarget()23   virtual ~SyntheticGestureTarget() {}
24 
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;
30 
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;
34 
35   // Returns the default gesture source type for the target.
36   virtual SyntheticGestureParams::GestureSourceType
37       GetDefaultSyntheticGestureSourceType() const = 0;
38 
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;
42 
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;
46 
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;
50 };
51 
52 }  // namespace content
53 
54 #endif  // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_
55