| 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 "components/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, | 2153 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, |
| 2154 bool movedBeyondSlopRegion) { | 2154 bool movedBeyondSlopRegion) { |
| 2155 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), | 2155 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), |
| 2156 touch_points_.size()); | 2156 touch_points_.size()); |
| 2157 if (force_layout_on_events_) | 2157 if (force_layout_on_events_) |
| 2158 view_->updateAllLifecyclePhases(); | 2158 view_->updateAllLifecyclePhases(); |
| 2159 | 2159 |
| 2160 WebTouchEvent touch_event; | 2160 WebTouchEvent touch_event; |
| 2161 touch_event.type = type; | 2161 touch_event.type = type; |
| 2162 touch_event.modifiers = touch_modifiers_; | 2162 touch_event.modifiers = touch_modifiers_; |
| 2163 touch_event.cancelable = touch_cancelable_; | 2163 touch_event.dispatchType = |
| 2164 touch_cancelable_ ? WebInputEvent::NonBlocking : WebInputEvent::Blocking; |
| 2164 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); | 2165 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); |
| 2165 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion; | 2166 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion; |
| 2166 touch_event.touchesLength = touch_points_.size(); | 2167 touch_event.touchesLength = touch_points_.size(); |
| 2167 for (size_t i = 0; i < touch_points_.size(); ++i) | 2168 for (size_t i = 0; i < touch_points_.size(); ++i) |
| 2168 touch_event.touches[i] = touch_points_[i]; | 2169 touch_event.touches[i] = touch_points_[i]; |
| 2169 HandleInputEventOnViewOrPopup(touch_event); | 2170 HandleInputEventOnViewOrPopup(touch_event); |
| 2170 | 2171 |
| 2171 for (size_t i = 0; i < touch_points_.size(); ++i) { | 2172 for (size_t i = 0; i < touch_points_.size(); ++i) { |
| 2172 WebTouchPoint* touch_point = &touch_points_[i]; | 2173 WebTouchPoint* touch_point = &touch_points_[i]; |
| 2173 if (touch_point->state == WebTouchPoint::StateReleased | 2174 if (touch_point->state == WebTouchPoint::StateReleased |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2758 &end_event); | 2759 &end_event); |
| 2759 end_event.data.scrollEnd.deltaUnits = | 2760 end_event.data.scrollEnd.deltaUnits = |
| 2760 begin_event.data.scrollBegin.deltaHintUnits; | 2761 begin_event.data.scrollBegin.deltaHintUnits; |
| 2761 | 2762 |
| 2762 if (force_layout_on_events_) | 2763 if (force_layout_on_events_) |
| 2763 view_->updateAllLifecyclePhases(); | 2764 view_->updateAllLifecyclePhases(); |
| 2764 HandleInputEventOnViewOrPopup(end_event); | 2765 HandleInputEventOnViewOrPopup(end_event); |
| 2765 } | 2766 } |
| 2766 | 2767 |
| 2767 } // namespace test_runner | 2768 } // namespace test_runner |
| OLD | NEW |