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 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 | 2234 |
2235 return 0; | 2235 return 0; |
2236 } | 2236 } |
2237 | 2237 |
2238 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, | 2238 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, |
2239 gin::Arguments* args) { | 2239 gin::Arguments* args) { |
2240 bool moved_beyond_slop_region; | 2240 bool moved_beyond_slop_region; |
2241 uint32_t unique_touch_event_id; | 2241 uint32_t unique_touch_event_id; |
2242 GetOptionalTouchArgs(args, moved_beyond_slop_region, unique_touch_event_id); | 2242 GetOptionalTouchArgs(args, moved_beyond_slop_region, unique_touch_event_id); |
2243 | 2243 |
2244 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), | 2244 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::kTouchesLengthCap), |
2245 touch_points_.size()); | 2245 touch_points_.size()); |
2246 if (force_layout_on_events_) | 2246 if (force_layout_on_events_) |
2247 view()->updateAllLifecyclePhases(); | 2247 view()->updateAllLifecyclePhases(); |
2248 | 2248 |
2249 WebTouchEvent touch_event; | 2249 WebTouchEvent touch_event; |
2250 touch_event.type = type; | 2250 touch_event.type = type; |
2251 touch_event.modifiers = touch_modifiers_; | 2251 touch_event.modifiers = touch_modifiers_; |
2252 touch_event.dispatchType = touch_cancelable_ | 2252 touch_event.dispatchType = touch_cancelable_ |
2253 ? WebInputEvent::Blocking | 2253 ? WebInputEvent::Blocking |
2254 : WebInputEvent::EventNonBlocking; | 2254 : WebInputEvent::EventNonBlocking; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2856 } | 2856 } |
2857 | 2857 |
2858 std::unique_ptr<WebInputEvent> EventSender::ScaleEvent( | 2858 std::unique_ptr<WebInputEvent> EventSender::ScaleEvent( |
2859 const WebInputEvent& event) { | 2859 const WebInputEvent& event) { |
2860 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the event | 2860 // ui::ScaleWebInputEvent returns nullptr when the scale is 1.0f as the event |
2861 // does not have to be converted. | 2861 // does not have to be converted. |
2862 return ui::ScaleWebInputEvent(event, delegate()->GetWindowToViewportScale()); | 2862 return ui::ScaleWebInputEvent(event, delegate()->GetWindowToViewportScale()); |
2863 } | 2863 } |
2864 | 2864 |
2865 } // namespace test_runner | 2865 } // namespace test_runner |
OLD | NEW |