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/gesture_event_filter.h" | 5 #include "content/browser/renderer_host/gesture_event_filter.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
10 #include "content/browser/renderer_host/tap_suppression_controller.h" | 10 #include "content/browser/renderer_host/tap_suppression_controller.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 return false; | 132 return false; |
133 } | 133 } |
134 | 134 |
135 void GestureEventFilter::Reset() { | 135 void GestureEventFilter::Reset() { |
136 fling_in_progress_ = false; | 136 fling_in_progress_ = false; |
137 coalesced_gesture_events_.clear(); | 137 coalesced_gesture_events_.clear(); |
138 // TODO(rjkroege): Reset the tap suppression controller. | 138 // TODO(rjkroege): Reset the tap suppression controller. |
139 } | 139 } |
140 | 140 |
141 void GestureEventFilter::ProcessGestureAck(bool processed, int type) { | 141 void GestureEventFilter::ProcessGestureAck(bool processed, int type) { |
142 DCHECK(coalesced_gesture_events_.front().type == type); | |
sky
2012/09/10 21:17:45
DCHECK_EQ
Rick Byers
2012/09/11 14:04:54
Done.
| |
142 coalesced_gesture_events_.pop_front(); | 143 coalesced_gesture_events_.pop_front(); |
143 if (!coalesced_gesture_events_.empty()) { | 144 if (!coalesced_gesture_events_.empty()) { |
144 WebGestureEvent next_gesture_event = coalesced_gesture_events_.front(); | 145 WebGestureEvent next_gesture_event = coalesced_gesture_events_.front(); |
145 render_widget_host_->ForwardGestureEventImmediately(next_gesture_event); | 146 render_widget_host_->ForwardGestureEventImmediately(next_gesture_event); |
146 } | 147 } |
147 } | 148 } |
148 | 149 |
149 TapSuppressionController* GestureEventFilter::GetTapSuppressionController() { | 150 TapSuppressionController* GestureEventFilter::GetTapSuppressionController() { |
150 return tap_suppression_controller_.get(); | 151 return tap_suppression_controller_.get(); |
151 } | 152 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 last_gesture_event->timeStampSeconds) | 187 last_gesture_event->timeStampSeconds) |
187 << "Event time not monotonic?\n"; | 188 << "Event time not monotonic?\n"; |
188 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate); | 189 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate); |
189 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; | 190 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; |
190 } else { | 191 } else { |
191 coalesced_gesture_events_.push_back(gesture_event); | 192 coalesced_gesture_events_.push_back(gesture_event); |
192 } | 193 } |
193 } | 194 } |
194 | 195 |
195 } // namespace content | 196 } // namespace content |
OLD | NEW |