Commit c275fc57 authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Handle swipes with no preceding scroll events

I incorrectly assumed that any ET_GESTURE_SWIPE would be preceded by an
ET_GESTURE_SCROLL_BEGIN. Sometimes this is not the case, and this caused a
DCHECK.

This change handles swipes that weren't preceded by a scroll event.

Bug: None
Change-Id: I535e43a10e6f6162080af4ba4b85a8fefc8e2cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128091Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754717}
parent c99af485
...@@ -201,7 +201,11 @@ class WebUITabStripContainerView::DragToOpenHandler : public ui::EventHandler { ...@@ -201,7 +201,11 @@ class WebUITabStripContainerView::DragToOpenHandler : public ui::EventHandler {
// sent after. From logging, it seems like ET_GESTURE_SCROLL_END // sent after. From logging, it seems like ET_GESTURE_SCROLL_END
// is sometimes also sent after this. It will be ignored here // is sometimes also sent after this. It will be ignored here
// since |drag_in_progress_| is set to false. // since |drag_in_progress_| is set to false.
DCHECK(drag_in_progress_); if (!drag_in_progress_) {
// If a swipe happens quickly enough, scroll events might not
// have been sent. Tell the container a drag began.
container_->UpdateHeightForDragToOpen(0.0f);
}
container_->EndDragToOpen(event->details().swipe_down()); container_->EndDragToOpen(event->details().swipe_down());
event->SetHandled(); event->SetHandled();
drag_in_progress_ = false; drag_in_progress_ = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment