Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / renderer_host / input / synthetic_gesture_target_aura.h
blob42303f271bf79dc40b0ac7799077d9c1a7b94f28
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_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_AURA_H_
8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
10 #include "content/common/input/synthetic_gesture_params.h"
12 namespace aura {
13 class Window;
14 class WindowEventDispatcher;
16 namespace client {
17 class ScreenPositionClient;
19 } // namespace aura
21 namespace content {
23 // SyntheticGestureTarget implementation for aura
24 class SyntheticGestureTargetAura : public SyntheticGestureTargetBase {
25 public:
26 explicit SyntheticGestureTargetAura(RenderWidgetHostImpl* host);
28 // SyntheticGestureTargetBase:
29 void DispatchWebTouchEventToPlatform(
30 const blink::WebTouchEvent& web_touch,
31 const ui::LatencyInfo& latency_info) override;
32 void DispatchWebMouseWheelEventToPlatform(
33 const blink::WebMouseWheelEvent& web_wheel,
34 const ui::LatencyInfo& latency_info) override;
35 void DispatchWebMouseEventToPlatform(
36 const blink::WebMouseEvent& web_mouse,
37 const ui::LatencyInfo& latency_info) override;
39 // SyntheticGestureTarget:
40 SyntheticGestureParams::GestureSourceType
41 GetDefaultSyntheticGestureSourceType() const override;
43 float GetTouchSlopInDips() const override;
45 float GetMinScalingSpanInDips() const override;
47 private:
48 aura::Window* GetWindow() const;
50 // Synthetic located event's location and touch event's radius are in DIP and
51 // aura event dispatcher assumes input event is in device pixel and will apply
52 // device scale factor to convert the input to DIP. So we need to use
53 // device_scale_factor to convert the input event from DIP to device pixel
54 // before dispatching it into platform.
55 float device_scale_factor_;
57 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetAura);
60 } // namespace content
62 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_AURA_H_