Ignore non-active fullscreen windows for shelf state.
[chromium-blink-merge.git] / content / browser / renderer_host / input / synthetic_pinch_gesture.h
blob97405ce126791f6f43c3ea09ce620d0817b5f9eb
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_PINCH_GESTURE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_PINCH_GESTURE_H_
8 #include "content/browser/renderer_host/input/synthetic_gesture.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
10 #include "content/common/content_export.h"
11 #include "content/common/input/synthetic_pinch_gesture_params.h"
12 #include "content/common/input/synthetic_web_input_event_builders.h"
13 #include "third_party/WebKit/public/web/WebInputEvent.h"
15 namespace content {
17 class CONTENT_EXPORT SyntheticPinchGesture : public SyntheticGesture {
18 public:
19 explicit SyntheticPinchGesture(const SyntheticPinchGestureParams& params);
20 virtual ~SyntheticPinchGesture();
22 virtual SyntheticGesture::Result ForwardInputEvents(
23 const base::TimeDelta& interval, SyntheticGestureTarget* target) OVERRIDE;
25 private:
26 enum GestureState {
27 SETUP,
28 STARTED,
29 MOVING,
30 DONE
33 void ForwardTouchInputEvents(
34 const base::TimeDelta& interval, SyntheticGestureTarget* target);
36 void UpdateTouchPoints(base::TimeDelta interval);
37 void PressTouchPoints(SyntheticGestureTarget* target);
38 void MoveTouchPoints(SyntheticGestureTarget* target);
39 void ReleaseTouchPoints(SyntheticGestureTarget* target);
40 void ForwardTouchEvent(SyntheticGestureTarget* target) const;
42 void SetupCoordinates(SyntheticGestureTarget* target);
43 float GetDeltaForPointer0(const base::TimeDelta& interval) const;
44 float ComputeAbsoluteRemainingDistance() const;
45 bool HasReachedTarget() const;
47 SyntheticPinchGestureParams params_;
48 float current_y_0_;
49 float current_y_1_;
50 float target_y_0_;
51 float target_y_1_;
52 SyntheticGestureParams::GestureSourceType gesture_source_type_;
53 GestureState state_;
54 SyntheticWebTouchEvent touch_event_;
56 DISALLOW_COPY_AND_ASSIGN(SyntheticPinchGesture);
59 } // namespace content
61 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_PINCH_GESTURE_H_