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/shell/renderer/test_runner/event_sender.h" | 5 #include "content/shell/renderer/test_runner/event_sender.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/shell/renderer/test_runner/MockSpellCheck.h" | 10 #include "content/shell/renderer/test_runner/MockSpellCheck.h" |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type) { | 1757 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type) { |
1758 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), | 1758 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), |
1759 touch_points_.size()); | 1759 touch_points_.size()); |
1760 if (force_layout_on_events_) | 1760 if (force_layout_on_events_) |
1761 view_->layout(); | 1761 view_->layout(); |
1762 | 1762 |
1763 WebTouchEvent touch_event; | 1763 WebTouchEvent touch_event; |
1764 touch_event.type = type; | 1764 touch_event.type = type; |
1765 touch_event.modifiers = touch_modifiers_; | 1765 touch_event.modifiers = touch_modifiers_; |
1766 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); | 1766 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); |
| 1767 if (type == WebInputEvent::TouchCancel) |
| 1768 touch_event.cancelable = false; |
1767 touch_event.touchesLength = touch_points_.size(); | 1769 touch_event.touchesLength = touch_points_.size(); |
1768 for (size_t i = 0; i < touch_points_.size(); ++i) | 1770 for (size_t i = 0; i < touch_points_.size(); ++i) |
1769 touch_event.touches[i] = touch_points_[i]; | 1771 touch_event.touches[i] = touch_points_[i]; |
1770 view_->handleInputEvent(touch_event); | 1772 view_->handleInputEvent(touch_event); |
1771 | 1773 |
1772 for (size_t i = 0; i < touch_points_.size(); ++i) { | 1774 for (size_t i = 0; i < touch_points_.size(); ++i) { |
1773 WebTouchPoint* touch_point = &touch_points_[i]; | 1775 WebTouchPoint* touch_point = &touch_points_[i]; |
1774 if (touch_point->state == WebTouchPoint::StateReleased) { | 1776 if (touch_point->state == WebTouchPoint::StateReleased) { |
1775 touch_points_.erase(touch_points_.begin() + i); | 1777 touch_points_.erase(touch_points_.begin() + i); |
1776 --i; | 1778 --i; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 } | 2132 } |
2131 default: | 2133 default: |
2132 NOTREACHED(); | 2134 NOTREACHED(); |
2133 } | 2135 } |
2134 } | 2136 } |
2135 | 2137 |
2136 replaying_saved_events_ = false; | 2138 replaying_saved_events_ = false; |
2137 } | 2139 } |
2138 | 2140 |
2139 } // namespace content | 2141 } // namespace content |
OLD | NEW |