OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/input/content_gesture_provider.h" | 5 #include "content/browser/renderer_host/input/content_gesture_provider.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 void ContentGestureProvider::OnTouchEventAck(InputEventAckState ack_state) { | 174 void ContentGestureProvider::OnTouchEventAck(InputEventAckState ack_state) { |
175 DCHECK_NE(INPUT_EVENT_ACK_STATE_UNKNOWN, ack_state); | 175 DCHECK_NE(INPUT_EVENT_ACK_STATE_UNKNOWN, ack_state); |
176 gesture_filter_.OnTouchEventAck( | 176 gesture_filter_.OnTouchEventAck( |
177 ToTouchDispositionGestureFilterAck(ack_state)); | 177 ToTouchDispositionGestureFilterAck(ack_state)); |
178 } | 178 } |
179 | 179 |
180 void ContentGestureProvider::ResetGestureDetectors() { | 180 void ContentGestureProvider::ResetGestureDetectors() { |
181 gesture_provider_.ResetGestureDetectors(); | 181 gesture_provider_.ResetGestureDetectors(); |
182 } | 182 } |
183 | 183 |
184 void ContentGestureProvider::CancelActiveTouchSequence() { | |
185 gesture_provider_.CancelActiveTouchSequence(); | |
186 } | |
187 | |
188 void ContentGestureProvider::SetMultiTouchSupportEnabled(bool enabled) { | 184 void ContentGestureProvider::SetMultiTouchSupportEnabled(bool enabled) { |
189 gesture_provider_.SetMultiTouchSupportEnabled(enabled); | 185 gesture_provider_.SetMultiTouchSupportEnabled(enabled); |
190 } | 186 } |
191 | 187 |
192 void ContentGestureProvider::SetDoubleTapSupportForPlatformEnabled( | 188 void ContentGestureProvider::SetDoubleTapSupportForPlatformEnabled( |
193 bool enabled) { | 189 bool enabled) { |
194 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); | 190 gesture_provider_.SetDoubleTapSupportForPlatformEnabled(enabled); |
195 } | 191 } |
196 | 192 |
197 void ContentGestureProvider::SetDoubleTapSupportForPageEnabled(bool enabled) { | 193 void ContentGestureProvider::SetDoubleTapSupportForPageEnabled(bool enabled) { |
198 gesture_provider_.SetDoubleTapSupportForPageEnabled(enabled); | 194 gesture_provider_.SetDoubleTapSupportForPageEnabled(enabled); |
199 } | 195 } |
200 | 196 |
| 197 const ui::MotionEvent* ContentGestureProvider::GetCurrentDownEvent() const { |
| 198 return gesture_provider_.current_down_event(); |
| 199 } |
| 200 |
201 void ContentGestureProvider::OnGestureEvent( | 201 void ContentGestureProvider::OnGestureEvent( |
202 const ui::GestureEventData& event) { | 202 const ui::GestureEventData& event) { |
203 if (handling_event_) { | 203 if (handling_event_) { |
204 pending_gesture_packet_.Push(event); | 204 pending_gesture_packet_.Push(event); |
205 return; | 205 return; |
206 } | 206 } |
207 | 207 |
208 gesture_filter_.OnGesturePacket( | 208 gesture_filter_.OnGesturePacket( |
209 ui::GestureEventDataPacket::FromTouchTimeout(event)); | 209 ui::GestureEventDataPacket::FromTouchTimeout(event)); |
210 } | 210 } |
211 | 211 |
212 void ContentGestureProvider::ForwardGestureEvent( | 212 void ContentGestureProvider::ForwardGestureEvent( |
213 const ui::GestureEventData& event) { | 213 const ui::GestureEventData& event) { |
214 client_->OnGestureEvent(CreateGesture(event, touch_to_gesture_scale_)); | 214 client_->OnGestureEvent(CreateGesture(event, touch_to_gesture_scale_)); |
215 } | 215 } |
216 | 216 |
217 } // namespace content | 217 } // namespace content |
OLD | NEW |