OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/tap_suppression_controller.h" | 5 #include "content/browser/renderer_host/tap_suppression_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 case GFC_IN_PROGRESS: | 125 case GFC_IN_PROGRESS: |
126 if (processed) | 126 if (processed) |
127 fling_cancel_time_ = base::TimeTicks::Now(); | 127 fling_cancel_time_ = base::TimeTicks::Now(); |
128 state_ = LAST_CANCEL_STOPPED_FLING; | 128 state_ = LAST_CANCEL_STOPPED_FLING; |
129 break; | 129 break; |
130 case MD_STASHED: | 130 case MD_STASHED: |
131 if (!processed) { | 131 if (!processed) { |
132 TRACE_EVENT0("browser", | 132 TRACE_EVENT0("browser", |
133 "TapSuppressionController::GestureFlingCancelAck"); | 133 "TapSuppressionController::GestureFlingCancelAck"); |
134 mouse_down_timer_.Stop(); | 134 mouse_down_timer_.Stop(); |
135 state_ = NOTHING; | |
135 render_widget_host_->ForwardMouseEvent(stashed_mouse_down_); | 136 render_widget_host_->ForwardMouseEvent(stashed_mouse_down_); |
136 state_ = NOTHING; | |
mohsen
2012/11/21 18:34:54
If MouseDown is forwarded before setting the state
rjkroege
2012/11/21 20:41:18
this is indeed an issue. TSC is not tested or inte
mohsen
2012/11/21 22:11:32
I agree. The only problem is that most of the code
| |
137 } // Else waiting for the timer to release the mouse event. | 137 } // Else waiting for the timer to release the mouse event. |
138 break; | 138 break; |
139 case LAST_CANCEL_STOPPED_FLING: | 139 case LAST_CANCEL_STOPPED_FLING: |
140 break; | 140 break; |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 void TapSuppressionController::GestureFlingCancel(double cancel_time) { | 144 void TapSuppressionController::GestureFlingCancel(double cancel_time) { |
145 switch (state_) { | 145 switch (state_) { |
146 case NOTHING: | 146 case NOTHING: |
(...skipping 10 matching lines...) Expand all Loading... | |
157 switch (state_) { | 157 switch (state_) { |
158 case NOTHING: | 158 case NOTHING: |
159 case GFC_IN_PROGRESS: | 159 case GFC_IN_PROGRESS: |
160 case LAST_CANCEL_STOPPED_FLING: | 160 case LAST_CANCEL_STOPPED_FLING: |
161 NOTREACHED() << "Timer fired on invalid state."; | 161 NOTREACHED() << "Timer fired on invalid state."; |
162 state_ = NOTHING; | 162 state_ = NOTHING; |
163 break; | 163 break; |
164 case MD_STASHED: | 164 case MD_STASHED: |
165 TRACE_EVENT0("browser", | 165 TRACE_EVENT0("browser", |
166 "TapSuppressionController::MouseDownTimerExpired"); | 166 "TapSuppressionController::MouseDownTimerExpired"); |
167 state_ = NOTHING; | |
167 render_widget_host_->ForwardMouseEvent(stashed_mouse_down_); | 168 render_widget_host_->ForwardMouseEvent(stashed_mouse_down_); |
168 state_ = NOTHING; | |
mohsen
2012/11/21 18:34:54
The same as note under line 136.
| |
169 break; | 169 break; |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 } // namespace content | 173 } // namespace content |
OLD | NEW |