Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: content/browser/renderer_host/input/tap_suppression_controller.h

Issue 2542453003: Suppress LongPress/Tap, and TwoFingerTap when TapDown cancels a fling. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 8 #include "base/macros.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 private: 64 private:
65 friend class MockTapSuppressionController; 65 friend class MockTapSuppressionController;
66 66
67 enum State { 67 enum State {
68 DISABLED, 68 DISABLED,
69 NOTHING, 69 NOTHING,
70 GFC_IN_PROGRESS, 70 GFC_IN_PROGRESS,
71 TAP_DOWN_STASHED, 71 TAP_DOWN_STASHED,
72 LAST_CANCEL_STOPPED_FLING, 72 LAST_CANCEL_STOPPED_FLING,
73 // When the stashed TapDown event is dropped or forwarded due to tap down
74 // timer expiration, the contorller enters the SUPPRESSING_TAPS state.
tdresser 2016/12/07 19:53:21 controller
sahel 2016/12/09 16:49:12 Done.
75 // This state shows that the controller will suppress LongTap,
76 // TwoFingerTap, and TapCancel gesture events untill the next tapDown event
tdresser 2016/12/07 19:53:21 until
sahel 2016/12/09 16:49:12 Done.
77 // arrives.
78 SUPPRESSING_TAPS,
73 }; 79 };
74 80
75 TapSuppressionControllerClient* client_; 81 TapSuppressionControllerClient* client_;
76 base::OneShotTimer tap_down_timer_; 82 base::OneShotTimer tap_down_timer_;
77 State state_; 83 State state_;
78 84
79 base::TimeDelta max_cancel_to_down_time_; 85 base::TimeDelta max_cancel_to_down_time_;
80 base::TimeDelta max_tap_gap_time_; 86 base::TimeDelta max_tap_gap_time_;
81 87
82 // TODO(rjkroege): During debugging, the event times did not prove reliable. 88 // TODO(rjkroege): During debugging, the event times did not prove reliable.
83 // Replace the use of base::TimeTicks with an accurate event time when they 89 // Replace the use of base::TimeTicks with an accurate event time when they
84 // become available post http://crbug.com/119556. 90 // become available post http://crbug.com/119556.
85 base::TimeTicks fling_cancel_time_; 91 base::TimeTicks fling_cancel_time_;
86 92
87 DISALLOW_COPY_AND_ASSIGN(TapSuppressionController); 93 DISALLOW_COPY_AND_ASSIGN(TapSuppressionController);
88 }; 94 };
89 95
90 } // namespace content 96 } // namespace content
91 97
92 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_ 98 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TAP_SUPPRESSION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698