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_TOUCH_ACTION_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_ACTION_FILTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_ACTION_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_ACTION_FILTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/common/input/touch_action.h" | 10 #include "content/common/input/touch_action.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Called when a set-touch-action message is received from the renderer | 30 // Called when a set-touch-action message is received from the renderer |
31 // for a touch start event that is currently in flight. | 31 // for a touch start event that is currently in flight. |
32 void OnSetTouchAction(content::TouchAction touch_action); | 32 void OnSetTouchAction(content::TouchAction touch_action); |
33 | 33 |
34 // Must be called at least once between when the last gesture events for the | 34 // Must be called at least once between when the last gesture events for the |
35 // previous touch sequence have passed through the touch action filter and the | 35 // previous touch sequence have passed through the touch action filter and the |
36 // time the touch start for the next touch sequence has reached the | 36 // time the touch start for the next touch sequence has reached the |
37 // renderer. It may be called multiple times during this interval. | 37 // renderer. It may be called multiple times during this interval. |
38 void ResetTouchAction(); | 38 void ResetTouchAction(); |
39 | 39 |
| 40 TouchAction allowed_touch_action() const { return allowed_touch_action_; } |
| 41 |
40 // Return the intersection of two TouchAction values. | 42 // Return the intersection of two TouchAction values. |
41 static TouchAction Intersect(TouchAction ta1, TouchAction ta2); | 43 static TouchAction Intersect(TouchAction ta1, TouchAction ta2); |
42 | 44 |
43 private: | 45 private: |
44 bool ShouldSuppressScroll(const blink::WebGestureEvent& gesture_event); | 46 bool ShouldSuppressScroll(const blink::WebGestureEvent& gesture_event); |
45 bool FilterScrollEndingGesture(); | 47 bool FilterScrollEndingGesture(); |
46 | 48 |
47 // Whether GestureScroll events should be discarded due to touch-action. | 49 // Whether GestureScroll events should be discarded due to touch-action. |
48 bool drop_scroll_gesture_events_; | 50 bool drop_scroll_gesture_events_; |
49 | 51 |
50 // Whether GesturePinch events should be discarded due to touch-action. | 52 // Whether GesturePinch events should be discarded due to touch-action. |
51 bool drop_pinch_gesture_events_; | 53 bool drop_pinch_gesture_events_; |
52 | 54 |
53 // Whether a tap ending event in this sequence should be discarded because a | 55 // Whether a tap ending event in this sequence should be discarded because a |
54 // previous GestureTapUnconfirmed event was turned into a GestureTap. | 56 // previous GestureTapUnconfirmed event was turned into a GestureTap. |
55 bool drop_current_tap_ending_event_; | 57 bool drop_current_tap_ending_event_; |
56 | 58 |
57 // True iff the touch action of the last TapUnconfirmed or Tap event was | 59 // True iff the touch action of the last TapUnconfirmed or Tap event was |
58 // TOUCH_ACTION_AUTO. The double tap event depends on the touch action of the | 60 // TOUCH_ACTION_AUTO. The double tap event depends on the touch action of the |
59 // previous tap or tap unconfirmed. Only valid between a TapUnconfirmed or Tap | 61 // previous tap or tap unconfirmed. Only valid between a TapUnconfirmed or Tap |
60 // and the next DoubleTap. | 62 // and the next DoubleTap. |
61 bool allow_current_double_tap_event_; | 63 bool allow_current_double_tap_event_; |
62 | 64 |
63 // What touch actions are currently permitted. | 65 // What touch actions are currently permitted. |
64 content::TouchAction allowed_touch_action_; | 66 TouchAction allowed_touch_action_; |
65 | 67 |
66 DISALLOW_COPY_AND_ASSIGN(TouchActionFilter); | 68 DISALLOW_COPY_AND_ASSIGN(TouchActionFilter); |
67 }; | 69 }; |
68 | 70 |
69 } | 71 } |
70 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_ACTION_FILTER_H_ | 72 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_ACTION_FILTER_H_ |
OLD | NEW |