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

Unified Diff: ui/touch_selection/longpress_drag_selector.cc

Issue 1537493006: Allow scrolling a page with selection after long-press on whitespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ui/touch_selection/longpress_drag_selector.cc
diff --git a/ui/touch_selection/longpress_drag_selector.cc b/ui/touch_selection/longpress_drag_selector.cc
index b84c90da9e137cc9f5c068ae75941aa8aaededa6..fdc3221118a87a41803686afb13042c5beae7b07 100644
--- a/ui/touch_selection/longpress_drag_selector.cc
+++ b/ui/touch_selection/longpress_drag_selector.cc
@@ -108,7 +108,7 @@ bool LongPressDragSelector::WillHandleTouchEvent(const MotionEvent& event) {
}
bool LongPressDragSelector::IsActive() const {
- return state_ != INACTIVE && state_ != LONGPRESS_PENDING;
+ return state_ == DRAG_PENDING || state_ == DRAGGING;
}
void LongPressDragSelector::OnLongPressEvent(base::TimeTicks event_time,
@@ -126,6 +126,10 @@ void LongPressDragSelector::OnLongPressEvent(base::TimeTicks event_time,
}
}
+void LongPressDragSelector::OnScrollBeginEvent() {
+ SetState(INACTIVE);
+}
+
void LongPressDragSelector::OnSelectionActivated() {
if (state_ == SELECTION_PENDING)
SetState(DRAG_PENDING);
« no previous file with comments | « ui/touch_selection/longpress_drag_selector.h ('k') | ui/touch_selection/longpress_drag_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698