OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/input/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
6 | 6 |
7 #include "core/dom/DocumentUserGestureToken.h" | 7 #include "core/dom/DocumentUserGestureToken.h" |
8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
9 #include "core/dom/shadow/FlatTreeTraversal.h" | 9 #include "core/dom/shadow/FlatTreeTraversal.h" |
10 #include "core/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 if (event.GetType() == WebInputEvent::kTouchEnd && | 311 if (event.GetType() == WebInputEvent::kTouchEnd && |
312 !in_canceled_state_for_pointer_type_touch_ && !touch_infos.IsEmpty() && | 312 !in_canceled_state_for_pointer_type_touch_ && !touch_infos.IsEmpty() && |
313 touch_infos[0].target_frame) { | 313 touch_infos[0].target_frame) { |
314 possible_gesture_token = DocumentUserGestureToken::Create( | 314 possible_gesture_token = DocumentUserGestureToken::Create( |
315 touch_infos[0].target_frame->GetDocument()); | 315 touch_infos[0].target_frame->GetDocument()); |
316 } | 316 } |
317 UserGestureIndicator holder(possible_gesture_token); | 317 UserGestureIndicator holder(possible_gesture_token); |
318 | 318 |
319 DispatchTouchPointerEvents(event, coalesced_events, touch_infos); | 319 DispatchTouchPointerEvents(event, coalesced_events, touch_infos); |
320 | 320 |
321 return touch_event_manager_->HandleTouchEvent(event, touch_infos); | 321 return touch_event_manager_->HandleTouchEvent(event, coalesced_events, |
| 322 touch_infos); |
322 } | 323 } |
323 | 324 |
324 void PointerEventManager::ComputeTouchTargets( | 325 void PointerEventManager::ComputeTouchTargets( |
325 const WebTouchEvent& event, | 326 const WebTouchEvent& event, |
326 HeapVector<TouchEventManager::TouchInfo>& touch_infos) { | 327 HeapVector<TouchEventManager::TouchInfo>& touch_infos) { |
327 for (unsigned touch_point = 0; touch_point < event.touches_length; | 328 for (unsigned touch_point = 0; touch_point < event.touches_length; |
328 ++touch_point) { | 329 ++touch_point) { |
329 TouchEventManager::TouchInfo touch_info; | 330 TouchEventManager::TouchInfo touch_info; |
330 touch_info.point = event.TouchPointInRootFrame(touch_point); | 331 touch_info.point = event.TouchPointInRootFrame(touch_point); |
331 | 332 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 if (first_id > unique_touch_event_id) | 718 if (first_id > unique_touch_event_id) |
718 return false; | 719 return false; |
719 touch_ids_for_canceled_pointerdowns_.TakeFirst(); | 720 touch_ids_for_canceled_pointerdowns_.TakeFirst(); |
720 if (first_id == unique_touch_event_id) | 721 if (first_id == unique_touch_event_id) |
721 return true; | 722 return true; |
722 } | 723 } |
723 return false; | 724 return false; |
724 } | 725 } |
725 | 726 |
726 } // namespace blink | 727 } // namespace blink |
OLD | NEW |