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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 void GestureEventFilter::Reset() { | 137 void GestureEventFilter::Reset() { |
138 fling_in_progress_ = false; | 138 fling_in_progress_ = false; |
139 coalesced_gesture_events_.clear(); | 139 coalesced_gesture_events_.clear(); |
140 deferred_tap_down_event_.type = WebInputEvent::Undefined; | 140 deferred_tap_down_event_.type = WebInputEvent::Undefined; |
141 // TODO(rjkroege): Reset the tap suppression controller. | 141 // TODO(rjkroege): Reset the tap suppression controller. |
142 } | 142 } |
143 | 143 |
144 void GestureEventFilter::ProcessGestureAck(bool processed, int type) { | 144 void GestureEventFilter::ProcessGestureAck(bool processed, int type) { |
| 145 DCHECK_EQ(coalesced_gesture_events_.front().type, type); |
145 coalesced_gesture_events_.pop_front(); | 146 coalesced_gesture_events_.pop_front(); |
146 if (!coalesced_gesture_events_.empty()) { | 147 if (!coalesced_gesture_events_.empty()) { |
147 WebGestureEvent next_gesture_event = coalesced_gesture_events_.front(); | 148 WebGestureEvent next_gesture_event = coalesced_gesture_events_.front(); |
148 render_widget_host_->ForwardGestureEventImmediately(next_gesture_event); | 149 render_widget_host_->ForwardGestureEventImmediately(next_gesture_event); |
149 } | 150 } |
150 } | 151 } |
151 | 152 |
152 TapSuppressionController* GestureEventFilter::GetTapSuppressionController() { | 153 TapSuppressionController* GestureEventFilter::GetTapSuppressionController() { |
153 return tap_suppression_controller_.get(); | 154 return tap_suppression_controller_.get(); |
154 } | 155 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 last_gesture_event->timeStampSeconds) | 190 last_gesture_event->timeStampSeconds) |
190 << "Event time not monotonic?\n"; | 191 << "Event time not monotonic?\n"; |
191 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate); | 192 DCHECK(last_gesture_event->type == WebInputEvent::GestureScrollUpdate); |
192 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; | 193 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; |
193 } else { | 194 } else { |
194 coalesced_gesture_events_.push_back(gesture_event); | 195 coalesced_gesture_events_.push_back(gesture_event); |
195 } | 196 } |
196 } | 197 } |
197 | 198 |
198 } // namespace content | 199 } // namespace content |
OLD | NEW |