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_TAP_SUPPRESSION_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // Should be called whenever a tap down (touchpad or touchscreen) is received. | 48 // Should be called whenever a tap down (touchpad or touchscreen) is received. |
49 // Returns true if the tap down should be deferred. The caller is responsible | 49 // Returns true if the tap down should be deferred. The caller is responsible |
50 // for keeping the event for later release, if needed. | 50 // for keeping the event for later release, if needed. |
51 bool ShouldDeferTapDown(); | 51 bool ShouldDeferTapDown(); |
52 | 52 |
53 // Should be called whenever a tap ending event is received. Returns true if | 53 // Should be called whenever a tap ending event is received. Returns true if |
54 // the tap event should be suppressed. | 54 // the tap event should be suppressed. |
55 bool ShouldSuppressTapEnd(); | 55 bool ShouldSuppressTapEnd(); |
56 | 56 |
| 57 // Reset the current state of tap suppression. |
| 58 void Reset(); |
| 59 |
57 protected: | 60 protected: |
58 virtual base::TimeTicks Now(); | 61 virtual base::TimeTicks Now(); |
59 virtual void StartTapDownTimer(const base::TimeDelta& delay); | 62 virtual void StartTapDownTimer(const base::TimeDelta& delay); |
60 virtual void StopTapDownTimer(); | 63 virtual void StopTapDownTimer(); |
61 void TapDownTimerExpired(); | 64 void TapDownTimerExpired(); |
62 | 65 |
63 private: | 66 private: |
64 friend class MockTapSuppressionController; | 67 friend class MockTapSuppressionController; |
65 | 68 |
66 enum State { | 69 enum State { |
(...skipping 15 matching lines...) Expand all Loading... |
82 // Replace the use of base::TimeTicks with an accurate event time when they | 85 // Replace the use of base::TimeTicks with an accurate event time when they |
83 // become available post http://crbug.com/119556. | 86 // become available post http://crbug.com/119556. |
84 base::TimeTicks fling_cancel_time_; | 87 base::TimeTicks fling_cancel_time_; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(TapSuppressionController); | 89 DISALLOW_COPY_AND_ASSIGN(TapSuppressionController); |
87 }; | 90 }; |
88 | 91 |
89 } // namespace content | 92 } // namespace content |
90 | 93 |
91 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ | 94 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ |
OLD | NEW |