| 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 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2156 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, | 2156 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, |
| 2157 bool movedBeyondSlopRegion) { | 2157 bool movedBeyondSlopRegion) { |
| 2158 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), | 2158 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), |
| 2159 touch_points_.size()); | 2159 touch_points_.size()); |
| 2160 if (force_layout_on_events_) | 2160 if (force_layout_on_events_) |
| 2161 view_->updateAllLifecyclePhases(); | 2161 view_->updateAllLifecyclePhases(); |
| 2162 | 2162 |
| 2163 WebTouchEvent touch_event; | 2163 WebTouchEvent touch_event; |
| 2164 touch_event.type = type; | 2164 touch_event.type = type; |
| 2165 touch_event.modifiers = touch_modifiers_; | 2165 touch_event.modifiers = touch_modifiers_; |
| 2166 touch_event.cancelable = touch_cancelable_; | 2166 touch_event.dispatchType = touch_cancelable_ |
| 2167 ? WebInputEvent::Blocking |
| 2168 : WebInputEvent::EventNonBlocking; |
| 2167 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); | 2169 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); |
| 2168 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion; | 2170 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion; |
| 2169 touch_event.touchesLength = touch_points_.size(); | 2171 touch_event.touchesLength = touch_points_.size(); |
| 2170 for (size_t i = 0; i < touch_points_.size(); ++i) | 2172 for (size_t i = 0; i < touch_points_.size(); ++i) |
| 2171 touch_event.touches[i] = touch_points_[i]; | 2173 touch_event.touches[i] = touch_points_[i]; |
| 2172 HandleInputEventOnViewOrPopup(touch_event); | 2174 HandleInputEventOnViewOrPopup(touch_event); |
| 2173 | 2175 |
| 2174 for (size_t i = 0; i < touch_points_.size(); ++i) { | 2176 for (size_t i = 0; i < touch_points_.size(); ++i) { |
| 2175 WebTouchPoint* touch_point = &touch_points_[i]; | 2177 WebTouchPoint* touch_point = &touch_points_[i]; |
| 2176 if (touch_point->state == WebTouchPoint::StateReleased | 2178 if (touch_point->state == WebTouchPoint::StateReleased |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 &end_event); | 2763 &end_event); |
| 2762 end_event.data.scrollEnd.deltaUnits = | 2764 end_event.data.scrollEnd.deltaUnits = |
| 2763 begin_event.data.scrollBegin.deltaHintUnits; | 2765 begin_event.data.scrollBegin.deltaHintUnits; |
| 2764 | 2766 |
| 2765 if (force_layout_on_events_) | 2767 if (force_layout_on_events_) |
| 2766 view_->updateAllLifecyclePhases(); | 2768 view_->updateAllLifecyclePhases(); |
| 2767 HandleInputEventOnViewOrPopup(end_event); | 2769 HandleInputEventOnViewOrPopup(end_event); |
| 2768 } | 2770 } |
| 2769 | 2771 |
| 2770 } // namespace test_runner | 2772 } // namespace test_runner |
| OLD | NEW |