Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: components/test_runner/event_sender.cc

Issue 1911373002: Articulate the cancel behavior in the WebTouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type, 2004 void EventSender::SendCurrentTouchEvent(WebInputEvent::Type type,
2005 bool movedBeyondSlopRegion) { 2005 bool movedBeyondSlopRegion) {
2006 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap), 2006 DCHECK_GT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap),
2007 touch_points_.size()); 2007 touch_points_.size());
2008 if (force_layout_on_events_) 2008 if (force_layout_on_events_)
2009 view_->updateAllLifecyclePhases(); 2009 view_->updateAllLifecyclePhases();
2010 2010
2011 WebTouchEvent touch_event; 2011 WebTouchEvent touch_event;
2012 touch_event.type = type; 2012 touch_event.type = type;
2013 touch_event.modifiers = touch_modifiers_; 2013 touch_event.modifiers = touch_modifiers_;
2014 touch_event.cancelable = touch_cancelable_; 2014 touch_event.dispatchType = touch_cancelable_
2015 ? WebInputEvent::Blocking
2016 : WebInputEvent::EventNonBlocking;
2015 touch_event.timeStampSeconds = GetCurrentEventTimeSec(); 2017 touch_event.timeStampSeconds = GetCurrentEventTimeSec();
2016 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion; 2018 touch_event.movedBeyondSlopRegion = movedBeyondSlopRegion;
2017 touch_event.touchesLength = touch_points_.size(); 2019 touch_event.touchesLength = touch_points_.size();
2018 for (size_t i = 0; i < touch_points_.size(); ++i) 2020 for (size_t i = 0; i < touch_points_.size(); ++i)
2019 touch_event.touches[i] = touch_points_[i]; 2021 touch_event.touches[i] = touch_points_[i];
2020 HandleInputEventOnViewOrPopup(touch_event); 2022 HandleInputEventOnViewOrPopup(touch_event);
2021 2023
2022 for (size_t i = 0; i < touch_points_.size(); ++i) { 2024 for (size_t i = 0; i < touch_points_.size(); ++i) {
2023 WebTouchPoint* touch_point = &touch_points_[i]; 2025 WebTouchPoint* touch_point = &touch_points_[i];
2024 if (touch_point->state == WebTouchPoint::StateReleased 2026 if (touch_point->state == WebTouchPoint::StateReleased
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 &end_event); 2617 &end_event);
2616 end_event.data.scrollEnd.deltaUnits = 2618 end_event.data.scrollEnd.deltaUnits =
2617 begin_event.data.scrollBegin.deltaHintUnits; 2619 begin_event.data.scrollBegin.deltaHintUnits;
2618 2620
2619 if (force_layout_on_events_) 2621 if (force_layout_on_events_)
2620 view_->updateAllLifecyclePhases(); 2622 view_->updateAllLifecyclePhases();
2621 HandleInputEventOnViewOrPopup(end_event); 2623 HandleInputEventOnViewOrPopup(end_event);
2622 } 2624 }
2623 2625
2624 } // namespace test_runner 2626 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698