| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/input/synthetic_gesture_params.h" | 10 #include "content/common/input/synthetic_gesture_params.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 class WebInputEvent; | 13 class WebInputEvent; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // Interface between the synthetic gesture controller and the RenderWidgetHost. | 18 // Interface between the synthetic gesture controller and the RenderWidgetHost. |
| 19 class CONTENT_EXPORT SyntheticGestureTarget { | 19 class CONTENT_EXPORT SyntheticGestureTarget { |
| 20 public: | 20 public: |
| 21 SyntheticGestureTarget() {} | 21 SyntheticGestureTarget() {} |
| 22 virtual ~SyntheticGestureTarget() {} | 22 virtual ~SyntheticGestureTarget() {} |
| 23 | 23 |
| 24 // Allows synthetic gestures to insert input events in the highest level of | 24 // Allows synthetic gestures to insert input events in the highest level of |
| 25 // input processing on the target platform (e.g. Java on Android), so that | 25 // input processing on the target platform (e.g. Java on Android), so that |
| 26 // the event traverses the entire input processing stack. | 26 // the event traverses the entire input processing stack. |
| 27 virtual void DispatchInputEventToPlatform( | 27 virtual void DispatchInputEventToPlatform( |
| 28 const blink::WebInputEvent& event) = 0; | 28 const blink::WebInputEvent& event) = 0; |
| 29 | 29 |
| 30 // Called by SyntheticGestureController to request a flush at a time | |
| 31 // appropriate for the platform, e.g. aligned with vsync. | |
| 32 virtual void SetNeedsFlush() = 0; | |
| 33 | |
| 34 // Returns the default gesture source type for the target. | 30 // Returns the default gesture source type for the target. |
| 35 virtual SyntheticGestureParams::GestureSourceType | 31 virtual SyntheticGestureParams::GestureSourceType |
| 36 GetDefaultSyntheticGestureSourceType() const = 0; | 32 GetDefaultSyntheticGestureSourceType() const = 0; |
| 37 | 33 |
| 38 // After how much time of inaction does the target assume that a pointer has | 34 // After how much time of inaction does the target assume that a pointer has |
| 39 // stopped moving. | 35 // stopped moving. |
| 40 virtual base::TimeDelta PointerAssumedStoppedTime() const = 0; | 36 virtual base::TimeDelta PointerAssumedStoppedTime() const = 0; |
| 41 | 37 |
| 42 // Returns the maximum number of DIPs a touch pointer can move without being | 38 // Returns the maximum number of DIPs a touch pointer can move without being |
| 43 // considered moving by the platform. | 39 // considered moving by the platform. |
| 44 virtual float GetTouchSlopInDips() const = 0; | 40 virtual float GetTouchSlopInDips() const = 0; |
| 45 | 41 |
| 46 // Returns the minimum number of DIPs two touch pointers have to be apart | 42 // Returns the minimum number of DIPs two touch pointers have to be apart |
| 47 // to perform a pinch-zoom. | 43 // to perform a pinch-zoom. |
| 48 virtual float GetMinScalingSpanInDips() const = 0; | 44 virtual float GetMinScalingSpanInDips() const = 0; |
| 49 }; | 45 }; |
| 50 | 46 |
| 51 } // namespace content | 47 } // namespace content |
| 52 | 48 |
| 53 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ | 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_H_ |
| OLD | NEW |