| 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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 10 | 10 |
| 11 namespace ui { | 11 namespace ui { |
| 12 struct LatencyInfo; | 12 struct LatencyInfo; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 class WebTouchEvent; | 16 class WebTouchEvent; |
| 17 class WebMouseEvent; | 17 class WebMouseEvent; |
| 18 class WebMouseWheelEvent; | 18 class WebMouseWheelEvent; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 class RenderWidgetHostImpl; | 23 class RenderWidgetHostImpl; |
| 24 | 24 |
| 25 class SyntheticGestureTargetBase : public SyntheticGestureTarget { | 25 class SyntheticGestureTargetBase : public SyntheticGestureTarget { |
| 26 public: | 26 public: |
| 27 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); | 27 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); |
| 28 virtual ~SyntheticGestureTargetBase(); | 28 ~SyntheticGestureTargetBase() override; |
| 29 | 29 |
| 30 virtual void DispatchWebTouchEventToPlatform( | 30 virtual void DispatchWebTouchEventToPlatform( |
| 31 const blink::WebTouchEvent& web_touch, | 31 const blink::WebTouchEvent& web_touch, |
| 32 const ui::LatencyInfo& latency_info); | 32 const ui::LatencyInfo& latency_info); |
| 33 | 33 |
| 34 virtual void DispatchWebMouseWheelEventToPlatform( | 34 virtual void DispatchWebMouseWheelEventToPlatform( |
| 35 const blink::WebMouseWheelEvent& web_wheel, | 35 const blink::WebMouseWheelEvent& web_wheel, |
| 36 const ui::LatencyInfo& latency_info); | 36 const ui::LatencyInfo& latency_info); |
| 37 | 37 |
| 38 virtual void DispatchWebMouseEventToPlatform( | 38 virtual void DispatchWebMouseEventToPlatform( |
| 39 const blink::WebMouseEvent& web_mouse, | 39 const blink::WebMouseEvent& web_mouse, |
| 40 const ui::LatencyInfo& latency_info); | 40 const ui::LatencyInfo& latency_info); |
| 41 | 41 |
| 42 // SyntheticGestureTarget: | 42 // SyntheticGestureTarget: |
| 43 virtual void DispatchInputEventToPlatform( | 43 void DispatchInputEventToPlatform(const blink::WebInputEvent& event) override; |
| 44 const blink::WebInputEvent& event) override; | |
| 45 | 44 |
| 46 virtual void SetNeedsFlush() override; | 45 void SetNeedsFlush() override; |
| 47 | 46 |
| 48 virtual SyntheticGestureParams::GestureSourceType | 47 SyntheticGestureParams::GestureSourceType |
| 49 GetDefaultSyntheticGestureSourceType() const override; | 48 GetDefaultSyntheticGestureSourceType() const override; |
| 50 | 49 |
| 51 virtual base::TimeDelta PointerAssumedStoppedTime() const override; | 50 base::TimeDelta PointerAssumedStoppedTime() const override; |
| 52 | 51 |
| 53 virtual float GetTouchSlopInDips() const override; | 52 float GetTouchSlopInDips() const override; |
| 54 | 53 |
| 55 virtual float GetMinScalingSpanInDips() const override; | 54 float GetMinScalingSpanInDips() const override; |
| 56 | 55 |
| 57 protected: | 56 protected: |
| 58 RenderWidgetHostImpl* render_widget_host() const { return host_; } | 57 RenderWidgetHostImpl* render_widget_host() const { return host_; } |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 bool PointIsWithinContents(int x, int y) const; | 60 bool PointIsWithinContents(int x, int y) const; |
| 62 | 61 |
| 63 RenderWidgetHostImpl* host_; | 62 RenderWidgetHostImpl* host_; |
| 64 | 63 |
| 65 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetBase); | 64 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetBase); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace content | 67 } // namespace content |
| 69 | 68 |
| 70 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_ | 69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_ |
| OLD | NEW |