Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / content / browser / renderer_host / input / synthetic_gesture_target_base.h
bloba66a8d34cae3b14deb1c44764b07f80b792ca36f
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_BASE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_
8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
11 namespace ui {
12 struct LatencyInfo;
15 namespace blink {
16 class WebTouchEvent;
17 class WebMouseEvent;
18 class WebMouseWheelEvent;
21 namespace content {
23 class RenderWidgetHostImpl;
25 class SyntheticGestureTargetBase : public SyntheticGestureTarget {
26 public:
27 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host);
28 virtual ~SyntheticGestureTargetBase();
30 virtual void DispatchWebTouchEventToPlatform(
31 const blink::WebTouchEvent& web_touch,
32 const ui::LatencyInfo& latency_info);
34 virtual void DispatchWebMouseWheelEventToPlatform(
35 const blink::WebMouseWheelEvent& web_wheel,
36 const ui::LatencyInfo& latency_info);
38 virtual void DispatchWebMouseEventToPlatform(
39 const blink::WebMouseEvent& web_mouse,
40 const ui::LatencyInfo& latency_info);
42 // SyntheticGestureTarget:
43 virtual void DispatchInputEventToPlatform(
44 const blink::WebInputEvent& event) OVERRIDE;
46 virtual void SetNeedsFlush() OVERRIDE;
48 virtual SyntheticGestureParams::GestureSourceType
49 GetDefaultSyntheticGestureSourceType() const OVERRIDE;
51 virtual base::TimeDelta PointerAssumedStoppedTime() const OVERRIDE;
53 virtual float GetTouchSlopInDips() const OVERRIDE;
55 virtual float GetMinScalingSpanInDips() const OVERRIDE;
57 protected:
58 RenderWidgetHostImpl* render_widget_host() const { return host_; }
60 private:
61 bool PointIsWithinContents(int x, int y) const;
63 RenderWidgetHostImpl* host_;
65 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetBase);
68 } // namespace content
70 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_